From 014c0d12ce850f429ca893bb6fbe1b0b17063b39 Mon Sep 17 00:00:00 2001 From: Jan Neuendorf Date: Tue, 5 Oct 2021 12:19:54 +0200 Subject: [PATCH] The GEVP method now has the parameter "state", deciding which eigenvector to return. Correlators get theoptional attribute "range", which is preserved under certain operations. Fits and plateaus will default to this range. --- pyerrors/correlators.py | 92 +++++++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 17 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index dc5f181e..a7f16cb8 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -1,5 +1,6 @@ import numpy as np import autograd.numpy as anp +#from scipy.special.orthogonal import _IntegerType from .pyerrors import * from .fits import standard_fit from .roots import find_root @@ -22,7 +23,7 @@ class Corr: """ - def __init__(self, data_input, padding_front=0, padding_back=0): + def __init__(self, data_input, padding_front=0, padding_back=0,range=None): #All data_input should be a list of things at different timeslices. This needs to be verified if not (isinstance(data_input, list)): @@ -56,6 +57,12 @@ class Corr: self.T = len(self.content) #for convenience: will be used a lot + #The attribute "range" [start,end] marks a range of two timeslices. + #This is useful for keeping track of plateaus and fitranges. + #The range can be inherited from other Corrs, if the operation should not alter a chosen range eg. multiplication with a constant. + if not range is None: + self.range=range + self.gamma_method() @@ -98,6 +105,8 @@ class Corr: newcontent = [None if (item is None) else np.asarray([vector_l.T@item@vector_r]) for item in self.content] return Corr(newcontent) + def sum(self): + return np.sqrt(self.N)*self.projected(np.ones(self.N)) #For purposes of debugging and verification, one might want to see a single smearing level. smearing will return a Corr at the specified i,j. where both are integers 0<=i,j