Skip to content

Commit b72fd22

Browse files
erick-xanaduringo-but-quantummaliasadi
authored andcommitted
TOML files update (#826)
**Context:** We would like Catalyst to optimize the first instance of `qml.StatePrep` by just setting the state vector in PennyLane lightning. **Description of the Change:** To achieve this, we set a flag in the TOML files where it denotes whether the value for the flag `skip_initial_state_prep` used during decomposition. This flag is already in PennyLane and will skip the initial state preparation. There are other ways to achieve this but this is the least invasive way to do so. Some other alternatives that were discussed: 1. Adding StatePrep to the list of supported operations: this is not a good idea as it would lead StatePrep to not be decomposed ever. 2. Creating a new operation and map StatePrep directly into this new operation only in the context of Catalyst. This would lead to setting this new `qml` Operation in the list of supported operations on the device, even though it would never be seen except when using with Catalyst. The way this was achieved was not to create a new `qml` Operation, only an JAXPR/MLIR operation and bind `StatePrep` to this JAXPR operation and lower it through MLIR. So, no new `qml` operations. **Benefits:** Optimization **Possible Drawbacks:** More flags. No one likes flags. **Related GitHub Issues:** Will be followed by this PennyLaneAI/catalyst#955 pull request in Catalyst. [sc-69069] --------- Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: Ali Asadi <[email protected]>
1 parent eca7f28 commit b72fd22

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

.github/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
* Add a Catalyst-specific wrapping class for Lightning Kokkos.
6464
[(#770)](https://github.com/PennyLaneAI/pennylane-lightning/pull/770)
6565

66+
* Add `initial_state_prep` option to Catalyst TOML file.
67+
[(#826)](https://github.com/PennyLaneAI/pennylane-lightning/pull/826)
68+
6669
### Documentation
6770

6871
* Updated the README and added citation format for Lightning arxiv preprint.
@@ -89,7 +92,7 @@
8992

9093
This release contains contributions from (in alphabetical order):
9194

92-
Ali Asadi, Amintor Dusko, Vincent Michaud-Rioux, Lee J. O'Riordan, Mudit Pandey, Shuli Shu, Paul Haochen Wang
95+
Ali Asadi, Amintor Dusko, Vincent Michaud-Rioux, Erick Ochoa Lopez, Lee J. O'Riordan, Mudit Pandey, Shuli Shu, Paul Haochen Wang
9396

9497
---
9598

pennylane_lightning/lightning_gpu/lightning_gpu.toml

+2
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ dynamic_qubit_management = false
109109
# in a single execution
110110
non_commuting_observables = true
111111

112+
# Whether the device supports (arbitrary) initial state preparation.
113+
initial_state_prep = true

pennylane_lightning/lightning_kokkos/lightning_kokkos.toml

+2
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ dynamic_qubit_management = false
112112
# in a single execution
113113
non_commuting_observables = true
114114

115+
# Whether the device supports (arbitrary) initial state preparation.
116+
initial_state_prep = true

pennylane_lightning/lightning_qubit/lightning_qubit.toml

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ dynamic_qubit_management = false
107107
# in a single execution
108108
non_commuting_observables = true
109109

110+
# Whether the device supports (arbitrary) initial state preparation.
111+
initial_state_prep = true
112+
110113
[options]
111114

112115
mcmc = "_mcmc"

0 commit comments

Comments
 (0)