Commit ca130f98 authored by Dániel Varjas's avatar Dániel Varjas

remove __deepcopy__ from BlochCoeff and add __copy__ to Model

parent f2042723
Pipeline #23559 passed with stage
in 2 minutes and 42 seconds
......@@ -3,7 +3,7 @@ import scipy
import tinyarray as ta
import scipy.linalg as la
from itertools import product
from copy import copy, deepcopy
from copy import copy
from numbers import Number
from warnings import warn
from functools import lru_cache
......@@ -93,11 +93,10 @@ class BlochCoeff(tuple):
else:
raise NotImplementedError
def __deepcopy__(self, memo):
hop, coeff = self
return BlochCoeff(deepcopy(hop), coeff)
def __copy__(self):
return self.copy()
def copy(self):
hop, coeff = self
return BlochCoeff(copy(hop), coeff)
......@@ -459,6 +458,9 @@ class Model(UserDict):
result.append('}')
return "".join(result)
def __copy__(self):
return self.copy()
def zeros_like(self):
"""Return an empty model object that inherits the other properties"""
result = type(self)(shape=self.shape,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment