fix for_bath

This commit is contained in:
Valentin Boettcher 2022-08-14 15:53:37 +02:00
parent 0c6ccdf154
commit eebfafa58a
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -127,7 +127,7 @@ class EnsembleValue:
return len(self._value)
def for_bath(self, bath: int):
if self.num_baths == 1 and len(self.value.shape) == 1:
if self.num_baths == 1 and len(self.value.shape) in [0, 1]:
return self
return EnsembleValue([(N, val[bath], σ[bath]) for N, val, σ in self._value])