-
Notifications
You must be signed in to change notification settings - Fork 625
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
Fixing dismatch between dense matrix()
and sparse repr sparse_matrix()
of GlobalPhase
#6940
base: master
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
matrix()
and sparse repr sparse_matrix()
of GlobalPhase
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6940 +/- ##
==========================================
- Coverage 99.59% 99.59% -0.01%
==========================================
Files 480 480
Lines 45510 45516 +6
==========================================
+ Hits 45325 45330 +5
- Misses 185 186 +1 ☔ View full report in Codecov by Sentry. |
…erparams' into fix-GlobalPhase-hyperparams
# global phase | ||
wires = wire_order[0:1] | ||
if qml.math.shape(mat) == (qudit_dim, qudit_dim): | ||
wires = wire_order[0: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.
It seems that the line119 has never been visited by the whole codebase. This means it actually only serves for the previous wrong impelmentation of GlobalPhase(.., wires=None)
. So we will just delete this
Context:
qml.GlobalPhase
does not set itshyperparameters
during initialization. This caused certain bugs, e.g.where
GlobalPhase.sparse_matrix()
did the calculation wrongly because it never received correctn_wires
fromhyperparameters
, which is required by the base classOperator
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: