Skip to content

Commit 3bd8d9c

Browse files
authored
Fix pre-commit issues. (#97)
1 parent 4dfe4e2 commit 3bd8d9c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

z2pack/hm.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ def __init__(
8080

8181
size = len(self._hamilton([0] * dim)) # assuming to be square...
8282
if not self._hamilton_orthogonal:
83-
size_S = len(self._basis_overlap([0] * dim)) # assuming to be square...
83+
size_S = len( # pylint: disable=invalid-name
84+
self._basis_overlap([0] * dim)
85+
) # assuming to be square...
8486
if size_S != size:
8587
raise ValueError(
86-
'The dimensions of overlap matrix ({0}) and Hamilontonian ({1}) do not match.'.
87-
format(size_S, size)
88+
'The dimensions of overlap matrix ({0}) and Hamilontonian ({1}) do not match.'
89+
.format(size_S, size)
8890
)
8991

9092
# add one atom for each orbital in the hamiltonian
@@ -123,14 +125,16 @@ def get_eig(self, kpt):
123125
if not self._hamilton_orthogonal:
124126
ovl = self._basis_overlap(k)
125127
if self._hermitian_tol is not None:
126-
diff = la.norm(ovl - ovl.conjugate().transpose(), ord=np.inf)
128+
diff = la.norm(
129+
ovl - ovl.conjugate().transpose(), ord=np.inf
130+
)
127131
if diff > self._hermitian_tol:
128132
raise ValueError(
129-
'The overlap you used is not hermitian, with the maximum difference between the overlap matrix and its adjoint being {0}. Use the ``hermitian_tol`` input parameter (currently {1}) to set the sensitivity of this test or turn it off completely (``hermitian_tol=None``).'.
130-
format(diff, self._hermitian_tol)
133+
'The overlap you used is not hermitian, with the maximum difference between the overlap matrix and its adjoint being {0}. Use the ``hermitian_tol`` input parameter (currently {1}) to set the sensitivity of this test or turn it off completely (``hermitian_tol=None``).'
134+
.format(diff, self._hermitian_tol)
131135
)
132136
ovl2 = la.inv(la.sqrtm(ovl))
133-
ortho_ham = np.dot(ovl2,ham.dot(ovl2))
137+
ortho_ham = np.dot(ovl2, ham.dot(ovl2))
134138
ham = ortho_ham
135139

136140
eigval, eigvec = la.eigh(ham)

0 commit comments

Comments
 (0)