From bbbacc7bb4f8100e924f8d8e95ba2836f01170da Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 13 Jul 2023 17:08:00 +0100 Subject: [PATCH] tests: associative property test added for complex Corr matmul. --- tests/correlators_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 7eb3d9b6..e1b02174 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -628,6 +628,12 @@ def test_matmul_overloading(): for i in range(4): assert np.all(tt[i] == 0) + # associative property + tt = (corr.real @ pe.dirac.gammaX + corr.imag @ (pe.dirac.gammaX * 1j)) - corr @ pe.dirac.gammaX + for el in tt: + if el is not None: + assert np.all(el == 0) + corr2 = corr @ corr for i in range(4): np.all(corr2[i] == corr[i] @ corr[i])