mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-16 12:33:41 +02:00
feat: epsilon tensors moved to dirac submodule, tests added
This commit is contained in:
parent
b50346dcf3
commit
c8cb0e4cb8
3 changed files with 36 additions and 12 deletions
|
@ -22,6 +22,30 @@ identity = np.array(
|
|||
dtype=complex)
|
||||
|
||||
|
||||
def epsilon_tensor(i, j, k):
|
||||
"""Rank-3 epsilon tensor
|
||||
|
||||
Based on https://codegolf.stackexchange.com/a/160375
|
||||
"""
|
||||
test_set = set((i, j, k))
|
||||
if not (test_set <= set((1, 2, 3)) or test_set <= set((0, 1, 2))):
|
||||
raise Exception("Unexpected input", i, j, k)
|
||||
|
||||
return (i - j) * (j - k) * (k - i) / 2
|
||||
|
||||
|
||||
def epsilon_tensor_rank4(i, j, k, o):
|
||||
"""Rank-4 epsilon tensor
|
||||
|
||||
Extension of https://codegolf.stackexchange.com/a/160375
|
||||
"""
|
||||
test_set = set((i, j, k, o))
|
||||
if not (test_set <= set((1, 2, 3, 4)) or test_set <= set((0, 1, 2, 3))):
|
||||
raise Exception("Unexpected input", i, j, k, o)
|
||||
|
||||
return (i - j) * (j - k) * (k - i) * (i - o) * (j - o) * (o - k) / 12
|
||||
|
||||
|
||||
def Grid_gamma(gamma_tag):
|
||||
"""Returns gamma matrix in Grid labeling."""
|
||||
if gamma_tag == 'Identity':
|
||||
|
|
|
@ -298,18 +298,6 @@ def read_Fourquark_hd5(path, filestem, ens_id, idl=None, vertices=["VA", "AV"]):
|
|||
return result_dict
|
||||
|
||||
|
||||
def _epsilon_tensor(i, j, k, o):
|
||||
"""Rank-4 epsilon tensor
|
||||
|
||||
Extension of https://codegolf.stackexchange.com/a/160375
|
||||
"""
|
||||
test_set = set((i, j, k, o))
|
||||
if not (test_set <= set((1, 2, 3, 4)) or test_set <= set((0, 1, 2, 3))):
|
||||
raise Exception("Unexpected input", i, j, k, o)
|
||||
|
||||
return (i - j) * (j - k) * (k - i) * (i - o) * (j - o) * (o - k) / 12
|
||||
|
||||
|
||||
def _get_lorentz_names(name):
|
||||
assert len(name) == 2
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue