Skip to content

embed does not preserve the basis when a CompositeBasis with just a single site is used #27

Description

@noh827

Suppose op is a LazyTensor whose basis is a CompositeBasis with just one site. Then the basis of dense(op) is not the same as the basis of op. Specifically the basis of dense(op) is a single-site non composite basis (e.g., NLevel(N=10) instead of [NLevel(N=10)]). This then causes an "incompatible basis" error in a more complex implementation of dense where it sums over many "densified" operators.

It looks like this is ultimately due to the implementation of the embed method here https://github.com/qojulia/QuantumInterface.jl/blob/main/src/embed_permute.jl#L55 and how the function tensor works for a single-site operator https://github.com/qojulia/QuantumInterface.jl/blob/main/src/tensor.jl#L7C1-L7C7.

Would it be possible to fix these methods so that the basis is preserved under operations like embed and dense?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions