Skip to content

Commit c93792c

Browse files
committed
fix style
1 parent 8c0a4d1 commit c93792c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

moha/molkit/hamiltonians.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def antisymmetrize(self):
4545
if not hasattr(self, "two_body_spin"):
4646
raise RuntimeError(
4747
"Call .spinize_H() first to compute spin-orbital form.")
48-
self.two_body_spin = antisymmetrize_two_body(self.two_body_spin, inplace=True)
48+
self.two_body_spin = antisymmetrize_two_body(self.two_body_spin,
49+
inplace=True)
4950

5051
def get_spin_blocks(self):
5152
"""Return the main spin blocks of the two-body spin-orbital tensor.

moha/molkit/utils/spinops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def antisymmetrize_two_body(
4949
The operation applied is
5050
5151
.. math::
52-
\langle i j \| k l\rangle=\langle i j \mid k l\rangle-\langle i j \mid l k\rangle
52+
\langle ij\| kl\rangle=
53+
\langle ij\mid kl\rangle-\langle ij\mid lk\rangle
5354
5455
Keep in mind, that such operation produces terms of the form
5556
abba, baab, that are not present in the original tensor.

moha/test/test_molham.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_antisymmetrize():
2525

2626
assert_allclose(mol_ham.two_body[:2, :2, :2, :2], expected_two_body_aa)
2727

28+
2829
def test_to_geminal():
2930
"""Test conversion to geminal basis."""
3031
n_orb = 4
@@ -53,12 +54,11 @@ def test_to_reduced_ham():
5354
mol_ham = MolHam(one_body=one_body, two_body=two_body)
5455
reduced_ham = mol_ham.to_reduced(n_elec=2)
5556

56-
5757
# sum over the spin-orbital indices
5858
reduced_ham = reduced_ham[:2, :2, :2, :2] +\
59-
reduced_ham[2:, 2:, 2:, 2:] +\
60-
reduced_ham[:2, 2:, :2, 2:] +\
61-
reduced_ham[2:, :2, 2:, :2]
59+
reduced_ham[2:, 2:, 2:, 2:] +\
60+
reduced_ham[:2, 2:, :2, 2:] +\
61+
reduced_ham[2:, :2, 2:, :2]
6262
reduced_ham *= 0.25
6363

6464
reduced_ham_true = 0.5 * two_body
@@ -67,4 +67,4 @@ def test_to_reduced_ham():
6767
reduced_ham_true[0, 1, 0, 1] = 1
6868
reduced_ham_true[1, 0, 1, 0] = 1
6969

70-
assert_allclose(reduced_ham, reduced_ham_true)
70+
assert_allclose(reduced_ham, reduced_ham_true)

0 commit comments

Comments
 (0)