Skip to content

Commit

Permalink
add LangFirsov op mat
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtong1000 committed Sep 7, 2023
1 parent 0f1b31b commit 3294acb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions renormalizer/model/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ def copy(self, new_dof):
class BasisLangFirsov(BasisSHO):
is_phonon = True

def __init__(self, dof, nbas, x0=0., dvr=False, general_xp_power=False):
self.x0 = x0 # origin = x0
def __init__(self, dof, f, nbas, x0=0., dvr=False, general_xp_power=False):
omega = None
super().__init__(dof, omega, nbas, x0=0., dvr=False, general_xp_power=False)
super().__init__(dof, omega, nbas, x0=0., dvr=dvr, general_xp_power=general_xp_power)
self.f = f

def op_mat(self, op: Union[Op, str]):
if not isinstance(op, Op):
Expand All @@ -405,7 +405,10 @@ def op_mat(self, op: Union[Op, str]):

# second quantization formula
if op_symbol == "X":
mat = super().op_mat(op)
mat = super().op_mat(r"b^\dagger-b") * (-self.f)
mat = scipy.linalg.expm(mat)
elif op_symbol == r"X^\dagger":
mat = self.op_mat("X").conjugate().T
return mat * op_factor


Expand Down

0 comments on commit 3294acb

Please sign in to comment.