quantify_scheduler.backends.circuit_to_device
Compilation backend for quantum-circuit to quantum-device layer.
Module Contents
Functions
Add pulse information to all gates in the schedule. |
|
Ensures that each pulse/acquisition-level clock resource is added to the schedule. |
|
|
|
|
|
|
|
|
|
|
- compile_circuit_to_device(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig | Dict | None = None, *, device_cfg: quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig | Dict | None = None) quantify_scheduler.schedules.schedule.Schedule [source]
Add pulse information to all gates in the schedule.
Before calling this function, the schedule can contain abstract operations (gates or measurements). This function adds pulse and acquisition information with respect to config as they are expected to arrive to device (latency or distortion corrections are not taken into account).
From a point of view of Compilation, this function converts a schedule defined on a quantum-circuit layer to a schedule defined on a quantum-device layer.
- Parameters
schedule – The schedule to be compiled.
config – Compilation config for
QuantifyCompiler
, of which only theCompilationConfig.device_compilation_config
is used in this compilation step.device_cfg – (deprecated) Device compilation config. Pass a full compilation config instead using config argument. Note, if a dictionary is passed, it will be parsed to a
DeviceCompilationConfig
.
- Returns
A copy of schedule with pulse information added to all gates.
- Raises
ValueError – When both config and device_cfg are supplied.
- set_pulse_and_acquisition_clock(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig | Dict | None = None, *, device_cfg: quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig | Dict | None = None) quantify_scheduler.schedules.schedule.Schedule [source]
Ensures that each pulse/acquisition-level clock resource is added to the schedule.
If a pulse/acquisition-level clock resource has not been added to the schedule and is present in device_cfg, it is added to the schedule.
A warning is given when a clock resource has conflicting frequency definitions, and an error is raised if the clock resource is unknown.
- Parameters
schedule – The schedule to be compiled.
config – Compilation config for
QuantifyCompiler
, of which only theCompilationConfig.device_compilation_config
is used in this compilation step.device_cfg – (deprecated) Device compilation config. Pass a full compilation config instead using config argument. Note, if a dictionary is passed, it will be parsed to a
DeviceCompilationConfig
.
- Returns
A copy of schedule with all clock resources added.
- Warns
RuntimeWarning – When clock has conflicting frequency definitions.
- Raises
RuntimeError – When operation is not at pulse/acquisition-level.
ValueError – When both config and device_cfg are supplied.
ValueError – When clock frequency is unknown.
ValueError – When clock frequency is NaN.
- _add_device_repr_from_cfg(operation: quantify_scheduler.operations.operation.Operation, operation_cfg: quantify_scheduler.backends.graph_compilation.OperationCompilationConfig)[source]
- _add_device_repr_from_cfg_multiplexed(operation: quantify_scheduler.operations.operation.Operation, operation_cfg: quantify_scheduler.backends.graph_compilation.OperationCompilationConfig, mux_idx: int)[source]