Closed willjmax closed 1 month ago
Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md
with:
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.70%. Comparing base (
d892b10
) to head (b16b9ff
). Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Context: For the input of
PauliRot
the number of wires given must equal the length of the given Pauli word. Otherwise aValueError
is raised. For example,op = qml.PauliRot(0.5, "XY", wires=[0,1,2])
results inValueError: The given Pauli word has length 2, length 3 was expected for wires [0,1,2]
.However, this message can be ambiguous.
op = qml.PauliRot(0.5, "XYZZXYI", wires=[0])
raises the exceptionValueError: The given Pauli word has length 7, length 1 was expected for wires [0]
. It's unclear if "length 1" refers to the length of the Pauli word or the length of the wires.Description of the Change: This PR changes the error message to remove the ambiguity. Now it will say
ValueError: The number of wires must be equal to the length of the Pauli Word. The Pauli word XY has length 2, and 3 wires were given [0, 1, 2].