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 support for C(BlockEncode) #743

Merged
merged 8 commits into from
Jun 3, 2024
Merged

Add support for C(BlockEncode) #743

merged 8 commits into from
Jun 3, 2024

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented May 28, 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:
To test the QSVT workflow with Lightning devices, we need support for C(BlockEncode). This PR adds this support via applying the underlying unitary matrix; including python tests to check the correctness of BlockEncode and C(BlockEncode) and updating the device toml files to maintain the support in Catalyst.

Description of the Change:

  • Update the list of operations in Lightning devices
  • Update device toml files to maintain the support in Catalyst
  • Add python tests

Benefits:
Support C(BlockEncode).

Possible Drawbacks:

Related GitHub Issues:
[sc-64361]

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.57%. Comparing base (e20b789) to head (ea77cc2).
Report is 84 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (e20b789) and HEAD (ea77cc2). Click for more details.

HEAD has 52 uploads less than BASE
Flag BASE (e20b789) HEAD (ea77cc2)
57 5
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #743       +/-   ##
===========================================
- Coverage   90.45%   70.57%   -19.89%     
===========================================
  Files          81       15       -66     
  Lines       11672     1716     -9956     
===========================================
- Hits        10558     1211     -9347     
+ Misses       1114      505      -609     

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

@AmintorDusko
Copy link
Contributor

Could you please port this change? We have this --exitfirst merged by mistake.

.github/CHANGELOG.md Outdated Show resolved Hide resolved
@maliasadi maliasadi requested review from AmintorDusko and a team May 29, 2024 15:11
@vincentmr vincentmr self-requested a review May 29, 2024 15:22
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Thanks @maliasadi , just a couple questions but looks good to me.

tests/test_apply.py Outdated Show resolved Hide resolved
tests/test_apply.py Outdated Show resolved Hide resolved
Copy link
Member

@multiphaseCFD multiphaseCFD left a comment

Choose a reason for hiding this comment

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

Thanks @maliasadi ! Just a few questions.

@maliasadi maliasadi added ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request ci:build_wheels Activate wheel building. labels May 31, 2024
Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

🙌

Copy link
Member

@multiphaseCFD multiphaseCFD left a comment

Choose a reason for hiding this comment

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

Thanks @maliasadi ! Happy to approve

Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

LGTM @maliasadi !

@maliasadi maliasadi merged commit 6ca460a into master Jun 3, 2024
81 of 82 checks passed
@maliasadi maliasadi deleted the maa/ctrl-blockencode branch June 3, 2024 14:29
dime10 added a commit to PennyLaneAI/catalyst that referenced this pull request Jun 18, 2024
This PR aims to remove obsolete TOML related code and also resolve
incompatibilities with the latest lightning device versions.

- The verifier is relaxed to only test agreement of basic gates (no
adjoint/control) between the toml and python device spec.
- This is needed to resolve the overlapping gate issue introduced by
PennyLaneAI/pennylane-lightning#743
- and also allows removing the patch for Lightning Kokkos that exists
solely to satisfy the verifier.

- The obsolete toml files in the catalyst repo for lightning devices is
also removed.

- MCMs are marked as un-invertible and un-controllable, since they are
non-unitary.

Requires: PennyLaneAI/pennylane-lightning#758

[sc-65114]
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.

6 participants