-
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
Fix issue #1266: 'convert_observable' function raises an error for QubitOperators containing complex coefficients #1277
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #1277 +/- ##
=======================================
Coverage 98.13% 98.13%
=======================================
Files 147 147
Lines 11277 11279 +2
=======================================
+ Hits 11067 11069 +2
Misses 210 210
Continue to review full report at Codecov.
|
qml.Identity(wires=[0]) @ qml.Identity(wires=[1]), | ||
qml.Identity(wires=[0]) @ qml.PauliZ(wires=[1]), | ||
qml.PauliZ(wires=[0]) @ qml.Identity(wires=[1]), | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes from this point on seem to be related to "black"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Suggested a minor change.
Co-authored-by: zeyueN <48225584+zeyueN@users.noreply.github.com>
@agran2018 Thanks so much for fixing this! Would be great if we could merge today! |
Context:
This PR address the issue #1266. Now, an error message is raised if a QubitOperator containing complex coefficients is passed
to the
convert_observable
function. Currently, thevqe.Hamiltonian
class does not support complex coefficients.Description of the Change:
The
convert_observable
checks that all coefficients in the QubitOperator are real.