mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
fix: Corr.matrix_symmetric now also works if entries of the correlators
are arrays with at least one None entry.
This commit is contained in:
parent
8a911cac61
commit
78f576a35e
2 changed files with 21 additions and 1 deletions
|
@ -236,7 +236,7 @@ class Corr:
|
|||
def matrix_symmetric(self):
|
||||
"""Symmetrizes the correlator matrices on every timeslice."""
|
||||
if self.N > 1:
|
||||
transposed = [None if (G is None) else G.T for G in self.content]
|
||||
transposed = [None if len(list(filter(None, np.asarray(G).flatten()))) < self.N ** 2 else G.T for G in self.content]
|
||||
return 0.5 * (Corr(transposed) + self)
|
||||
if self.N == 1:
|
||||
raise Exception("Trying to symmetrize a correlator matrix, that already has N=1.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue