-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add wire disjoint check for n-ctrl gate support in LQ #949
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #949 +/- ##
==========================================
- Coverage 96.57% 93.82% -2.75%
==========================================
Files 215 169 -46
Lines 30452 22290 -8162
==========================================
- Hits 29408 20914 -8494
- Misses 1044 1376 +332 ☔ View full report in Codecov by Sentry. |
pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp
Outdated
Show resolved
Hide resolved
Thanks @multiphaseCFD! This looks good to me, just commented on the added comments |
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.
LGTM, this is a good check, thanks @multiphaseCFD!
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.
Thank you @multiphaseCFD
A few comments
Could you explain a bit why this change, please?
pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp
Show resolved
Hide resolved
Good question @LuisAlfredoNu . Current LQ implement has no safety check for the controlled gates, which allows users to pass wrong wire info without any warning. For example, the control_wires and target wires are the same, which is not physically correct, in a few tests in the unit tested I revised. This PR will fix it |
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.
Thank you @multiphaseCFD
Nice work and good catch on solving this potential bug
🚀 🐛
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
tests
directory!All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
.github/CHANGELOG.md
file, summarizing thechange, and including a link back to the PR.
Ensure that code is properly formatted by running
make format
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
[SC-76347]
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: