-
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 tag dispatch for memory location with LQ classes #492
Conversation
Hello. You may have forgotten to update the changelog!
|
…htning into add_memory_tag
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #492 +/- ##
==========================================
- Coverage 96.84% 96.37% -0.47%
==========================================
Files 142 23 -119
Lines 16278 1186 -15092
==========================================
- Hits 15764 1143 -14621
+ Misses 514 43 -471
☔ View full report in Codecov by Sentry. |
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.
Nice implementation.
This will, for sure, address my comment on PR 482.
Happy to approve when we move the MemoryStorageLocation
namespace to a more suitable header.
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.
Thanks @mlxd! It solves the issue with registering StateVectorLQubitDynamic
in our end too.
pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/AdjointJacobianLQubit.hpp
Outdated
Show resolved
Hide resolved
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 for that!
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: To allow selection of supports for both internally and externally managed memory, enabling a class attribute to be accessed indicating where memory lives is necessary. To better support lightning's classes, and their extensions, this PR adds struct tags to each statevector class in the
lightning.qubit
tree. Struct tags are prefered here over enums as they can be used for compile-time selections, and such we make use of this now in a safer way under the adjoint gradient pipeline.Description of the Change: As above.
Benefits: Allows compile-time decisions and support checking of memory ownership in
lightning.qubit
associated statevector classes.Possible Drawbacks:
Related GitHub Issues: