mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-16 15:20:24 +01:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
466f3a09af
2 changed files with 14 additions and 3 deletions
|
@ -298,6 +298,18 @@ 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
|
||||
|
||||
|
|
|
@ -93,10 +93,9 @@ def test_correlated_fit():
|
|||
r = np.zeros((N, N))
|
||||
for i in range(N):
|
||||
for j in range(N):
|
||||
r[i, j] = np.exp(-0.1 * np.fabs(i - j))
|
||||
r[i, j] = np.exp(-0.8 * np.fabs(i - j))
|
||||
|
||||
errl = np.sqrt([3.4, 2.5, 3.6, 2.8, 4.2, 4.7, 4.9, 5.1, 3.2, 4.2])
|
||||
errl *= 4
|
||||
for i in range(N):
|
||||
for j in range(N):
|
||||
r[i, j] *= errl[i] * errl[j]
|
||||
|
@ -127,7 +126,7 @@ def test_correlated_fit():
|
|||
for i in range(2):
|
||||
diff = fitp[i] - fitpc[i]
|
||||
diff.gamma_method()
|
||||
assert(diff.is_zero_within_error(sigma=1.5))
|
||||
assert(diff.is_zero_within_error(sigma=5))
|
||||
|
||||
|
||||
def test_total_least_squares():
|
||||
|
|
Loading…
Add table
Reference in a new issue