-
Notifications
You must be signed in to change notification settings - Fork 575
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
Wrong simplification of Hamiltonians #1107
Comments
Hi @adamglos92, thanks so much for the report! Yes, this is a known behaviour for the Until then, feel free to open another thread on our discussion forum if further help is needed with bypassing this behaviour for your use case. |
Thank you and sorry for copying question! Would you accept a PR on this? |
Yes! One thing to note is that the situation might be a bit more complex than it seems at first. Allowing
Let us know if having a go at any of these changes would be interesting! 🙂 (As this is more of a new feature, rather than a bug with the current logic, removing the label.) |
Should I move this to a discussion forum? :) |
Hi @adamglos92!
Note that
Out of these two, we prefer to go with 1.
Indeed this will make the required logic more complex. The multiplication of
After a bit of discussion, we'd like to allow this feature to work even for some non-Hermitian operators, see the def. in 2 of the previous comment.
This has more so historic reasons: the
For matrix multiplication that would be somewhat confusing, as originally
That's okay! We can discuss such questions here, and if there are any uncertainties regarding how PennyLane works, a new thread on the forum could be a great place. |
@antalszava perhaps you could be interested in solving this issue through a QIntern 2021 event? https://qworld.net/qintern-2021/. I'm pretty sure there will be people interested in contributing to Pennylane :) |
@adamglos92 that's a nice idea, thank you for the heads-up! We'll consider it :) |
With the completion of the operator arithmetic transition, we can now mark this issue as closed. |
Issue description
Multiplication of Pauli operators gives counter-intuitive reults. While
PauliX(0) @ PauliZ(0)
should produce a bug,PauliZ(0) @ PauliZ(0)
should be simplified to identity.import pennylane as qml; qml.about()
)Additional information
This is particularly important for designing binary models.
The text was updated successfully, but these errors were encountered: