Skip to content

Commit

Permalink
add missing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tjstavenger-pnnl committed Nov 13, 2024
1 parent e3ecb37 commit dd3aab8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions c2qa/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ def get_a1(self, cutoff_a: int, cutoff_b: int):
def get_a2(self, cutoff_a: int, cutoff_b: int):
return scipy.sparse.kron(self.get_eye(cutoff_a), self.get_a(cutoff_b)).tocsc()

def get_b1(self, cutoff_a: int, cutoff_b: int, cutoff_c: int):
return scipy.sparse.kron(self.get_a(cutoff_a), self.get_eye(cutoff_b), self.get_eye(cutoff_c)).tocsc()

def get_b2(self, cutoff_a: int, cutoff_b: int, cutoff_c: int):
return scipy.sparse.kron(self.get_eye(cutoff_a), self.get_a(cutoff_b), self.get_eye(cutoff_c)).tocsc()

def get_b3(self, cutoff_a: int, cutoff_b: int, cutoff_c: int):
return scipy.sparse.kron(self.get_eye(cutoff_a), self.get_eye(cutoff_b), self.get_a(cutoff_c)).tocsc()

def get_a12(self, cutoff_a: int, cutoff_b: int):
return self.get_a1(cutoff_a, cutoff_b) * self.get_a2(cutoff_a, cutoff_b)

def get_b123(self, cutoff_a: int, cutoff_b: int, cutoff_c: int):
return self.get_b1(cutoff_a, cutoff_b, cutoff_c) * self.get_b2(cutoff_a, cutoff_b, cutoff_c) * self.get_b3(cutoff_a, cutoff_b, cutoff_c)

def get_a_dag(self, cutoff: int):
"""Creation operator"""
a = self.get_a(cutoff)
Expand Down

0 comments on commit dd3aab8

Please sign in to comment.