Skip to content

Commit 50feb87

Browse files
jzaia18maliasadi
authored andcommitted
Pass track_resources attribute through to Catalyst runtime (#7372)
**Context:** PR #7226 added a resource-tracking feature to PennyLane. The same feature is desired in Catalyst: PennyLaneAI/catalyst#1619 **Description of the Change:** Adds a class attribute to `null.qubit` which allows the `resource_tracking` argument to get passed through to Catalyst. **Benefits:** `track_resources` can more cleanly be passed through to Catalyst. **Possible Drawbacks:** **Related GitHub Issues:** #7226 PennyLaneAI/catalyst#1619 PennyLaneAI/pennylane-benchmarks#76 [sc-88213](https://app.shortcut.com/xanaduai/story/88213) --------- Co-authored-by: Ali Asadi <[email protected]>
1 parent e46fa54 commit 50feb87

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/releases/changelog-dev.md

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ Here's a list of deprecations made this release. For a more detailed breakdown o
232232

233233
* `null.qubit` can now support an optional `track_resources` argument which allows it to record which gates are executed.
234234
[(#7226)](https://github.com/PennyLaneAI/pennylane/pull/7226)
235+
[(#7372)](https://github.com/PennyLaneAI/pennylane/pull/7372)
235236

236237
* A new internal module, `qml.concurrency`, is added to support internal use of multiprocess and multithreaded execution of workloads. This also migrates the use of `concurrent.futures` in `default.qubit` to this new design.
237238
[(#7303)](https://github.com/PennyLaneAI/pennylane/pull/7303)

pennylane/devices/null_qubit.py

+3
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ def __init__(self, wires=None, shots=None, track_resources=False) -> None:
277277
self._debugger = None
278278
self._track_resources = track_resources
279279

280+
# this is required by Catalyst to toggle the tracker at runtime
281+
self.device_kwargs = {"track_resources": track_resources}
282+
280283
def _simulate(self, circuit, interface):
281284
num_device_wires = len(self.wires) if self.wires else len(circuit.wires)
282285
results = []

0 commit comments

Comments
 (0)