Skip to content

Commit

Permalink
add missing typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mganahl committed Jul 9, 2020
1 parent 42ac887 commit 00ef0db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tensornetwork/block_sparse/charge.py
Expand Up @@ -537,11 +537,11 @@ class U1Charge(BaseCharge):
"""Charge Class for the U1 symmetry group."""

@staticmethod
def fuse(charge1, charge2) -> np.ndarray:
def fuse(charge1:np.ndarray, charge2:np.ndarray) -> np.ndarray:
return np.add.outer(charge1, charge2).ravel()

@staticmethod
def dual_charges(charges) -> np.ndarray:
def dual_charges(charges:np.ndarray) -> np.ndarray:
return charges * charges.dtype.type(-1)

@staticmethod
Expand Down Expand Up @@ -573,12 +573,12 @@ def __init__(self,
charge_dtype=charge_dtype)

@staticmethod
def fuse(charge1, charge2) -> np.ndarray:
def fuse(charge1:np.ndarray, charge2:np.ndarray) -> np.ndarray:
#pylint: disable=no-member
return np.bitwise_xor.outer(charge1, charge2).ravel()

@staticmethod
def dual_charges(charges) -> np.ndarray:
def dual_charges(charges:np.ndarray) -> np.ndarray:
return charges

@staticmethod
Expand Down Expand Up @@ -625,12 +625,12 @@ def __init__(self,
charge_dtype=charge_dtype)

@staticmethod
def fuse(charge1, charge2) -> np.ndarray:
def fuse(charge1:np.ndarray, charge2:np.ndarray) -> np.ndarray:
#pylint: disable=no-member
return np.outer(charge1, charge2).ravel() % n

@staticmethod
def dual_charges(charges) -> np.ndarray:
def dual_charges(charges:np.ndarray) -> np.ndarray:
return (n - charges) % n

@staticmethod
Expand Down

0 comments on commit 00ef0db

Please sign in to comment.