You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The commutation checker always fails to commute a PauliGate with any other gate. I get this error message.
returnself.cc.commute(op1, qargs1, cargs1, op2, qargs2, cargs2, max_num_qubits)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^qiskit.exceptions.QiskitError: 'Unable to hash a non-float instruction parameter.'
I think it is because the parameter in a PauliGate is the Pauli operator that it implements rather than a Parameter or a float. I realized that CommutatorChecker did not have a unittest for this particular case, and also I have tried it for different python versions 1.0, 1.2 and 1.3. 1.0 and 1.2 work fine but 1.3 does not.
2 things have changed.
The way that parameters are hashed has been ported to rust (the parameter in PauliGate is a string so I don't see why we can't hash it).
Before if one of the gates was parameterized commute would return False. Now it does some more invoved logic.
For versions up to 1.2 we get False (which is not the correct answer). And for version 1.3 we get the error message.
Any suggestions?
I think the best option would be to fix the hashing. If there is a deeper reason why that is not possible then we need to change the logic of the function.
The text was updated successfully, but these errors were encountered:
Environment
What is happening?
The commutation checker always fails to commute a PauliGate with any other gate. I get this error message.
I think it is because the parameter in a
PauliGate
is thePauli
operator that it implements rather than aParameter
or afloat
. I realized thatCommutatorChecker
did not have a unittest for this particular case, and also I have tried it for different python versions 1.0, 1.2 and 1.3. 1.0 and 1.2 work fine but 1.3 does not.2 things have changed.
PauliGate
is a string so I don't see why we can't hash it).commute
would returnFalse
. Now it does some more invoved logic.How can we reproduce the issue?
What should happen?
For versions up to 1.2 we get
False
(which is not the correct answer). And for version 1.3 we get the error message.Any suggestions?
I think the best option would be to fix the hashing. If there is a deeper reason why that is not possible then we need to change the logic of the function.
The text was updated successfully, but these errors were encountered: