-
Notifications
You must be signed in to change notification settings - Fork 43
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 gate on all PennyLane-Lightning devices #1088
base: master
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1088 +/- ##
==========================================
+ Coverage 95.79% 98.84% +3.05%
==========================================
Files 237 237
Lines 40193 40447 +254
==========================================
+ Hits 38501 39981 +1480
+ Misses 1692 466 -1226 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
**Context:** Currently, PSWAP does not have a custom implementation within PennyLane-Lightning. This results in it using the implementation from PennyLane-Core whenever the gate is used. By implementing the gate directly in PennyLane-Lightning, performance of the PSWAP gate can be improved. **Description of the Change:** Implements the PSWAP gate natively in lightning-qubit. **Benefits:** On a quick benchmark that runs O(10k) PSWAP gates on 20 qubits, the native implementation reduces execution time from ~9.0s to ~2.3s. **Possible Drawbacks:** **Related GitHub Issues:** #976: PSWAP gate implementation in Lightning Qubit [sc-77445] --------- Co-authored-by: ringo-but-quantum <[email protected]>
**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] --------- Co-authored-by: ringo-but-quantum <[email protected]>
**Context:** PSWAP does not have hooks within Lightning-GPU This results in it using the implementation from PennyLane-Core whenever the gate is used. By implementing the gate directly in Lightning-GPU, performance of the PSWAP gate can be improved. **Description of the Change:** Implements the PSWAP gate natively in Lightning-GPU. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-85802] --------- Co-authored-by: ringo-but-quantum <[email protected]>
**Context:** Currently, the implementation of PSWAP does not contain its generators, and the gate is not differentiable. **Description of the Change:** Implements generators for the PSWAP gate. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-86524] --------- Co-authored-by: ringo-but-quantum <[email protected]>
I merged the master here to manage the use of CI runners. Please double-check it. Thanks! |
Context:
Currently, PSWAP does not have a custom implementation within PennyLane-Lightning. This results in it using the implementation from PennyLane-Core whenever the gate is used. By implementing the gate directly in PennyLane-Lightning, performance of the PSWAP gate can be improved.
Description of the Change:
Implements the PSWAP gate natively in Lightning-Qubit, Lightning-Kokkos, and Lightning-GPU, along with the generators for the PSWAP gate.
Benefits:
Native implementation of the PSWAP gate provides significant performance benefits on all tested PennyLane-Lightning backends. The charts below show the execution time of circuits each containing 200 PSWAP gates on varying number of qubits, as well as the realized speedup from the native implementation.
NOTE The Lightning-Qubit backend was run with the dispatcher turned off to avoid any differences in speedup coming from running AVX kernels in the original version of the code.
Benchmarks for a constant number of PSWAPS:

Benchmarks for a dynamic number of PSWAPS, increasing with circuit size:

Possible Drawbacks:
Related GitHub Issues:
#976: PSWAP gate implementation in Lightning Qubit
[sc-77445]
[sc-85797]
[sc-85802]
[sc-86524]