Skip to content

Conversation

@andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Sep 3, 2025

Context:

def f(c1, c2):
    op = c1 * qml.X(0) + c2 * qml.X(0)
    op.simplify()

jax.jit(f)(1.0, 1.0)

would fail due to pauli arithmetic not being able to handle these abstract coefficients.

Description of the Change:

Handle the possibility of abstract coefficients.

Benefits:

After testing in Catalyst, PennyLaneAI/catalyst#2023, seems like it should fix this bug and latest/latest/latest.

Possible Drawbacks: None identified.

Fixes #8191

[sc-98660]

@andrijapau andrijapau added the urgent Mark a pull request as high priority label Sep 3, 2025
@github-actions

This comment was marked as resolved.

@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (4d684c6) to head (0238411).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8190   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files         548      548           
  Lines       56845    56845           
=======================================
  Hits        56672    56672           
  Misses        173      173           

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

@andrijapau andrijapau changed the title experiment: try to fix LLL fix: can jax.jit a function containing pauli arithmetic with abstract coefficients Sep 4, 2025
@andrijapau andrijapau changed the title fix: can jax.jit a function containing pauli arithmetic with abstract coefficients fix: update pauli arithmetic to work with abstract coefficients when jitted Sep 4, 2025
@andrijapau andrijapau changed the title fix: update pauli arithmetic to work with abstract coefficients when jitted fix: update pauli arithmetic to handle abstract coefficients when jitted Sep 4, 2025
@andrijapau andrijapau added this pull request to the merge queue Sep 5, 2025
Merged via the queue into master with commit 68998c5 Sep 5, 2025
80 of 83 checks passed
@andrijapau andrijapau deleted the fix-lll branch September 5, 2025 19:51
paul0403 pushed a commit to PennyLaneAI/catalyst that referenced this pull request Sep 6, 2025
Need to update required version of lightning after this
[PR](PennyLaneAI/pennylane#8190) in PennyLane
is merged. This is because
PennyLaneAI/pennylane-lightning#1246 is the fix.

[sc-98660]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

urgent Mark a pull request as high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] pauli arithmetic cannot handle abstract coefficients when jitted

5 participants