Skip to content
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 test_templates module + Fix LQ decomposition of StatePrep Ops + Fix LQ decomposition strategy of QFT and GroverOperator #684

Merged
merged 25 commits into from
Apr 18, 2024

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Apr 16, 2024

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 the
    change, 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:
In this PR,

  • Add test_templates.py module where Grover and QSVT are tested. Resolving [sc-41770] requires adding a test for QSVT.
    (#684)

  • LightningQubit correctly decomposes state prep operations when used in the middle of a circuit.
    (#687)

  • LightningQubit correctly decomposes qml.QFT and qml.GroverOperator if len(wires) is greater than 9 and 12 respectively.
    (#687)

Description of the Change:
Add test_templates.py module where Grover and QSVT are tested.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.12%. Comparing base (288b08d) to head (a0c6265).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #684      +/-   ##
==========================================
+ Coverage   96.12%   99.12%   +2.99%     
==========================================
  Files         186      207      +21     
  Lines       24987    27607    +2620     
==========================================
+ Hits        24020    27365    +3345     
+ Misses        967      242     -725     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vincentmr vincentmr marked this pull request as ready for review April 17, 2024 14:02
@vincentmr vincentmr requested a review from a team April 17, 2024 14:02
Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work, @vincentmr! I left some, not so important, suggestions and questions.
Not a blocker.

tests/test_templates.py Outdated Show resolved Hide resolved
tests/test_templates.py Outdated Show resolved Hide resolved
tests/test_templates.py Outdated Show resolved Hide resolved
tests/test_templates.py Outdated Show resolved Hide resolved
vincentmr and others added 2 commits April 17, 2024 11:11
pennylane_lightning/core/_serialize.py Show resolved Hide resolved
tests/test_templates.py Outdated Show resolved Hide resolved
tests/test_templates.py Show resolved Hide resolved
@vincentmr vincentmr added the ci:build_wheels Activate wheel building. label Apr 17, 2024
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉 Let's revisit the use case of these tests after deploying the benchmark suite.

* Fix bug; add tests; update changelog

* Auto update version

* Update tests

* Update qft/grover decomp

* Addressing code review

* Update pennylane_lightning/lightning_qubit/lightning_qubit.py

Co-authored-by: Ali Asadi <[email protected]>

* Trigger CI

* Auto update version

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ali Asadi <[email protected]>
@maliasadi maliasadi added the ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request label Apr 18, 2024
@maliasadi maliasadi changed the title Add test for QSVT. Add test_templates module + Fix LQ decomposition of StatePrep Ops + Fix LQ decomposition strategy of QFT and GroverOperator Apr 18, 2024
@maliasadi maliasadi merged commit 72e4baa into master Apr 18, 2024
85 checks passed
@maliasadi maliasadi deleted the feature/test_templates branch April 18, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building. ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants