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

embed may not embed for a CompositeBasis of one element #50

Open
amilsted opened this issue Jul 29, 2022 · 2 comments
Open

embed may not embed for a CompositeBasis of one element #50

amilsted opened this issue Jul 29, 2022 · 2 comments

Comments

@amilsted
Copy link
Collaborator

When embed builds the result by performing tensor products, it will not produce an operator on a CompositeBasis if there is only one element in the input composite basis. This is unexpected.

@amilsted
Copy link
Collaborator Author

amilsted commented Jul 29, 2022

Relatedly, should the following even be allowed to exist?

  • CompositeBasis with a single element
  • Nested CompositeBasis

Currently, both can be generated.

@AmitRotem
Copy link
Contributor

Just stumbled upon this issue while sparsing a LazyTensor of a single element CompositeBasis.
So I find it useful and think they should exist.

b=NLevelBasis(2)
cb=CompositeBasis(b)
op=randoperator(b)
lop = LazyTensor(cb, 1, op)
basis(op) == basis(sparse(lop)) # false
basis(op) == basis(dense( lop)) # false

Also, currently embed has inconsistent behavior with this basis

basis(embed(cb,      1 , op )) == cb # true
basis(embed(cb,     [1],[op])) == cb # false
basis(embed(cb,Dict([1]=>op))) == cb # false

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