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

Implement PSWAP in Lightning-Kokkos #1089

Merged
merged 43 commits into from
Mar 14, 2025

Conversation

jzaia18
Copy link
Contributor

@jzaia18 jzaia18 commented Mar 12, 2025

Context:
PSWAP does not have a custom implementation within Lightning-Kokkos. This results in it using the implementation from PennyLane-Core whenever the gate is used. By implementing the gate directly in Lightning-Kokkos, performance of the PSWAP gate can be improved.

Description of the Change:
Implements the PSWAP gate natively in Lightning-Kokkos.

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-85797]

jzaia18 and others added 30 commits March 7, 2025 09:49
@jzaia18 jzaia18 added the draft Indicates that the PR is still in draft mode, but needs CIs. label Mar 12, 2025
@jzaia18 jzaia18 changed the base branch from feature/pswap-impl-base to feature/pswap-impl March 12, 2025 14:09
@jzaia18 jzaia18 changed the base branch from feature/pswap-impl to feature/pswap-impl-base March 12, 2025 14:12
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (feature/pswap-impl-base@a2ae095). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             feature/pswap-impl-base    #1089   +/-   ##
==========================================================
  Coverage                           ?   95.46%           
==========================================================
  Files                              ?      177           
  Lines                              ?    27734           
  Branches                           ?        0           
==========================================================
  Hits                               ?    26477           
  Misses                             ?     1257           
  Partials                           ?        0           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jzaia18 jzaia18 self-assigned this Mar 12, 2025
@jzaia18 jzaia18 requested a review from Copilot March 13, 2025 20:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a native PSWAP gate implementation in Lightning-Kokkos to improve performance while updating related configurations and test cases.

  • Update changelog entries for both Lightning-Kokkos and Lightning-Qubit.
  • Remove the PSWAP entry from lightning_qubit.py and add its configuration in TOML files for both backends.
  • Update test cases to incorporate the new PSWAP gate.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/CHANGELOG.md Added changelog entries for PSWAP in Lightning-Kokkos and Lightning-Qubit.
pennylane_lightning/lightning_qubit/lightning_qubit.py Removed PSWAP operator mapping for Lightning-Qubit.
pennylane_lightning/lightning_kokkos/lightning_kokkos.toml Added PSWAP gate configuration under Lightning-Kokkos.
pennylane_lightning/lightning_qubit/lightning_qubit.toml Added PSWAP gate configuration for Lightning-Qubit.
tests/test_gates.py Updated unit tests to include PSWAP gate verification.
Comments suppressed due to low confidence (1)

pennylane_lightning/lightning_qubit/lightning_qubit.py:70

  • PSWAP has been removed from the Lightning-Qubit implementation. Confirm that this removal aligns with the intended design given the corresponding changelog entry.
"PSWAP": OperatorProperties(),

@jzaia18 jzaia18 changed the title [WIP] Implement PSWAP in Lightning-Kokkos Implement PSWAP in Lightning-Kokkos Mar 14, 2025
@jzaia18 jzaia18 removed the draft Indicates that the PR is still in draft mode, but needs CIs. label Mar 14, 2025
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! Thank you for that! Let me know if you need any support here.

@jzaia18 jzaia18 requested a review from a team March 14, 2025 17:14
Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a comment

Choose a reason for hiding this comment

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

LGTM!
Thank you @jzaia18 🚀

@jzaia18 jzaia18 merged commit 085a240 into feature/pswap-impl-base Mar 14, 2025
82 checks passed
@jzaia18 jzaia18 deleted the feature/pswap-impl-kokkos branch March 14, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants