mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
_check_geometry added
This commit is contained in:
parent
7a55413b0e
commit
078ee76b29
1 changed files with 13 additions and 4 deletions
|
@ -111,15 +111,24 @@ class Npr_matrix(np.ndarray):
|
|||
self.mom_out = getattr(obj, 'mom_out', None)
|
||||
|
||||
|
||||
def _check_geometry():
|
||||
if L is None:
|
||||
raise Exception("Spatial extent 'L' not set.")
|
||||
else:
|
||||
if not isinstance(L, int):
|
||||
raise Exception("Spatial extent 'L' must be an integer.")
|
||||
if T is None:
|
||||
raise Exception("Temporal extent 'T' not set.")
|
||||
if not isinstance(T, int):
|
||||
raise Exception("Temporal extent 'T' must be an integer.")
|
||||
|
||||
|
||||
def _invert_propagator(prop):
|
||||
return Npr_matrix(mat_mat_op(anp.linalg.inv, prop), prop.mom_in)
|
||||
|
||||
|
||||
def Zq(prop, fermion='Wilson'):
|
||||
if L is None:
|
||||
raise Exception("Spatial extent 'L' not set.")
|
||||
if T is None:
|
||||
raise Exception("Spatial extent 'T' not set.")
|
||||
_check_geometry()
|
||||
mom = prop.mom_in
|
||||
mom[3] /= T / L
|
||||
sin_mom = np.sin(2 * np.pi / L * mom)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue