Implemented the pruning of large correlation matrices by the solution of a GEVP at early times

This commit is contained in:
Simon Kuberski 2022-04-28 17:33:38 +02:00
parent d96c5cab75
commit b8e5f9dfd4
2 changed files with 79 additions and 0 deletions

View file

@ -342,3 +342,21 @@ def _gen_corr(val, samples=2000):
return pe.correlators.Corr(corr_content)
def test_prune():
corr_aa = _gen_corr(1)
corr_ab = 0.5 * corr_aa
corr_ac = 0.25 * corr_aa
corr_mat = pe.Corr(np.array([[corr_aa, corr_ab, corr_ac], [corr_ab, corr_aa, corr_ab], [corr_ac, corr_ab, corr_aa]]))
p = corr_mat.prune(2)
assert(all([o.is_zero() for o in p.item(0, 1)]))
a = [(o - 1) for o in p.item(1, 1)]
[o.gamma_method() for o in a]
assert(all([o.is_zero_within_error() for o in a]))
with pytest.raises(Exception):
corr_mat.prune(3)
corr_mat.prune(4)