Skip to content

Commit

Permalink
simplify t2 symmetry test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed May 29, 2024
1 parent b0c8997 commit ecfe0e0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/python/random_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@

def assert_t2_has_correct_symmetry(t2: np.ndarray):
nocc, _, nvrt, _ = t2.shape
norb = nocc + nvrt
pairs = itertools.product(range(nocc), range(nocc, norb))
for (i, a), (j, b) in itertools.product(pairs, repeat=2):
np.testing.assert_allclose(
t2[i, j, a - nocc, b - nocc], t2[j, i, b - nocc, a - nocc]
)
for i, j, a, b in itertools.product(
range(nocc), range(nocc), range(nvrt), range(nvrt)
):
np.testing.assert_allclose(t2[i, j, a, b], t2[j, i, b, a])


def test_assert_t2_has_correct_symmetry():
Expand Down

0 comments on commit ecfe0e0

Please sign in to comment.