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

Fix the LK+Windows and Catalyst+Lightning latest/latest failures #758

Merged
merged 22 commits into from
Jun 14, 2024

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Jun 10, 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:

  • Remove ControlledQubitUnitary in favour of C(QubitUnitary) from the list of supported operations and the device toml file. The stopping_condition method guarantees the consistency of decompositions. This change also reduces the size of the generated IR and impact the performance of Catalyst for the computation of C(QubitUnitrary) as this controlled gate is currently decomposed to QubitUnitary, hardcoding the expanded controlled-unitary-matrix into the IR.
  • Raise a clear error message when initializing lightning.kokkos with zero-qubit on Windows. Allocating 0-size Kokkos vectors not supported on Windows. Required to Pass LK+Windows CI.
  • Update toml files respectively to maintain support in Catalyst latest. Required to Pass Catalyst-Lightning latest/latest CI.

maliasadi and others added 2 commits June 10, 2024 10:53
…the decomposition of ctrl(LQ) and hardcode of expanded controlled matrices in the IR. LightningKokkos zero-qubit device initialization is not supported on Windows.
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.10%. Comparing base (52710ff) to head (e9b0650).
Report is 97 commits behind head on master.

Files with missing lines Patch % Lines
...ylane_lightning/lightning_qubit/lightning_qubit.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #758      +/-   ##
==========================================
- Coverage   95.57%   95.10%   -0.47%     
==========================================
  Files         109       92      -17     
  Lines       15694    13796    -1898     
==========================================
- Hits        14999    13121    -1878     
+ Misses        695      675      -20     

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

@maliasadi maliasadi changed the title Minor fixes in the codebase Fix the LK+Windows and Catalyst+Lightning latest/latest failures Jun 14, 2024
@maliasadi maliasadi added the ci:build_wheels Activate wheel building. label Jun 14, 2024
@maliasadi maliasadi marked this pull request as ready for review June 14, 2024 17:01
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.

Just a question to be clear.

pennylane_lightning/lightning_qubit/lightning_qubit.toml Outdated Show resolved Hide resolved
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.

Thanks @maliasadi!

tests/test_device.py Outdated Show resolved Hide resolved
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.

Nice work! I left a small suggestion, but not a blocker.

maliasadi and others added 3 commits June 14, 2024 15:50
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
@maliasadi maliasadi requested a review from vincentmr June 14, 2024 21:14
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.

Looks good to me now, thanks and cheers @maliasadi !

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.

Nice one! Thanks @maliasadi !

@maliasadi maliasadi merged commit f8097d5 into master Jun 14, 2024
108 of 110 checks passed
@maliasadi maliasadi deleted the maa/cqu-decomp branch June 14, 2024 22:44
maliasadi pushed a commit that referenced this pull request Jun 18, 2024
ControlledQubitUnitary is present in the Python device but not the TOML
(since #758
removed it from native gates), added it back to the decomposition gates
since it can be implemented in its alternate form of C(QubitUnitary).

Required for PennyLaneAI/catalyst#785

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants