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