tests: associative property test added for complex Corr matmul.

This commit is contained in:
Fabian Joswig 2023-07-13 17:08:00 +01:00
parent 4df00d9bd7
commit bbbacc7bb4
No known key found for this signature in database

View file

@ -628,6 +628,12 @@ def test_matmul_overloading():
for i in range(4):
assert np.all(tt[i] == 0)
# associative property
tt = (corr.real @ pe.dirac.gammaX + corr.imag @ (pe.dirac.gammaX * 1j)) - corr @ pe.dirac.gammaX
for el in tt:
if el is not None:
assert np.all(el == 0)
corr2 = corr @ corr
for i in range(4):
np.all(corr2[i] == corr[i] @ corr[i])