From ff9dd3e3e004ff49878f50bc1a06dce590002bb8 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 13 Jul 2023 16:52:15 +0100 Subject: [PATCH] tests: additional tests for rmatmul added. --- tests/correlators_test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index b8817ca3..7a0294f9 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -610,6 +610,7 @@ def test_matmul_overloading(): # 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 comp = mat @ pe.dirac.gammaX @@ -645,9 +646,12 @@ def test_matrix_trace(): for el in corr.trace(): el == np.sum(np.diag(mat)) + # Trace is cyclic + for one, two in zip((pe.dirac.gammaX @ corr).trace(), (corr @ pe.dirac.gammaX).trace()): + assert np.all(one == two) + # Antisymmetric matrices are traceless. mat = (mat - mat.T) / 2 - corr = pe.Corr([mat] * 4) for el in corr.trace(): assert el == 0