copy(x::LazyTensor) fails
mabuni1998 opened this issue · 2 comments
mabuni1998 commented
When trying to copy a LazyTensor, if the indices are defined as a tuple, it fails. MWE:
ba = FockBasis(2)
a = destroy(ba)
b = destroy(ba)
ab = LazyTensor(ba⊗ba,(1,2),(a,b))
copy(ab)
Returning: ERROR: MethodError: no method matching copy(::Tuple{Int64, Int64})
If, instead, you define the LazyTensor with a vector for the indices, you don't get an error:
ab = LazyTensor(ba⊗ba,[1,2],(a,b))
copy(ab)
mabuni1998 commented
Version:
QuantumOptics v1.0.14
QuantumOpticsBase v0.4.18
Krastanov commented
Tuples do not have a copy
method but they do have a deepcopy
.
deepcopy
should be a fair workaround for the moment, until we fix the copy
method.