-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PauliMeasurementGate ignores the sign of the observable given to it #4814
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
Comments
Similar bugs at other places due to constructor accepting
|
) Fixes #4814 Note that this is a breaking change because: - Serialization of the `PauliMeasurementGate` is now different -- the serialized observable is `DensePauliString` instead of a tuple of Pauli's. - A DensePauliString with coefficient != +1/-1 will now raise a `ValueError` whereas earlier the coefficient was simply ignored.
…antumlib#4836) Fixes quantumlib#4814 Note that this is a breaking change because: - Serialization of the `PauliMeasurementGate` is now different -- the serialized observable is `DensePauliString` instead of a tuple of Pauli's. - A DensePauliString with coefficient != +1/-1 will now raise a `ValueError` whereas earlier the coefficient was simply ignored.
…antumlib#4836) Fixes quantumlib#4814 Note that this is a breaking change because: - Serialization of the `PauliMeasurementGate` is now different -- the serialized observable is `DensePauliString` instead of a tuple of Pauli's. - A DensePauliString with coefficient != +1/-1 will now raise a `ValueError` whereas earlier the coefficient was simply ignored.
…antumlib#4836) Fixes quantumlib#4814 Note that this is a breaking change because: - Serialization of the `PauliMeasurementGate` is now different -- the serialized observable is `DensePauliString` instead of a tuple of Pauli's. - A DensePauliString with coefficient != +1/-1 will now raise a `ValueError` whereas earlier the coefficient was simply ignored.
The following code should success but it fails:
The issue is that the line
self._observable = tuple(observable)
in the init method is ignoring the coefficient. The coefficient has to be +1 or -1 to be valid.This is a very bad bug if you are e.g. multiplying overlapping observables together to get composite measurements, as the result of doing so can be negative. For example XX * ZZ = -YY.
The text was updated successfully, but these errors were encountered: