Skip to content

Conversation

@paul0403
Copy link
Member

@paul0403 paul0403 commented Dec 5, 2025

Context:
Subroutine + for loop + qubit allocation fails.
This is because there's an integer check when judging whether a wire label was dynamically allocated or not. This logic fails because subroutines take in all wire labels as subroutine arguments, hence they are tracers.

Description of the Change:
Relocate the check to only where it's needed (as a throwback to relay truly const dynamically allocated wire indices, so subscope handlers can remove them from their subjaxpr's consts).

Benefits:
Subroutine + for loop + qubit allocation works. This unblocks decomp rules with dynamic allocation.

Related GitHub Issues: fixes #2263

[sc-105198]

@paul0403 paul0403 requested review from maliasadi and rniczh December 5, 2025 16:44
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch 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.

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (134f086) to head (582e556).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2268   +/-   ##
=======================================
  Coverage   97.57%   97.57%           
=======================================
  Files          93       93           
  Lines       11245    11248    +3     
  Branches     1076     1078    +2     
=======================================
+ Hits        10972    10975    +3     
  Misses        208      208           
  Partials       65       65           

☔ 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamic qubit allocation + subroutine + forloop fails

2 participants