mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
tests: one more tests for rmatmul added.
This commit is contained in:
parent
ff9dd3e3e0
commit
c30c8ebe0b
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue