Skip to content

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Oct 2, 2025

Context:

When updating catalyst, I was getting extremely irritated by the fact that qml.qjit(qml.grad(f))(*args) does not work.

Description of the Change:

Lazily dispatch grad and jacobian so we can do qml.qjit(qml.grad(f)) and qml.qjit(qml.jacobian(f)).

Benefits:

Less rage. More intuitive experience.

Possible Drawbacks:

Related GitHub Issues:

[sc-100724]

Copy link
Contributor

github-actions bot commented Oct 2, 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.

Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.42%. Comparing base (60f4f10) to head (10f9c03).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8382      +/-   ##
==========================================
- Coverage   99.42%   99.42%   -0.01%     
==========================================
  Files         584      584              
  Lines       61323    61338      +15     
==========================================
+ Hits        60972    60986      +14     
- Misses        351      352       +1     

☔ 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.

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Just some tiny nitpick about the error message for non-qjit, and a question about performance in case of repeated execution.

@albi3ro albi3ro requested a review from dwierichs October 2, 2025 20:09
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me 🎉

@albi3ro albi3ro requested a review from astralcai October 14, 2025 15:36
@albi3ro albi3ro added this pull request to the merge queue Oct 14, 2025
Merged via the queue into master with commit d566072 Oct 14, 2025
54 checks passed
@albi3ro albi3ro deleted the lazily-grad-dispatch branch October 14, 2025 19:42
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.

3 participants