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 qml.GellMann
observable data
#4366
Conversation
[sc-41597] |
Codecov Report
@@ Coverage Diff @@
## master #4366 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 351 351
Lines 32407 32411 +4
=======================================
+ Hits 32334 32338 +4
Misses 73 73
|
being honest, I don't love seeing |
I agree, and I wasn't particularly happy with the change. I tried just overloading If we want to correctly support it in |
do we need to plan anything to have this removed in the future? I suspect it will happen naturally once we switch to arithmetic ops everywhere since that seems to be the only place this is used (Sum/Prod aren't even Observable objects!) |
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.
given the circumstances, adding 2 lines in each file ain't too bad. thanks for this!
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.
Simple enough fix.
Would this actually work in a measurement?
It should. The issue was that calling |
Context:
Fixes #4341 .
Description of the Change:
Observable._obs_data()
to include the index ofqml.GellMann
in the parameter list.Hamiltonian._obs_data()
to include the index ofqml.GellMann
in the parameter list.Note:
I would still recommend using the new operator arithmetic with qutrits. The generators of parametric qutrit gates are instances of
Prod
andSum
, notqml.Hamiltonian
. So, try usingqml.dot
instead ofqml.Hamiltonian
with qutrit observables.Benefits:
Comparison of instances of
qml.GellMann
,Hamiltonian
s andTensor
s containingqml.GellMann
is correct.Possible Drawbacks:
Related GitHub Issues:
#4341