Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control-flow routing causes idle qubits to be stripped from control-flow blocks #13768

Open
jakelishman opened this issue Jan 30, 2025 · 0 comments · May be fixed by #13790
Open

Control-flow routing causes idle qubits to be stripped from control-flow blocks #13768

jakelishman opened this issue Jan 30, 2025 · 0 comments · May be fixed by #13790
Assignees
Labels
bug Something isn't working

Comments

@jakelishman
Copy link
Member

What should we add?

Any qubits that are idling within a control-flow block will be stripped from the block if routing runs on it. This is a side effect of how control-flow routing is done; we first expand the block to all physical qubits, recurse the router, then contract it back to non-idling qubits.

This can in many ways be considered a fair optimisation, especially for the control-flow operations currently implemented, since it reduces spurious data dependencies. However, it does change the semantics of the circuit in a way that is not entirely appropriate for routing to do, and it becomes more of a problem when explicit no-ops are given higher status as in #13767. For the upcoming box, removing the qubit dependency is a violation of the contract, since the data dependency is a part of the box semantics (certainly for some "verbatim"-like annotations).

There are two steps to this:

  • make the routers contract to at least the physical qubits corresponding to incident virtual qubits that were originally incident, plus any additional physical qubits now touched by routing, such that the virtual-qubit dependencies on input and output are non-strict supersets of the pre-routing state.
  • add a transpiler pass to relevant optimisation loops that performs legal contractions of control-flow operation bodies (probably both abstract and hardware-lowered optimisations).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant