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 the circuit execution options.

  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 no longer supported.

  3. Validate the contents of the circuits.

  4. Map the logical QPU components to physical QPU components. Provided mapping is used, if any. Otherwise, identity mapping is used.

  5. Choose implementations for circuit operations based on the calibration set.

  6. 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 dynamical decoupling sequences to the schedule if requested.

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

  3. 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.

choose_op_implementations(circuits, builder, ...)

Analyze the instructions in the circuits and pick an implementation for each (operation, locus).

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_components(circuits, builder, ...)

Map the logical QPU components to physical QPU components using component_mapping.

map_old_operations(circuits)

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(circuits, builder)

Validate the contents of the quantum circuits.

validate_execution_options(circuits, options)

Validate the circuit execution options (only some combinations make sense).