iqm.cpc.compiler.standard_stages.merge_multiplexed_timeboxes#
- iqm.cpc.compiler.standard_stages.merge_multiplexed_timeboxes(circuit_box)#
Merge any MultiplexedProbeTimeBoxes inside a TimeBox representing a circuit.
This pass optimizes a situation where multiple “measure” gates on disjoint set of loci exist sequentially in the circuit. Without optimization, each gate would result in a separate trigger event, which results in worse performance. For example, with the measurement instructions [M(QB1), M(QB2), M(QB3)], we’d first measure QB1, then QB2, then QB3. This optimization merges the measurement timeboxes, so that we’ll measure QB1, QB2, and QB3 at the same time (if the hardware channel configuration allows it), corresponding to M(QB1, QB2, QB3).
Goes through the children of circuit_box, and places them in the same temporal order. Whenever a MultiplexedProbeTimeBox is encountered (i.e. from a measure gate), it is merged with the previous pending MultiplexedProbeTimeBox and left pending. If any other box type with colliding loci is encountered, first places the pending MultiplexedProbeTimeBox. This essentially delays all measurements until the last possible moment.
- Parameters:
circuit_box (TimeBox) – Timebox representing a circuit, where each child should represent a single gate.
- Returns:
A new Timebox with the same content, except with some MultiplexedProbeTimeBoxes merged.
- Return type:
TimeBox