Skip to content

Support control flow in DAGCircuit.collect_runs #9425

@jakelishman

Description

@jakelishman

What should we add?

Transitively part of #9417.

Transpiler optimisation level 3 adds in extra passes to resynthesise all runs of 2q blocks. Doing this involves finding the runs of blocks, which is the pass Collect2qRuns, which mostly just delegates to DAGCircuit.collect_runs (via DAGCircuit.collect_2q_runs). This whole chain needs upgrading to be able to handle control-flow.

In particular: DAGCircuit.collect_runs needs an upgrade to its output format to allow the specification runs that are nested within control flow. Control-flow operations that act on two qubits should not themselves be considered part of a run, although their contained block may be a run of itself.

For the new data format, there is likely some overlap here with #9423. The new data format should be backwards compatible with the old one. That is, a circuit without control flow should produce the same output in the old and new forms of this function, since it is a user-facing method.

Fixing this should automatically upgrade the analysis transpiler passes Collect2qBlocks and Collect1qRuns (and this should be part of the test suite). This alone will not enable the transformation pass ConsolidateBlocks to read this information - for that, see #9426.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions