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

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