mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-11-30 04:56:52 +01:00
Merge branch 'develop' into feat/typehints
This commit is contained in:
commit
54a8e022df
17 changed files with 2880 additions and 69 deletions
|
|
@ -783,3 +783,26 @@ def test_complex_add_and_mul():
|
|||
cc += 2j
|
||||
cc = cc * 4j
|
||||
cc.real + cc.imag
|
||||
|
||||
|
||||
def test_prune_with_Nones():
|
||||
N = 3
|
||||
T = 10
|
||||
|
||||
front_padding = 1
|
||||
back_padding = T // 2
|
||||
|
||||
Ntrunc = N - 1
|
||||
t0proj = 2
|
||||
tproj = 3
|
||||
|
||||
corr_content = np.array([[[pe.pseudo_Obs((i+j+1)**(-t), .01, "None_prune_test") for i in range(N)] for j in range(N)] for t in range(T // 2 - front_padding)])
|
||||
unpadded_corr = pe.Corr(corr_content)
|
||||
padded_corr = pe.Corr(corr_content, padding=[front_padding, back_padding])
|
||||
|
||||
tmp_corr = unpadded_corr.prune(Ntrunc, t0proj=t0proj-front_padding, tproj=tproj-front_padding)
|
||||
pruned_then_padded = pe.Corr(tmp_corr.content, padding=[front_padding, back_padding])
|
||||
padded_then_pruned = padded_corr.prune(Ntrunc, t0proj=t0proj, tproj=tproj)
|
||||
|
||||
for t in range(T):
|
||||
assert np.all(pruned_then_padded.content[t] == padded_then_pruned.content[t])
|
||||
|
|
|
|||
1150
tests/data/sfcf_test/data_apf/data_apf_r0.F_V0
Normal file
1150
tests/data/sfcf_test/data_apf/data_apf_r0.F_V0
Normal file
File diff suppressed because it is too large
Load diff
970
tests/data/sfcf_test/data_apf/data_apf_r0.f_1
Normal file
970
tests/data/sfcf_test/data_apf/data_apf_r0.f_1
Normal file
|
|
@ -0,0 +1,970 @@
|
|||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:03 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n1.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_1
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545021e+02 +6.7620978057264750e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855339e+02 +6.5026340956203663e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177868e+02 +6.5443496235264788e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855515e+02 +6.9706500417651470e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609065e+02 +6.9516150897757419e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046199e+02 +6.9232860455434941e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177447e+02 +1.0849949614595719e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046182e+02 +1.0866063643253473e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098047e+02 +1.0827277318679030e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545038e+02 +3.0143306723935508e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855367e+02 +4.3340379505972648e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177902e+02 +3.9652247575094006e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855526e+02 -8.2540994138261318e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609082e+02 -9.7121215247039609e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046227e+02 -9.0872484903683497e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177453e+02 +5.1331372776616026e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046193e+02 +5.0816653044831932e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098064e+02 +5.1165649253001659e-15
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:05 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n2.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_1
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545021e+02 +6.7620978057264750e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855339e+02 +6.5026340956203663e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177868e+02 +6.5443496235264788e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855515e+02 +6.9706500417651470e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609065e+02 +6.9516150897757419e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046199e+02 +6.9232860455434941e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177447e+02 +1.0849949614595719e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046182e+02 +1.0866063643253473e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098047e+02 +1.0827277318679030e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545038e+02 +3.0143306723935508e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855367e+02 +4.3340379505972648e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177902e+02 +3.9652247575094006e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855526e+02 -8.2540994138261318e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609082e+02 -9.7121215247039609e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046227e+02 -9.0872484903683497e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177453e+02 +5.1331372776616026e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046193e+02 +5.0816653044831932e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098064e+02 +5.1165649253001659e-15
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:07 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n3.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_1
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545021e+02 +6.7620978057264750e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855339e+02 +6.5026340956203663e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177868e+02 +6.5443496235264788e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855515e+02 +6.9706500417651470e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609065e+02 +6.9516150897757419e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046199e+02 +6.9232860455434941e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177447e+02 +1.0849949614595719e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046182e+02 +1.0866063643253473e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098047e+02 +1.0827277318679030e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545038e+02 +3.0143306723935508e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855367e+02 +4.3340379505972648e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177902e+02 +3.9652247575094006e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855526e+02 -8.2540994138261318e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609082e+02 -9.7121215247039609e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046227e+02 -9.0872484903683497e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177453e+02 +5.1331372776616026e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046193e+02 +5.0816653044831932e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098064e+02 +5.1165649253001659e-15
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:09 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n4.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_1
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545021e+02 +6.7620978057264750e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855339e+02 +6.5026340956203663e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177868e+02 +6.5443496235264788e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855515e+02 +6.9706500417651470e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609065e+02 +6.9516150897757419e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046199e+02 +6.9232860455434941e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177447e+02 +1.0849949614595719e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046182e+02 +1.0866063643253473e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098047e+02 +1.0827277318679030e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545038e+02 +3.0143306723935508e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855367e+02 +4.3340379505972648e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177902e+02 +3.9652247575094006e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855526e+02 -8.2540994138261318e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609082e+02 -9.7121215247039609e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046227e+02 -9.0872484903683497e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177453e+02 +5.1331372776616026e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046193e+02 +5.0816653044831932e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098064e+02 +5.1165649253001659e-15
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:11 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n5.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_1
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545021e+02 +6.7620978057264750e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855339e+02 +6.5026340956203663e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177868e+02 +6.5443496235264788e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855515e+02 +6.9706500417651470e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609065e+02 +6.9516150897757419e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046199e+02 +6.9232860455434941e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177447e+02 +1.0849949614595719e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046182e+02 +1.0866063643253473e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098047e+02 +1.0827277318679030e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5119415254545038e+02 +3.0143306723935508e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5120703575855367e+02 +4.3340379505972648e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5120808902177902e+02 +3.9652247575094006e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120703575855526e+02 -8.2540994138261318e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122001235609082e+02 -9.7121215247039609e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122104108046227e+02 -9.0872484903683497e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 0
|
||||
corr
|
||||
+3.5120808902177453e+02 +5.1331372776616026e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 1
|
||||
corr
|
||||
+3.5122104108046193e+02 +5.0816653044831932e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_1
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
wf_2 2
|
||||
corr
|
||||
+3.5122207631098064e+02 +5.1165649253001659e-15
|
||||
|
||||
400
tests/data/sfcf_test/data_apf/data_apf_r0.f_A
Normal file
400
tests/data/sfcf_test/data_apf/data_apf_r0.f_A
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:03 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n1.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_A
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727972304e+01 -6.1214214711790100e-12
|
||||
2 +1.0447210336915187e+00 +8.9219487930753188e-13
|
||||
3 -4.1025094911185178e+01 -4.8315634170546161e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722862705e+01 +2.0963356863957609e-13
|
||||
2 +1.0542820240851569e+00 +2.3989756974599379e-15
|
||||
3 -4.1024441815729936e+01 -5.7107484666182308e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269442847e+01 -6.6512260271334321e-14
|
||||
2 +1.0516822345055969e+00 -2.2935262162529075e-15
|
||||
3 -4.1025142768037746e+01 +3.7566377680004518e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727965909e+01 -1.6112786177915427e-11
|
||||
2 +1.0447210337411881e+00 -7.0387528705692678e-13
|
||||
3 -4.1025094911167137e+01 +4.6509152745618223e-13
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722842213e+01 -8.1976426690345305e-13
|
||||
2 +1.0542820240843382e+00 +2.1626370477046812e-13
|
||||
3 -4.1024441815730086e+01 -2.4147931196409923e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269443117e+01 +7.9192560386479701e-14
|
||||
2 +1.0516822345055870e+00 -1.2443038782429568e-14
|
||||
3 -4.1025142768037739e+01 +5.9315333178954509e-17
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:05 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n2.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_A
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727972304e+01 -6.1214214711790100e-12
|
||||
2 +1.0447210336915187e+00 +8.9219487930753188e-13
|
||||
3 -4.1025094911185178e+01 -4.8315634170546161e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722862705e+01 +2.0963356863957609e-13
|
||||
2 +1.0542820240851569e+00 +2.3989756974599379e-15
|
||||
3 -4.1024441815729936e+01 -5.7107484666182308e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269442847e+01 -6.6512260271334321e-14
|
||||
2 +1.0516822345055969e+00 -2.2935262162529075e-15
|
||||
3 -4.1025142768037746e+01 +3.7566377680004518e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727965909e+01 -1.6112786177915427e-11
|
||||
2 +1.0447210337411881e+00 -7.0387528705692678e-13
|
||||
3 -4.1025094911167137e+01 +4.6509152745618223e-13
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722842213e+01 -8.1976426690345305e-13
|
||||
2 +1.0542820240843382e+00 +2.1626370477046812e-13
|
||||
3 -4.1024441815730086e+01 -2.4147931196409923e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269443117e+01 +7.9192560386479701e-14
|
||||
2 +1.0516822345055870e+00 -1.2443038782429568e-14
|
||||
3 -4.1025142768037739e+01 +5.9315333178954509e-17
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:07 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n3.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_A
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727972304e+01 -6.1214214711790100e-12
|
||||
2 +1.0447210336915187e+00 +8.9219487930753188e-13
|
||||
3 -4.1025094911185178e+01 -4.8315634170546161e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722862705e+01 +2.0963356863957609e-13
|
||||
2 +1.0542820240851569e+00 +2.3989756974599379e-15
|
||||
3 -4.1024441815729936e+01 -5.7107484666182308e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269442847e+01 -6.6512260271334321e-14
|
||||
2 +1.0516822345055969e+00 -2.2935262162529075e-15
|
||||
3 -4.1025142768037746e+01 +3.7566377680004518e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727965909e+01 -1.6112786177915427e-11
|
||||
2 +1.0447210337411881e+00 -7.0387528705692678e-13
|
||||
3 -4.1025094911167137e+01 +4.6509152745618223e-13
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722842213e+01 -8.1976426690345305e-13
|
||||
2 +1.0542820240843382e+00 +2.1626370477046812e-13
|
||||
3 -4.1024441815730086e+01 -2.4147931196409923e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269443117e+01 +7.9192560386479701e-14
|
||||
2 +1.0516822345055870e+00 -1.2443038782429568e-14
|
||||
3 -4.1025142768037739e+01 +5.9315333178954509e-17
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:09 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n4.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_A
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727972304e+01 -6.1214214711790100e-12
|
||||
2 +1.0447210336915187e+00 +8.9219487930753188e-13
|
||||
3 -4.1025094911185178e+01 -4.8315634170546161e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722862705e+01 +2.0963356863957609e-13
|
||||
2 +1.0542820240851569e+00 +2.3989756974599379e-15
|
||||
3 -4.1024441815729936e+01 -5.7107484666182308e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269442847e+01 -6.6512260271334321e-14
|
||||
2 +1.0516822345055969e+00 -2.2935262162529075e-15
|
||||
3 -4.1025142768037746e+01 +3.7566377680004518e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727965909e+01 -1.6112786177915427e-11
|
||||
2 +1.0447210337411881e+00 -7.0387528705692678e-13
|
||||
3 -4.1025094911167137e+01 +4.6509152745618223e-13
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722842213e+01 -8.1976426690345305e-13
|
||||
2 +1.0542820240843382e+00 +2.1626370477046812e-13
|
||||
3 -4.1024441815730086e+01 -2.4147931196409923e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269443117e+01 +7.9192560386479701e-14
|
||||
2 +1.0516822345055870e+00 -1.2443038782429568e-14
|
||||
3 -4.1025142768037739e+01 +5.9315333178954509e-17
|
||||
|
||||
[run]
|
||||
|
||||
version 2.1
|
||||
date 2022-01-19 11:04:11 +0100
|
||||
host r04n07.palma.wwu
|
||||
dir /scratch/tmp/j_kuhl19
|
||||
user j_kuhl19
|
||||
gauge_name /data_a_r0_n5.lex
|
||||
gauge_md5 1ea28326e4090996111a320b8372811d
|
||||
param_name sfcf_unity_test.in
|
||||
param_md5 d881e90d41188a33b8b0f1bd0bc53ea5
|
||||
param_hash 686af5e712ee2902180f5428af94c6e7
|
||||
data_name ./output_10519905/data_af_A
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727972304e+01 -6.1214214711790100e-12
|
||||
2 +1.0447210336915187e+00 +8.9219487930753188e-13
|
||||
3 -4.1025094911185178e+01 -4.8315634170546161e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722862705e+01 +2.0963356863957609e-13
|
||||
2 +1.0542820240851569e+00 +2.3989756974599379e-15
|
||||
3 -4.1024441815729936e+01 -5.7107484666182308e-15
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 0
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269442847e+01 -6.6512260271334321e-14
|
||||
2 +1.0516822345055969e+00 -2.2935262162529075e-15
|
||||
3 -4.1025142768037746e+01 +3.7566377680004518e-16
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 0
|
||||
corr_t
|
||||
1 +6.5471188727965909e+01 -1.6112786177915427e-11
|
||||
2 +1.0447210337411881e+00 -7.0387528705692678e-13
|
||||
3 -4.1025094911167137e+01 +4.6509152745618223e-13
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 1
|
||||
corr_t
|
||||
1 +6.5551520722842213e+01 -8.1976426690345305e-13
|
||||
2 +1.0542820240843382e+00 +2.1626370477046812e-13
|
||||
3 -4.1024441815730086e+01 -2.4147931196409923e-14
|
||||
|
||||
[correlator]
|
||||
|
||||
name f_A
|
||||
quarks lquark lquark
|
||||
offset 1
|
||||
wf 2
|
||||
corr_t
|
||||
1 +6.5529951269443117e+01 +7.9192560386479701e-14
|
||||
2 +1.0516822345055870e+00 -1.2443038782429568e-14
|
||||
3 -4.1025142768037739e+01 +5.9315333178954509e-17
|
||||
|
||||
|
|
@ -1098,6 +1098,7 @@ def test_combined_fit_xerr():
|
|||
}
|
||||
xd = {k: np.transpose([[1 + .01 * np.random.uniform(), 2] for i in range(len(yd[k]))]) for k in fitd}
|
||||
pe.fits.least_squares(xd, yd, fitd)
|
||||
pe.fits.least_squares(xd, yd, fitd, n_parms=4)
|
||||
|
||||
|
||||
def test_x_multidim_fit():
|
||||
|
|
@ -1340,6 +1341,54 @@ def test_combined_fit_constant_shape():
|
|||
funcs = {"a": lambda a, x: a[0] + a[1] * x,
|
||||
"": lambda a, x: a[1] + x * 0}
|
||||
pe.fits.least_squares(x, y, funcs, method='migrad')
|
||||
pe.fits.least_squares(x, y, funcs, method='migrad', n_parms=2)
|
||||
|
||||
def test_fit_n_parms():
|
||||
# Function that fails if the number of parameters is not specified:
|
||||
def fcn(p, x):
|
||||
# Assumes first half of terms are A second half are E
|
||||
NTerms = int(len(p)/2)
|
||||
A = anp.array(p[0:NTerms])[:, np.newaxis] # shape (n, 1)
|
||||
E_P = anp.array(p[NTerms:])[:, np.newaxis] # shape (n, 1)
|
||||
# This if statement handles the case where x is a single value rather than an array
|
||||
if isinstance(x, anp.float64) or isinstance(x, anp.int64) or isinstance(x, float) or isinstance(x, int):
|
||||
x = anp.array([x])[np.newaxis, :] # shape (1, m)
|
||||
else:
|
||||
x = anp.array(x)[np.newaxis, :] # shape (1, m)
|
||||
exp_term = anp.exp(-E_P * x)
|
||||
weighted_sum = A * exp_term # shape (n, m)
|
||||
return anp.mean(weighted_sum, axis=0) # shape(m)
|
||||
|
||||
c = pe.Corr([pe.pseudo_Obs(2. * np.exp(-.2 * t) + .4 * np.exp(+.4 * t) + .4 * np.exp(-.6 * t), .1, 'corr') for t in range(12)])
|
||||
|
||||
c.fit(fcn, n_parms=2)
|
||||
c.fit(fcn, n_parms=4)
|
||||
|
||||
xf = [pe.pseudo_Obs(t, .05, 'corr') for t in range(c.T)]
|
||||
yf = [c[t] for t in range(c.T)]
|
||||
pe.fits.total_least_squares(xf, yf, fcn, n_parms=2)
|
||||
pe.fits.total_least_squares(xf, yf, fcn, n_parms=4)
|
||||
|
||||
# Is expected to fail, this is what is fixed with n_parms
|
||||
with pytest.raises(RuntimeError):
|
||||
c.fit(fcn, )
|
||||
with pytest.raises(RuntimeError):
|
||||
pe.fits.total_least_squares(xf, yf, fcn, )
|
||||
# Test for positivity
|
||||
with pytest.raises(ValueError):
|
||||
c.fit(fcn, n_parms=-2)
|
||||
with pytest.raises(ValueError):
|
||||
pe.fits.total_least_squares(xf, yf, fcn, n_parms=-4)
|
||||
# Have to pass an interger
|
||||
with pytest.raises(TypeError):
|
||||
c.fit(fcn, n_parms=2.)
|
||||
with pytest.raises(TypeError):
|
||||
pe.fits.total_least_squares(xf, yf, fcn, n_parms=1.2343)
|
||||
# Improper number of parameters (function should fail)
|
||||
with pytest.raises(ValueError):
|
||||
c.fit(fcn, n_parms=7)
|
||||
with pytest.raises(ValueError):
|
||||
pe.fits.total_least_squares(xf, yf, fcn, n_parms=5)
|
||||
|
||||
|
||||
def fit_general(x, y, func, silent=False, **kwargs):
|
||||
|
|
@ -1562,3 +1611,81 @@ def old_prior_fit(x, y, func, priors, silent=False, **kwargs):
|
|||
qqplot(x, y, func, result)
|
||||
|
||||
return output
|
||||
|
||||
def test_dof_prior_fit():
|
||||
"""Performs an uncorrelated fit with a prior to uncorrelated data then
|
||||
the expected chisquare and the usual dof need to agree"""
|
||||
N = 5
|
||||
|
||||
def fitf(a, x):
|
||||
return a[0] + 0 * x
|
||||
|
||||
x = [1. for i in range(N)]
|
||||
y = [pe.cov_Obs(i, .1, '%d' % (i)) for i in range(N)]
|
||||
[o.gm() for o in y]
|
||||
res = pe.fits.least_squares(x, y, fitf, expected_chisquare=True, priors=[pe.cov_Obs(3, 1, 'p')])
|
||||
assert res.chisquare_by_expected_chisquare == res.chisquare_by_dof
|
||||
|
||||
num_samples = 400
|
||||
N = 10
|
||||
|
||||
x = norm.rvs(size=(N, num_samples)) # generate random numbers
|
||||
|
||||
r = np.zeros((N, N))
|
||||
for i in range(N):
|
||||
for j in range(N):
|
||||
if(i==j):
|
||||
r[i, j] = 1.0 # element in correlation matrix
|
||||
|
||||
errl = np.sqrt([3.4, 2.5, 3.6, 2.8, 4.2, 4.7, 4.9, 5.1, 3.2, 4.2]) # set y errors
|
||||
for i in range(N):
|
||||
for j in range(N):
|
||||
if(i==j):
|
||||
r[i, j] *= errl[i] * errl[j] # element in covariance matrix
|
||||
|
||||
c = cholesky(r, lower=True)
|
||||
y = np.dot(c, x)
|
||||
x = np.arange(N)
|
||||
x_dict = {}
|
||||
y_dict = {}
|
||||
for i,item in enumerate(x):
|
||||
x_dict[str(item)] = [x[i]]
|
||||
|
||||
for linear in [True, False]:
|
||||
data = []
|
||||
for i in range(N):
|
||||
if linear:
|
||||
data.append(pe.Obs([[i + 1 + o for o in y[i]]], ['ens'+str(i)]))
|
||||
else:
|
||||
data.append(pe.Obs([[np.exp(-(i + 1)) + np.exp(-(i + 1)) * o for o in y[i]]], ['ens'+str(i)]))
|
||||
|
||||
[o.gamma_method() for o in data]
|
||||
|
||||
data_dict = {}
|
||||
for i,item in enumerate(x):
|
||||
data_dict[str(item)] = [data[i]]
|
||||
|
||||
corr = pe.covariance(data, correlation=True)
|
||||
chol = np.linalg.cholesky(corr)
|
||||
covdiag = np.diag(1 / np.asarray([o.dvalue for o in data]))
|
||||
chol_inv = scipy.linalg.solve_triangular(chol, covdiag, lower=True)
|
||||
chol_inv_keys = [""]
|
||||
chol_inv_keys_combined_fit = [str(item) for i,item in enumerate(x)]
|
||||
|
||||
if linear:
|
||||
def fitf(p, x):
|
||||
return p[1] + p[0] * x
|
||||
fitf_dict = {}
|
||||
for i,item in enumerate(x):
|
||||
fitf_dict[str(item)] = fitf
|
||||
else:
|
||||
def fitf(p, x):
|
||||
return p[1] * anp.exp(-p[0] * x)
|
||||
fitf_dict = {}
|
||||
for i,item in enumerate(x):
|
||||
fitf_dict[str(item)] = fitf
|
||||
|
||||
fit_exp = pe.least_squares(x, data, fitf, expected_chisquare=True, priors = {0:pe.cov_Obs(1.0, 1, 'p')})
|
||||
fit_cov = pe.least_squares(x, data, fitf, correlated_fit = True, inv_chol_cov_matrix = [chol_inv,chol_inv_keys], priors = {0:pe.cov_Obs(1.0, 1, 'p')})
|
||||
assert np.isclose(fit_exp.chisquare_by_expected_chisquare,fit_exp.chisquare_by_dof,atol=1e-8)
|
||||
assert np.isclose(fit_exp.chisquare_by_expected_chisquare,fit_cov.chisquare_by_dof,atol=1e-8)
|
||||
|
|
@ -152,7 +152,7 @@ def test_function_overloading():
|
|||
np.arccos(1 / b)
|
||||
np.arctan(1 / b)
|
||||
np.arctanh(1 / b)
|
||||
np.sinc(1 / b)
|
||||
#np.sinc(1 / b) # Commented out for now
|
||||
|
||||
b ** b
|
||||
0.5 ** b
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ def build_test_environment(path, env_type, cfgs, reps):
|
|||
os.mkdir(path + "/data_c/data_c_r"+str(i))
|
||||
for j in range(1, cfgs+1):
|
||||
shutil.copy(path + "/data_c/data_c_r0/data_c_r0_n1", path + "/data_c/data_c_r"+str(i)+"/data_c_r"+str(i)+"_n"+str(j))
|
||||
elif env_type == "a":
|
||||
elif env_type in ["a", "apf"]:
|
||||
for i in range(1, reps):
|
||||
for corr in ["f_1", "f_A", "F_V0"]:
|
||||
shutil.copy(path + "/data_a/data_a_r0." + corr, path + "/data_a/data_a_r" + str(i) + "." + corr)
|
||||
shutil.copy(path + "/data_" + env_type + "/data_" + env_type + "_r0." + corr, path + "/data_" + env_type + "/data_" + env_type + "_r" + str(i) + "." + corr)
|
||||
|
||||
|
||||
def test_o_bb(tmp_path):
|
||||
|
|
@ -276,6 +276,28 @@ def test_a_bb(tmp_path):
|
|||
assert f_1[0].value == 351.1941525454502
|
||||
|
||||
|
||||
def test_a_bb_external_idl_func(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1])
|
||||
f_1 = sfin.read_sfcf(str(tmp_path) + "/data_a", "data_a", "f_1", quarks="lquark lquark", wf=0, wf2=0, version="2.0a", corr_type="bb", cfg_func=extract_idl)
|
||||
print(f_1)
|
||||
assert len(f_1) == 1
|
||||
assert list(f_1[0].shape.keys()) == ["data_a_|r0", "data_a_|r1", "data_a_|r2"]
|
||||
assert f_1[0].value == 351.1941525454502
|
||||
|
||||
|
||||
def test_a_bb_external_idl_func_postfix(tmp_path):
|
||||
build_test_environment(str(tmp_path), "apf", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1][:-5])
|
||||
f_1 = sfin.read_sfcf(str(tmp_path) + "/data_apf", "data_apf", "f_1", quarks="lquark lquark", wf=0, wf2=0, version="2.0a", corr_type="bb", cfg_func=extract_idl)
|
||||
print(f_1)
|
||||
assert len(f_1) == 1
|
||||
assert list(f_1[0].shape.keys()) == ["data_apf_|r0", "data_apf_|r1", "data_apf_|r2"]
|
||||
assert f_1[0].value == 351.1941525454502
|
||||
|
||||
|
||||
def test_a_bi(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
f_A = sfin.read_sfcf(str(tmp_path) + "/data_a", "data_a", "f_A", quarks="lquark lquark", wf=0, version="2.0a")
|
||||
|
|
@ -287,6 +309,32 @@ def test_a_bi(tmp_path):
|
|||
assert f_A[2].value == -41.025094911185185
|
||||
|
||||
|
||||
def test_a_bi_external_idl_func(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1])
|
||||
f_A = sfin.read_sfcf(str(tmp_path) + "/data_a", "data_a", "f_A", quarks="lquark lquark", wf=0, version="2.0a", cfg_func=extract_idl)
|
||||
print(f_A)
|
||||
assert len(f_A) == 3
|
||||
assert list(f_A[0].shape.keys()) == ["data_a_|r0", "data_a_|r1", "data_a_|r2"]
|
||||
assert f_A[0].value == 65.4711887279723
|
||||
assert f_A[1].value == 1.0447210336915187
|
||||
assert f_A[2].value == -41.025094911185185
|
||||
|
||||
|
||||
def test_a_bi_external_idl_func_postfix(tmp_path):
|
||||
build_test_environment(str(tmp_path), "apf", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1][:-5])
|
||||
f_A = sfin.read_sfcf(str(tmp_path) + "/data_apf", "data_apf", "f_A", quarks="lquark lquark", wf=0, version="2.0a", cfg_func=extract_idl)
|
||||
print(f_A)
|
||||
assert len(f_A) == 3
|
||||
assert list(f_A[0].shape.keys()) == ["data_apf_|r0", "data_apf_|r1", "data_apf_|r2"]
|
||||
assert f_A[0].value == 65.4711887279723
|
||||
assert f_A[1].value == 1.0447210336915187
|
||||
assert f_A[2].value == -41.025094911185185
|
||||
|
||||
|
||||
def test_a_bi_files(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
f_A = sfin.read_sfcf(str(tmp_path) + "/data_a", "data_a", "f_A", quarks="lquark lquark", wf=0, version="2.0a", files=["data_a_r0.f_A", "data_a_r1.f_A", "data_a_r2.f_A"])
|
||||
|
|
@ -316,6 +364,31 @@ def test_a_bib(tmp_path):
|
|||
assert f_V0[2] == 683.6776090081005
|
||||
|
||||
|
||||
def test_a_bib_external_idl_func(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1])
|
||||
f_V0 = sfin.read_sfcf(str(tmp_path) + "/data_a", "data_a", "F_V0", quarks="lquark lquark", wf=0, wf2=0, version="2.0a", corr_type="bib", cfg_func=extract_idl)
|
||||
print(f_V0)
|
||||
assert len(f_V0) == 3
|
||||
assert list(f_V0[0].shape.keys()) == ["data_a_|r0", "data_a_|r1", "data_a_|r2"]
|
||||
assert f_V0[0] == 683.6776090085115
|
||||
assert f_V0[1] == 661.3188585582334
|
||||
assert f_V0[2] == 683.6776090081005
|
||||
|
||||
def test_a_bib_external_idl_func_postfix(tmp_path):
|
||||
build_test_environment(str(tmp_path), "apf", 5, 3)
|
||||
def extract_idl(s: str) -> int:
|
||||
return int(s.split("n")[-1][:-5])
|
||||
f_V0 = sfin.read_sfcf(str(tmp_path) + "/data_apf", "data_apf", "F_V0", quarks="lquark lquark", wf=0, wf2=0, version="2.0a", corr_type="bib", cfg_func=extract_idl)
|
||||
print(f_V0)
|
||||
assert len(f_V0) == 3
|
||||
assert list(f_V0[0].shape.keys()) == ["data_apf_|r0", "data_apf_|r1", "data_apf_|r2"]
|
||||
assert f_V0[0] == 683.6776090085115
|
||||
assert f_V0[1] == 661.3188585582334
|
||||
assert f_V0[2] == 683.6776090081005
|
||||
|
||||
|
||||
def test_simple_multi_a(tmp_path):
|
||||
build_test_environment(str(tmp_path), "a", 5, 3)
|
||||
corrs = sfin.read_sfcf_multi(str(tmp_path) + "/data_a", "data_a", ["F_V0"], quarks_list=["lquark lquark"], wf1_list=[0], wf2_list=[0], version="2.0a", corr_type_list=["bib"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue