-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[new opmath] Deprecation warnings and making `LinearCombination.compa…
…re` more user friendly (#5504) Removing `LinearCombination._obs_data`, which requires updating `LinearCombination.compare`. While at it, also updating the doc string to make it clear. **Potential Drawbacks** A comparison with an `Observable` that has no pauli_rep (i.e. involving a `Hadamard`) will not work due to https://github.com/PennyLaneAI/pennylane/blob/master/pennylane/ops/functions/equal.py#L160. I consider this a separate issue for updating qml.equal accordingly. Alternative solution is to give `Hadamard` a `pauli_rep`. ``` op1, op2 = (qml.ops.LinearCombination([1.0], [qml.Hadamard(0)]), qml.Hadamard(0)) op1, op2 = (qml.ops.LinearCombination([1.0], [qml.Hadamard(0) @ qml.Hadamard(1)]), qml.Hadamard(0) @ qml.Hadamard(1)) op1, op2 = (qml.ops.LinearCombination([1.0], [qml.Hadamard(0) @ X(1)]), qml.Hadamard(0) @ X(1)) ``` [sc-59339]
- Loading branch information
Showing
4 changed files
with
50 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters