Skip to content

Commit

Permalink
fix site_hamiltonian for Bose-Hubbard model
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Aug 5, 2023
1 parent 206bb0f commit da989ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tool/tenes_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ def initial_states(self, num_sublattice: int) -> np.ndarray:
return ret

def model_sitehamiltonian(self, params_onesite: Dict) -> np.ndarray:
N, Bdagger, B = self.onesite_ops
mu = params_onesite.get("mu", 0.0)
U = params_onesite.get("U", 0.0)
ham = np.zeros([self.N] * 2, dtype=np.complex128)
Expand Down Expand Up @@ -1109,7 +1110,6 @@ def hamiltonians(
lattice: Lattice, model: Model, use_onesite_hamiltonian: bool = False
) -> List[Hamiltonian]:
ret = []
elem = model.sitehamiltonian()
if use_onesite_hamiltonian:
elem = model.sitehamiltonian()
if not np.array_equal(elem, np.zeros(elem.shape, dtype=np.complex128)):
Expand Down

0 comments on commit da989ce

Please sign in to comment.