-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
CommutationChecker fails with large gates. #13828
Comments
Maybe @sbrandhsn has an idea for what's going on in the einsum matrix multiplication 🙂 Using Pauli-based checks instead is a bit out of scope for this fix though 😉 |
The library |
Shouldn't the considered commutation only use 9 indices though, since it checks |
Julien: you have indices for both the input and output spaces, and you have two operators, so if there's not much overlap of the spaces, you'll get towards having 4x the number of qubits in indices. |
* First commit with body of the class * Optimized some features, added warnings and unittests * commchecker fixed * Fixed Pauli Indexing (proper unittests are still missing) * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * d * added get_final_ops * Modified LightCone inputs and added tests * Added tests for errors, modified to * merging * fixed commutation_checker version * Sparse Observable tests for LightCone pass * Fixed typehints * Added release notes and max_num qubits for LightCone Pass * Commented test issue #13828 * Commented decorator * Fixed linting * bug in reno * Fixed non-existing cnot gate in releasenotes * Apply suggestions from code review Applied suggestions Co-authored-by: Julien Gacon <gaconju@gmail.com> * Changed registers and __init__ in unittest * Changed warning and simplified if logic * Fixed linting * Use SessionCommutatorChecker + typos --------- Co-authored-by: Samuele Piccinelli <Samuele.Piccinelli@ibm.com> Co-authored-by: Julien Gacon <gaconju@gmail.com>
Environment
What is happening?
Commutation Checker fails when checking the commutativity of a large PauliGate. It has to do with the fact that it tries to construct its tensor representation and for some reason runs out of indices to iterate over (I am not really sure what is causing that). This is specially sad because in most cases checking the commutativity of a Pauli String should be trivial regardless of its size.
How can we reproduce the issue?
What should happen?
And I get the following error:
Any suggestions?
I suggest that the commutativity checker becomes Pauli based. By that I mean that most gates diagonalize in the same basis as a Pauli, so we should check the commutativity of the associated Pauli which is a very cheap operation when done efficiently (bitwise). For instance, one can associate a
CNOT
gate with aZX
Pauli or aS
gate with aZ
Pauli. Some other cases are less trivial, like for theH
gate, where we need to decompose it intoX+Z
and checking the commutativity is slightly more involved. However, it should still be a much faster operation than instantiating the matrix of the operation, and if we speed up the Pauli commutativity would probably be as fast as a lookup table.The text was updated successfully, but these errors were encountered: