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

get_sparse_operator fails on non-simplified QubitOperators #880

Open
jagunther opened this issue Apr 30, 2024 · 0 comments
Open

get_sparse_operator fails on non-simplified QubitOperators #880

jagunther opened this issue Apr 30, 2024 · 0 comments

Comments

@jagunther
Copy link

Hi,

I noticed that get_sparse_operator() assumes that Paulistrings in a QubitOperator are simplified, i.e. there should be no Paulis within a Paulistring acting on the same tensor-factor. Normally when initialising a QubitOperator the simplification is done automatically, however, the Symmetry-conserving Bravyi-Kitaev transform does not do this. Below is a small example:

from openfermion import (
    get_sparse_operator,
    FermionOperator,
    symmetry_conserving_bravyi_kitaev,
)

fermion_op = FermionOperator("0^ 1^")
qubit_op = symmetry_conserving_bravyi_kitaev(fermion_op, 4, 2)
print(qubit_op)

# throws error
get_sparse_operator(qubit_op)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants