-
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
Skip identities in default.mixed #2365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2365 +/- ##
=======================================
Coverage 99.42% 99.42%
=======================================
Files 243 243
Lines 18322 18324 +2
=======================================
+ Hits 18216 18218 +2
Misses 106 106
Continue to review full report at Codecov.
|
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! 🎉 Thank you for the quick addition here ⚡ Just had one minor suggestion and a question.
initialstate = dev.state.__copy__() | ||
|
||
dev._apply_operation(op) | ||
|
||
assert qml.math.allclose(dev.state, initialstate) |
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.
How come the state is being copied here (as opposed to default.qubit
where we could compare using is
)?
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.
dev._apply_operation
updates dev.state
itself. So So I have to copy the initial state to be able to compare it later. Since it's copied, I can't use is
, as is
checks whether its the exact same thing at the same location.
Co-authored-by: antalszava <antalszava@gmail.com>
Following #2356 , this PR makes
"default.mixed"
skip identities as well.