iqm.cpc.compiler.standard_stages#

Standard compilation stages, their constituent compiler passes, and functions for implementing them.

There are 6 standard compilation stages:

  1. Circuit-to-circuit.

  2. Circuit-to-timebox.

  3. Timebox-to-timebox.

  4. Timebox-to-schedule.

  5. Schedule-to-schedule.

  6. Schedule-to-playlist.

Breakdown of compiler passes of each stage:

1. Circuit-to-circuit#

  1. Validate options.move_gate_validation has the correct value if MoveGateFrameTrackingMode is set to FULL in circuit execution options. The value must be one of MoveGateValidationMode.

  2. Map backwards-compatible aliases for quantum operation names into the current name. This is needed until old operation names such as phased_rx and measurement are fully deprecated.

  3. Map the logical components to physical components and choose gate implementations to use. Provided mapping is used, if provided. Otherwise, identity mapping is used.

  4. Derive mapping between station acquisition labels and user’s measurement keys. Populates readout_mappings and heralded_components of context.

2. Circuit-to-timebox#

  1. Resolve the circuits to timeboxes using ScheduleBuilder.circuit_to_timebox().

3. Timebox-to-timebox#

  1. Merge any MultiplexedProbeTimeBoxes inside each TimeBox using TimeBox.composite().

  2. Add the heralding measurement timebox to all circuits if HeraldingMode in circuit execution options requires it.

  3. Add a reset timebox to all circuits.

4. Timebox-to-schedule#

  1. Resolve the timeboxes to schedules using ScheduleBuilder.resolve_timebox().

5. Schedule-to-schedule#

  1. Apply resonator-related phase corrections if MOVE gates are used.

  2. Remove non-functional instructions from schedules using ScheduleBuilder._finish_schedule().

6. Schedule-to-playlist#

  1. Build the playlist from the schedules using ScheduleBuilder.build_playlist().

Functions

apply_dd_strategy(schedules, builder, options)

Insert dynamical decoupling sequences into the schedules, if dynamical decoupling is enabled.

apply_move_gate_phase_corrections(schedules, ...)

Apply calibrated phase corrections if MOVE gates are used.

build_playlist(schedules, builder)

Build the playlist from the schedules.

clean_schedule(schedules, builder)

Remove non-functional instructions from schedules.

derive_readout_mappings(circuits, builder, ...)

Derive mapping between station acquisition labels and user's measurement keys.

get_standard_stages([idempotent])

Get a copy of the standard compilation stages.

map_implementations_for_loci(circuits, ...)

Map the logical components to physical components and choose gate implementations to use.

map_old_operations(circuits, builder)

Map backwards-compatible aliases for quantum operation names into the current name.

merge_multiplexed_timeboxes(circuit_box)

Merge any MultiplexedProbeTimeBoxes inside a TimeBox representing a circuit.

multiplex_readout(timeboxes)

Merge any MultiplexedProbeTimeBoxes inside a TimeBox representing a circuit.

prepend_heralding(timeboxes, builder, ...)

Add the heralding measurement timebox to all circuits.

prepend_reset(timeboxes, builder, options, ...)

Add a reset timebox to all circuits.

resolve_circuits(circuits, builder)

Resolve the circuits to timeboxes.

resolve_timeboxes(timeboxes, builder)

Resolve the timeboxes to schedules.

validate_circuits_move_gate(circuits, options)

Validate options.move_gate_validation has the correct value if MoveGateFrameTrackingMode.FULL is enabled.