mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 12:03:42 +02:00
Euclidean gamma matrix tests added
This commit is contained in:
parent
078ee76b29
commit
fe766cb44e
2 changed files with 13 additions and 4 deletions
|
@ -134,10 +134,7 @@ def Zq(prop, fermion='Wilson'):
|
||||||
sin_mom = np.sin(2 * np.pi / L * mom)
|
sin_mom = np.sin(2 * np.pi / L * mom)
|
||||||
|
|
||||||
if fermion == 'Wilson':
|
if fermion == 'Wilson':
|
||||||
p_slash = -1j * (sin_mom[0] * gamma[0]
|
p_slash = -1j * (sin_mom[0] * gamma[0] + sin_mom[1] * gamma[1] + sin_mom[2] * gamma[2] + sin_mom[3] * gamma[3]) / np.sum(sin_mom ** 2)
|
||||||
+ sin_mom[1] * gamma[1]
|
|
||||||
+ sin_mom[2] * gamma[2]
|
|
||||||
+ sin_mom[3] * gamma[3]) / np.sum(sin_mom ** 2)
|
|
||||||
else:
|
else:
|
||||||
raise Exception("Fermion type '" + fermion + "' not implemented")
|
raise Exception("Fermion type '" + fermion + "' not implemented")
|
||||||
|
|
||||||
|
|
12
tests/test_npr.py
Normal file
12
tests/test_npr.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import numpy as np
|
||||||
|
import pyerrors as pe
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
np.random.seed(0)
|
||||||
|
|
||||||
|
|
||||||
|
def test_gamma_matrices():
|
||||||
|
for matrix in pe.npr.gamma:
|
||||||
|
assert np.allclose(matrix @ matrix, np.identity(4))
|
||||||
|
assert np.allclose(matrix, matrix.T.conj())
|
||||||
|
assert np.allclose(pe.npr.gamma5, pe.npr.gamma[0] @ pe.npr.gamma[1] @ pe.npr.gamma[2] @ pe.npr.gamma[3])
|
Loading…
Add table
Add a link
Reference in a new issue