Skip to content

Conversation

@jzaia18
Copy link
Contributor

@jzaia18 jzaia18 commented Sep 4, 2025

Context:
qml.specs() currently does not support Catalyst. However, Catalyst does have a resource tracking feature via null.qubit which is a way to extract runtime circuit execution information.

Description of the Change:
Uses the resource tracking feature within Catalyst to add support for qml.specs() for qjit'd workloads when level="device".

Removes the "resource tracking" feature from PennyLane, leaving it as a Catalyst-only feature.

Benefits:
qml.specs now supports qjit'd code. There is now 1 unified entrypoint into gathering circuit resources via qml.specs

Possible Drawbacks:
The underlying implementation of qml.specs() differs quite significantly from the PennyLane version, which analyses the tape.

The following attributes are missing from the QJIT version of specs errors, num_observables, num_trainable_params, num_tape_wires, gradient_fn, and num_gradient_executions

Related GitHub Issues:
Depends on changes to null.qubit resource tracking introduced in PennyLaneAI/catalyst#2033
[sc-98157]
[sc-98439]

@jzaia18 jzaia18 self-assigned this Sep 4, 2025
@jzaia18 jzaia18 added the WIP 🚧 Work-in-progress label Sep 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@jzaia18 jzaia18 requested a review from AntonNI8 September 5, 2025 17:03
@jzaia18 jzaia18 changed the title [WIP] Add support for qjit'd code to qml.specs() Add support for qjit'd code to qml.specs() Sep 11, 2025
@jzaia18 jzaia18 marked this pull request as ready for review September 11, 2025 19:15
@jzaia18 jzaia18 requested a review from a team September 11, 2025 19:15
@jzaia18
Copy link
Contributor Author

jzaia18 commented Sep 11, 2025

Currently in the process of writing a simple set of unit tests using mocks. Proper integration tests will be needed, but they will not be a part of this PR since they may end up in another repo

@jzaia18 jzaia18 requested a review from JerryChen97 September 18, 2025 17:48
Copy link
Contributor

@JerryChen97 JerryChen97 left a comment

Choose a reason for hiding this comment

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

Thx!

@jzaia18
Copy link
Contributor Author

jzaia18 commented Sep 18, 2025

Is the CI failure a known issue? This seems unrelated to my changes

@JerryChen97
Copy link
Contributor

Is the CI failure a known issue? This seems unrelated to my changes

Almost fixed. The fix in in the merge q

@JerryChen97
Copy link
Contributor

Codcov probly just caused by unsync with master

@JerryChen97 JerryChen97 added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 18, 2025
jzaia18 added a commit to PennyLaneAI/catalyst that referenced this pull request Sep 18, 2025
…gnificantly more data (#2033)

**Context:**
PennyLane's `qml.specs()` does not support Catalyst `qjit`'d code.
However, `null.qubit` resource tracking is an avenue to provide this
support.

**Description of the Change:**
Significantly improves `null.qubit` resource tracking to provide all
necessary information for feature parity with `qml.specs`.

Improves documentation within existing `NullQubit` class.

**Benefits:**
Allows a UI to exist that provides device level circuit specs from
PennyLane. Significantly cleans up and robustifies existing resource
tracking code.

**Possible Drawbacks:**

**Related GitHub Issues:**
[[sc-98157](https://app.shortcut.com/xanaduai/story/98157)]
Builds upon resource tracking feature introduced in #1619 
Changes to `qml.specs()` to enable an entrypoint into resource tracking
are in PennyLaneAI/pennylane#8202

---------

Co-authored-by: Paul <[email protected]>
Co-authored-by: Joseph Lee <[email protected]>
Co-authored-by: ANT0N <[email protected]>
@jzaia18 jzaia18 added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2025
@jzaia18 jzaia18 enabled auto-merge September 19, 2025 04:17
@jzaia18 jzaia18 added this pull request to the merge queue Sep 19, 2025
Merged via the queue into master with commit 495aa65 Sep 19, 2025
52 checks passed
@jzaia18 jzaia18 deleted the feature/catalyst-specs branch September 19, 2025 04:58
jzaia18 added a commit to PennyLaneAI/catalyst that referenced this pull request Sep 24, 2025
**Context:**
PRs #2033 and
PennyLaneAI/pennylane#8202 integrate `qml.specs`
with Catalyst `qjit`'d code via the resource tracking feature.

**Description of the Change:**
Adds end-to-end tests of `qml.specs` on `qjit`'d code.

**Benefits:**
Code coverage.

**Possible Drawbacks:**

**Related GitHub Issues:**
[sc-99166]
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.

5 participants