From 40724ce5a6219db6f96a1f91a07aa26b4bd9e27c Mon Sep 17 00:00:00 2001 From: Igor Krivenko Date: Mon, 1 Jul 2024 15:33:55 +0200 Subject: [PATCH] HilbertSpace: Fix unit test after krivenko/libcommute@da20d5f --- tests/test_hilbert_space.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_hilbert_space.py b/tests/test_hilbert_space.py index d888909..1e1ad28 100755 --- a/tests/test_hilbert_space.py +++ b/tests/test_hilbert_space.py @@ -327,26 +327,27 @@ def counter(i): def test_very_big_space(self): hs1 = HilbertSpace() - for i in range(32): + for i in range(31): hs1.add(make_space_spin(3 / 2, "s", i)) with self.assertRaisesRegex( RuntimeError, "Hilbert space size is not representable by a 64-bit integer " - "\\(n_bits = 66\\)" + "\\(n_bits = 64\\)" ): - hs1.add(make_space_spin(3 / 2, "s", 32)) + hs1.add(make_space_spin(3 / 2, "s", 31)) expr = ExpressionR(1.0) - for i in range(32): + for i in range(31): expr *= S_p("s", i, spin=3 / 2) + expr *= S_p("s", 31, spin=1 / 2) hs2 = HilbertSpace(expr) - self.assertEqual(hs2.total_n_bits, 64) + self.assertEqual(hs2.total_n_bits, 63) expr *= S_p("s", 32, spin=3 / 2) with self.assertRaisesRegex( RuntimeError, "Hilbert space size is not representable by a 64-bit integer " - "\\(n_bits = 66\\)" + "\\(n_bits = 65\\)" ): HilbertSpace(expr)