Added tag attribute to CObs, added __slots__ to CObs, decreasing memory

footprint
This commit is contained in:
Fabian Joswig 2021-10-18 13:31:57 +01:00
parent f3b1a2bf34
commit 040f6dbd51

View file

@ -641,9 +641,11 @@ class Obs:
class CObs: class CObs:
__slots__ = ['real', 'imag', 'tag']
def __init__(self, real, imag=0.0): def __init__(self, real, imag=0.0):
self.real = real self.real = real
self.imag = imag self.imag = imag
self.tag = None
def gamma_method(self, **kwargs): def gamma_method(self, **kwargs):
if isinstance(self.real, Obs): if isinstance(self.real, Obs):