mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-11-29 20:46:54 +01:00
pyerrors/correlators.py: Allowing for None values in pe.Corr.prune
Closes: fjosw#271
This commit is contained in:
parent
3e955d4976
commit
3c3fd70ce5
1 changed files with 8 additions and 6 deletions
|
|
@ -1405,13 +1405,15 @@ class Corr:
|
||||||
tmpmat = np.empty((Ntrunc, Ntrunc), dtype=object)
|
tmpmat = np.empty((Ntrunc, Ntrunc), dtype=object)
|
||||||
rmat = []
|
rmat = []
|
||||||
for t in range(basematrix.T):
|
for t in range(basematrix.T):
|
||||||
for i in range(Ntrunc):
|
if self.content[t] is None:
|
||||||
for j in range(Ntrunc):
|
rmat.append(None)
|
||||||
tmpmat[i][j] = evecs[i].T @ self[t] @ evecs[j]
|
else:
|
||||||
rmat.append(np.copy(tmpmat))
|
for i in range(Ntrunc):
|
||||||
|
for j in range(Ntrunc):
|
||||||
|
tmpmat[i][j] = evecs[i].T @ self[t] @ evecs[j]
|
||||||
|
rmat.append(np.copy(tmpmat))
|
||||||
|
|
||||||
newcontent = [None if (self.content[t] is None) else rmat[t] for t in range(self.T)]
|
return Corr(rmat)
|
||||||
return Corr(newcontent)
|
|
||||||
|
|
||||||
|
|
||||||
def _sort_vectors(vec_set_in, ts):
|
def _sort_vectors(vec_set_in, ts):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue