mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 23:00:25 +01:00
fix: GEVP sorted vectors fixed and simplified.
This commit is contained in:
parent
410d7618a0
commit
4c06f9886d
1 changed files with 4 additions and 10 deletions
|
@ -276,8 +276,8 @@ class Corr:
|
||||||
Gt[i, j] = symmetric_corr[ts][i, j].value
|
Gt[i, j] = symmetric_corr[ts][i, j].value
|
||||||
|
|
||||||
sp_vecs = _GEVP_solver(Gt, G0)
|
sp_vecs = _GEVP_solver(Gt, G0)
|
||||||
sp_vec = [sp_vecs[s] for s in range(self.N)]
|
return sp_vecs
|
||||||
return sp_vec
|
|
||||||
elif sort in ["Eigenvalue", "Eigenvector"]:
|
elif sort in ["Eigenvalue", "Eigenvector"]:
|
||||||
if sort == "Eigenvalue" and ts is not None:
|
if sort == "Eigenvalue" and ts is not None:
|
||||||
warnings.warn("ts has no effect when sorting by eigenvalue is chosen.", RuntimeWarning)
|
warnings.warn("ts has no effect when sorting by eigenvalue is chosen.", RuntimeWarning)
|
||||||
|
@ -290,23 +290,17 @@ class Corr:
|
||||||
G0[i, j] = symmetric_corr[t0][i, j].value
|
G0[i, j] = symmetric_corr[t0][i, j].value
|
||||||
Gt[i, j] = symmetric_corr[t][i, j].value
|
Gt[i, j] = symmetric_corr[t][i, j].value
|
||||||
|
|
||||||
sp_vecs = _GEVP_solver(Gt, G0)
|
all_vecs.append(_GEVP_solver(Gt, G0))
|
||||||
if sort == "Eigenvalue":
|
|
||||||
sp_vec = [sp_vecs[s] for s in range(self.N)]
|
|
||||||
all_vecs.append(sp_vec)
|
|
||||||
else:
|
|
||||||
all_vecs.append(sp_vecs)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
all_vecs.append(None)
|
all_vecs.append(None)
|
||||||
if sort == "Eigenvector":
|
if sort == "Eigenvector":
|
||||||
if (ts is None):
|
if (ts is None):
|
||||||
raise Exception("ts is required for the Eigenvector sorting method.")
|
raise Exception("ts is required for the Eigenvector sorting method.")
|
||||||
all_vecs = _sort_vectors(all_vecs, ts)
|
all_vecs = _sort_vectors(all_vecs, ts)
|
||||||
all_vecs = [[a[s] if a is not None else None for a in all_vecs] for s in range(self.N)]
|
|
||||||
else:
|
else:
|
||||||
raise Exception("Unkown value for 'sort'.")
|
raise Exception("Unkown value for 'sort'.")
|
||||||
|
|
||||||
return all_vecs
|
return [[v[s] if v is not None else None for v in all_vecs] for s in range(self.N)]
|
||||||
|
|
||||||
def Eigenvalue(self, t0, ts=None, state=0, sort=None):
|
def Eigenvalue(self, t0, ts=None, state=0, sort=None):
|
||||||
"""Determines the eigenvalue of the GEVP by solving and projecting the correlator
|
"""Determines the eigenvalue of the GEVP by solving and projecting the correlator
|
||||||
|
|
Loading…
Add table
Reference in a new issue