tests: one more tests for rmatmul added.

This commit is contained in:
Fabian Joswig 2023-07-13 16:54:31 +01:00
parent ff9dd3e3e0
commit c30c8ebe0b
No known key found for this signature in database

View file

@ -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