Transpilation (Opt. Level 2) fails with registers larger than 10 bits ValueError: too many subscripts in einsum
#7700
Labels
bug
Something isn't working
Environment
What is happening?
When I transpile this circuit with optimization level 2, it strangely fails if the register is larger than 10 bits, but with 10 or less bits it works as expected.
How can we reproduce the issue?
Run this script:
Output:
Then transpile it (with OPTIMIZATION LEVEL 2):
Output
To rule out possible problems with the configuration of Numpy, I tried to run the same script in a brand new Colab environment with the same Qiskit version and it still fails with the same error.
What should happen?
The transpilation should terminate without errors, similarly to what happens when using 10 or less bits.
Any suggestions?
Thanks to the stacktrace and the interactive debugger, the bug happens in the
CommutationAnalysis(AnalysisPass)
.In particular you should step in the
_commute
function below, when the two arguments are:In particular, to reach the problematic point in code, you should step in the
_commute
function below, when the two arguments are:Then the problem should be in
quantum_info/operators/operator.py in _einsum_matmul
as suggested by the last part of the stack trace.It seems very strange, I would be very interested in getting others' opinions about this...
The text was updated successfully, but these errors were encountered: