From c30c8ebe0bfc704e574728243810a655064369c4 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 13 Jul 2023 16:54:31 +0100 Subject: [PATCH] tests: one more tests for rmatmul added. --- tests/correlators_test.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 7a0294f9..7eb3d9b6 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -608,15 +608,20 @@ def test_matmul_overloading(): mat = np.array(ll).reshape(N, N) # Multiply with gamma matrix - mat @ pe.dirac.gammaX corr = pe.Corr([mat] * 4, padding=[0, 1]) - pe.dirac.gammaX @ corr - mcorr = corr @ pe.dirac.gammaX + # __matmul__ + mcorr = corr @ pe.dirac.gammaX comp = mat @ pe.dirac.gammaX for i in range(4): assert np.all(mcorr[i] == comp) + # __rmatmul__ + mcorr = pe.dirac.gammaX @ corr + comp = pe.dirac.gammaX @ mat + for i in range(4): + assert np.all(mcorr[i] == comp) + test_mat = pe.dirac.gamma5 + pe.dirac.gammaX icorr = corr @ test_mat @ np.linalg.inv(test_mat) tt = corr - icorr