Skip to content

Conversation

paul0403
Copy link
Member

@paul0403 paul0403 commented Oct 20, 2025

Context:
Higher order primitives can take in dynamically allocated registers

Description of the Change:

  • changelog
  • remove the restriction from docs
  • general case (initial solution is a prototype for just one register coming in)
  • cond
  • for loop
  • while loop
  • adjoint
  • subroutine
  • decomposition?

Benefits:

Possible Drawbacks:
Don't know why, but while other subregions have arg signature (args, qreg), subroutine has signature (qreg, args), i.e. it has args in reverse order. This means the subregion wrapper (the thing to be make_jaxpr'd) cannot be reused for subroutines.
This is probably something we can just reorder?

Also, subroutine takes in wire indices through tracer args of the subroutine, even when the indices are static. This means its qreg_map logic between inner qregs and outer qregs is different than the others.

Related GitHub Issues:
[sc-99734]

@paul0403 paul0403 added the wip PRs that are a Work-In-Progress label Oct 20, 2025
@paul0403 paul0403 marked this pull request as ready for review October 22, 2025 22:13
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.41%. Comparing base (75e057b) to head (8dbadfb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2130      +/-   ##
==========================================
- Coverage   97.43%   97.41%   -0.03%     
==========================================
  Files          92       92              
  Lines       10613    10465     -148     
  Branches      998     1013      +15     
==========================================
- Hits        10341    10194     -147     
+ Misses        214      213       -1     
  Partials       58       58              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip PRs that are a Work-In-Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant