Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy(x::LazyTensor) fails #149

Open
mabuni1998 opened this issue Oct 13, 2023 · 2 comments
Open

copy(x::LazyTensor) fails #149

mabuni1998 opened this issue Oct 13, 2023 · 2 comments

Comments

@mabuni1998
Copy link
Contributor

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
Copy link
Contributor Author

Version:
QuantumOptics v1.0.14
QuantumOpticsBase v0.4.18

@Krastanov
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants