mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
The changes i tried to push before
This commit is contained in:
parent
39f176585e
commit
2f11d0d30b
1 changed files with 41 additions and 58 deletions
|
@ -109,7 +109,6 @@ class Corr:
|
|||
vector_l, vector_r = np.asarray([1.] + (self.N - 1) * [0.]), np.asarray([1.] + (self.N - 1) * [0.])
|
||||
elif(vector_r is None):
|
||||
vector_r = vector_l
|
||||
|
||||
if isinstance(vector_l, list) and not isinstance(vector_r, list):
|
||||
if len(vector_l) != self.T:
|
||||
raise Exception("Length of vector list must be equal to T")
|
||||
|
@ -119,7 +118,6 @@ class Corr:
|
|||
raise Exception("Length of vector list must be equal to T")
|
||||
vector_l = [vector_l] * self.T
|
||||
|
||||
|
||||
if not isinstance(vector_l, list):
|
||||
if not vector_l.shape == vector_r.shape == (self.N,):
|
||||
raise Exception("Vectors are of wrong shape!")
|
||||
|
@ -215,8 +213,6 @@ class Corr:
|
|||
# There are two ways, the GEVP metod can be called.
|
||||
# 1. return_list=False will return a single eigenvector, normalized according to V*C(t_0)*V=1
|
||||
# 2. return_list=True will return a new eigenvector for every timeslice. The time t_s is used to order the vectors according to. arXiv:2004.10472 [hep-lat]
|
||||
|
||||
|
||||
def GEVP(self, t0, ts, state=0, sorting="Eigenvalue", return_list=False):
|
||||
if not return_list:
|
||||
if (self.content[t0] is None) or (self.content[ts] is None):
|
||||
|
@ -246,10 +242,7 @@ class Corr:
|
|||
all_vecs.append(sp_vec)
|
||||
else:
|
||||
all_vecs.append(sp_vecs)
|
||||
|
||||
|
||||
|
||||
except: #This could contain a check for real eigenvectors
|
||||
except "Failure to solve for one timeslice": # This could contain a check for real eigenvectors
|
||||
all_vecs.append(None)
|
||||
if sorting == "Eigenvector":
|
||||
all_vecs = sort_vectors(all_vecs, ts)
|
||||
|
@ -257,8 +250,6 @@ class Corr:
|
|||
|
||||
return all_vecs
|
||||
|
||||
|
||||
|
||||
def Eigenvalue(self, t0, state=1):
|
||||
G = self.smearing_symmetric()
|
||||
G0 = G.content[t0]
|
||||
|
@ -278,8 +269,6 @@ class Corr:
|
|||
newcontent.append(eigenvalue)
|
||||
return Corr(newcontent)
|
||||
|
||||
|
||||
|
||||
def Hankel(self, N, periodic=False):
|
||||
# Constructs an NxN Hankel matrix
|
||||
# C(t) c(t+1) ... c(t+n-1)
|
||||
|
@ -290,13 +279,11 @@ class Corr:
|
|||
if self.N != 1:
|
||||
raise Exception("Multi-operator Prony not implemented!")
|
||||
|
||||
|
||||
array = np.empty([N, N], dtype="object")
|
||||
new_content = []
|
||||
for t in range(self.T):
|
||||
new_content.append(array.copy())
|
||||
|
||||
|
||||
def wrap(i):
|
||||
if i >= self.T:
|
||||
return i-self.T
|
||||
|
@ -312,12 +299,8 @@ class Corr:
|
|||
else:
|
||||
new_content[t][i, j] = self.content[t+i+j][0]
|
||||
|
||||
|
||||
|
||||
return Corr(new_content)
|
||||
|
||||
|
||||
|
||||
def roll(self, dt):
|
||||
"""Periodically shift the correlator by dt timeslices
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue