Skip to content

Commit a2fabeb

Browse files
committed
run check/format-incremental --apply
1 parent b32b55c commit a2fabeb

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

src/openfermion/ops/representations/quadratic_hamiltonian_test.py

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,12 @@ def test_majorana_form(self):
179179
def test_diagonalizing_bogoliubov_transform(self):
180180
"""Test diagonalizing Bogoliubov transform."""
181181
hermitian_part = numpy.array(
182-
[[0.0, 1.0, 0.0],
183-
[1.0, 0.0, 1.0],
184-
[0.0, 1.0, 0.0]],
185-
dtype=complex
186-
)
182+
[[0.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 0.0]], dtype=complex)
187183
antisymmetric_part = numpy.array(
188-
[[0.0, 1.0j, 0.0],
189-
[-1.0j, 0.0, 1.0j],
190-
[0.0, -1.0j, 0.0]],
191-
dtype=complex
192-
)
193-
quad_ham = QuadraticHamiltonian(hermitian_part,
194-
antisymmetric_part)
195-
block_matrix = numpy.zeros((6, 6),
196-
dtype=complex)
184+
[[0.0, 1.0j, 0.0], [-1.0j, 0.0, 1.0j], [0.0, -1.0j, 0.0]],
185+
dtype=complex)
186+
quad_ham = QuadraticHamiltonian(hermitian_part, antisymmetric_part)
187+
block_matrix = numpy.zeros((6, 6), dtype=complex)
197188
block_matrix[:3, :3] = antisymmetric_part
198189
block_matrix[:3, 3:] = hermitian_part
199190
block_matrix[3:, :3] = -hermitian_part.conj()
@@ -203,14 +194,11 @@ def test_diagonalizing_bogoliubov_transform(self):
203194
quad_ham.diagonalizing_bogoliubov_transform())
204195
left_block = transformation_matrix[:, :3]
205196
right_block = transformation_matrix[:, 3:]
206-
ferm_unitary = numpy.zeros((6, 6),
207-
dtype=complex)
197+
ferm_unitary = numpy.zeros((6, 6), dtype=complex)
208198
ferm_unitary[:3, :3] = left_block
209199
ferm_unitary[:3, 3:] = right_block
210-
ferm_unitary[3:, :3] = numpy.conjugate(
211-
right_block)
212-
ferm_unitary[3:, 3:] = numpy.conjugate(
213-
left_block)
200+
ferm_unitary[3:, :3] = numpy.conjugate(right_block)
201+
ferm_unitary[3:, 3:] = numpy.conjugate(left_block)
214202

215203
# Check that the transformation is diagonalizing
216204
majorana_matrix, _ = quad_ham.majorana_form()

src/openfermion/resource_estimates/molecule/pyscf_utils_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ def test_reduced_ccsd_t(self):
115115
pyscf_etot = mycas.e_tot
116116

117117
# Don't do triples (it's zero anyway for 2e) b/c div by zero w/ ROHF
118-
_, _, resource_estimates_etot = ccsd_t(
119-
*pyscf_to_cas(mf, n_orb, n_elec), no_triples=True)
118+
_, _, resource_estimates_etot = ccsd_t(*pyscf_to_cas(
119+
mf, n_orb, n_elec),
120+
no_triples=True)
120121

121122
# ignore relative tolerance, we just want absolute tolerance
122123
assert np.isclose(pyscf_etot, resource_estimates_etot, rtol=1E-14)

0 commit comments

Comments
 (0)