fix: Corr.m_eff can now returns None entries if the correlator has a

sign flip. Before that the logarithm of a negative number was computed
and a warning was thrown.
This commit is contained in:
Fabian Joswig 2022-06-28 14:40:49 +01:00
parent 92562d50e7
commit 763c759ae0
2 changed files with 13 additions and 0 deletions

View file

@ -604,6 +604,8 @@ class Corr:
for t in range(self.T - 1):
if ((self.content[t] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0):
newcontent.append(None)
elif self.content[t][0].value / self.content[t + 1][0].value < 0:
newcontent.append(None)
else:
newcontent.append(self.content[t] / self.content[t + 1])
if(all([x is None for x in newcontent])):
@ -627,6 +629,8 @@ class Corr:
# Fill the two timeslices in the middle of the lattice with their predecessors
elif variant == 'sinh' and t in [self.T / 2, self.T / 2 - 1]:
newcontent.append(newcontent[-1])
elif self.content[t][0].value / self.content[t + 1][0].value < 0:
newcontent.append(None)
else:
newcontent.append(np.abs(find_root(self.content[t][0] / self.content[t + 1][0], root_function, guess=guess)))
if(all([x is None for x in newcontent])):