Skip to content

Commit

Permalink
Merge branch 'main' into latticemodel
Browse files Browse the repository at this point in the history
  • Loading branch information
manoelmarques authored Sep 17, 2021
2 parents 0fd806e + 21dae90 commit 41f1776
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ disable=no-self-use, # disabled as it is too verbose
no-else-return, # relax "elif" after a clause with a return
docstring-first-line-empty, # relax docstring style
import-outside-toplevel,
bad-continuation, bad-whitespace # differences of opinion with black
bad-continuation, bad-whitespace, # differences of opinion with black
consider-using-f-string,



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def integral_operator(self, density: OneBodyElectronicIntegrals) -> OneBodyElect
def second_q_ops(self) -> List[FermionicOp]:
"""Returns a list containing the Hamiltonian constructed by the stored electronic integrals."""
ints = None
if ElectronicBasis.SO in self._electronic_integrals.keys():
if ElectronicBasis.SO in self._electronic_integrals:
ints = self._electronic_integrals[ElectronicBasis.SO]
elif ElectronicBasis.MO in self._electronic_integrals.keys():
elif ElectronicBasis.MO in self._electronic_integrals:
ints = self._electronic_integrals[ElectronicBasis.MO]
return [sum(int.to_second_q_op() for int in ints.values()).reduce()] # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def to_basis(self) -> np.ndarray:
# permutations (lower triangular indices) for the next step
index_list.append(zip(cycle([mode]), iter_1))
for m, n in iter_2:
if (mode - 1, m, n, power, kinetic_term) in coeff_cache.keys():
if (mode - 1, m, n, power, kinetic_term) in coeff_cache:
# value already in cache
continue
coeff_cache[(mode - 1, m, n, power, kinetic_term)] = self.basis.eval_integral(
Expand Down

0 comments on commit 41f1776

Please sign in to comment.