quantify_scheduler#

Import alias

Target

QuantumDevice

quantify_scheduler.QuantumDevice

Schedule

quantify_scheduler.Schedule

Resource

quantify_scheduler.Resource

ClockResource

quantify_scheduler.ClockResource

BasebandClockResource

quantify_scheduler.BasebandClockResource

DigitalClockResource

quantify_scheduler.DigitalClockResource

Operation

quantify_scheduler.Operation

structure

quantify_scheduler.structure

ScheduleGettable

quantify_scheduler.ScheduleGettable

BasicElectronicNVElement

quantify_scheduler.BasicElectronicNVElement

BasicSpinElement

quantify_scheduler.BasicSpinElement

BasicTransmonElement

quantify_scheduler.BasicTransmonElement

CompositeSquareEdge

quantify_scheduler.CompositeSquareEdge

InstrumentCoordinator

quantify_scheduler.InstrumentCoordinator

GenericInstrumentCoordinatorComponent

quantify_scheduler.GenericInstrumentCoordinatorComponent

SerialCompiler

quantify_scheduler.SerialCompiler

MockLocalOscillator

quantify_scheduler.MockLocalOscillator

Subpackages#

Submodules#

Package Contents#

Classes#

SerialCompiler

A compiler that executes compilation passes sequentially.

BasicElectronicNVElement

A device element representing an electronic qubit in an NV center.

BasicSpinElement

A device element representing a Loss–DiVincenzo Spin qubit.

BasicTransmonElement

A device element representing a single fixed-frequency transmon qubit.

CompositeSquareEdge

An example Edge implementation which connects two BasicTransmonElements.

QuantumDevice

The QuantumDevice directly represents the device under test (DUT).

ScheduleGettable

Generic gettable for a quantify schedule using vector (I,Q) acquisition.

MockLocalOscillator

A class representing a dummy Local Oscillator.

InstrumentCoordinator

The InstrumentCoordinator serves as

GenericInstrumentCoordinatorComponent

A Generic class which can be used for interaction with the InstrumentCoordinator.

Operation

A representation of quantum circuit operations.

BasebandClockResource

Global identity for a virtual baseband clock.

ClockResource

The ClockResource corresponds to a physical clock used to modulate pulses.

DigitalClockResource

Global identity for a virtual digital clock.

Resource

A resource corresponds to a physical resource such as a port or a clock.

Schedule

A modifiable schedule.

class SerialCompiler(name: str, quantum_device: quantify_scheduler.device_under_test.quantum_device.QuantumDevice | None = None)[source]#

Bases: QuantifyCompiler

A compiler that executes compilation passes sequentially.

construct_graph(config: SerialCompilationConfig) None[source]#

Construct the compilation graph based on a provided config.

For a serial backend, it is just a list of compilation passes.

_compilation_func(schedule: quantify_scheduler.schedules.schedule.Schedule, config: SerialCompilationConfig) quantify_scheduler.schedules.schedule.CompiledSchedule[source]#

Compile a schedule using the backend and the information provided in the config.

Parameters:
  • schedule – The schedule to compile.

  • config – A dictionary containing the information needed to compile the schedule. Nodes in this compiler specify what key they need information from in this dictionary.

class BasicElectronicNVElement(name: str, **kwargs)[source]#

Bases: quantify_scheduler.device_under_test.device_element.DeviceElement

A device element representing an electronic qubit in an NV center.

The submodules contain the necessary qubit parameters to translate higher-level operations into pulses. Please see the documentation of these classes.

Examples

Qubit parameters can be set through submodule attributes

from quantify_scheduler import BasicElectronicNVElement

qubit = BasicElectronicNVElement("q2")

qubit.rxy.amp180(0.1)
qubit.measure.pulse_amplitude(0.25)
qubit.measure.pulse_duration(300e-9)
qubit.measure.acq_delay(430e-9)
qubit.measure.acq_duration(1e-6)
...
Ellipsis
spectroscopy_operation: SpectroscopyOperationHermiteMW#

Submodule SpectroscopyOperationHermiteMW.

ports: Ports#

Submodule Ports.

clock_freqs: ClockFrequencies#

Submodule ClockFrequencies.

reset: ResetSpinpump#

Submodule ResetSpinpump.

charge_reset: ChargeReset#

Submodule ChargeReset.

measure: Measure#

Submodule Measure.

pulse_compensation: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule#

Submodule PulseCompensationModule.

cr_count: CRCount#

Submodule CRCount.

rxy: RxyHermite#

Submodule Rxy.

_generate_config() dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]][source]#

Generate part of the device configuration specific to a single qubit.

This method is intended to be used when this object is part of a device object containing multiple elements.

generate_device_config() quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig[source]#

Generate a valid device config for the quantify-scheduler.

This makes use of the compile_circuit_to_device_with_config_validation() function.

This enables the settings of this qubit to be used in isolation.

class BasicSpinElement(name: str, **kwargs: Any)[source]#

Bases: quantify_scheduler.device_under_test.device_element.DeviceElement

A device element representing a Loss–DiVincenzo Spin qubit. The element refers to the intrinsic spin-1/2 degree of freedom of individual electrons/holes trapped in quantum dots. The charge of the particle is coupled to a resonator.

Examples

Qubit parameters can be set through submodule attributes

from quantify_scheduler import BasicSpinElement

qubit = BasicSpinElement("q1")

qubit.rxy.amp180(0.1)
qubit.measure.pulse_amp(0.25)
qubit.measure.pulse_duration(300e-9)
qubit.measure.acq_delay(430e-9)
qubit.measure.integration_time(1e-6)
...
Ellipsis
Parameters:
  • name – The name of the spin element.

  • kwargs – Can be used to pass submodule initialization data by using submodule name as keyword and as argument a dictionary containing the submodule parameter names and their value.

reset: quantify_scheduler.device_under_test.transmon_element.IdlingReset#

Submodule IdlingReset.

rxy: RxyGaussian#

Submodule RxyGaussian.

measure: DispersiveMeasurementSpin#

Submodule DispersiveMeasurementSpin.

pulse_compensation: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule#

Submodule PulseCompensationModule.

ports: PortsSpin#

Submodule PortsSpin.

clock_freqs: ClocksFrequenciesSpin#

Submodule ClocksFrequenciesSpin.

_generate_config() dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]][source]#

Generate part of the device configuration specific to a single qubit.

This method is intended to be used when this object is part of a device object containing multiple elements.

generate_device_config() quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig[source]#

Generate a valid device config.

The config will be used for the quantify-scheduler making use of the compile_circuit_to_device_with_config_validation() function.

This enables the settings of this qubit to be used in isolation.

class BasicTransmonElement(name: str, **kwargs)[source]#

Bases: quantify_scheduler.device_under_test.device_element.DeviceElement

A device element representing a single fixed-frequency transmon qubit.

The qubit is coupled to a readout resonator.

Examples

Qubit parameters can be set through submodule attributes

from quantify_scheduler import BasicTransmonElement

qubit = BasicTransmonElement("q3")

qubit.rxy.amp180(0.1)
qubit.measure.pulse_amp(0.25)
qubit.measure.pulse_duration(300e-9)
qubit.measure.acq_delay(430e-9)
qubit.measure.integration_time(1e-6)
...
Ellipsis
Parameters:
  • name – The name of the transmon element.

  • kwargs – Can be used to pass submodule initialization data by using submodule name as keyword and as argument a dictionary containing the submodule parameter names and their value.

reset: IdlingReset#

Submodule IdlingReset.

rxy: RxyDRAG#

Submodule RxyDRAG.

measure: DispersiveMeasurement#

Submodule DispersiveMeasurement.

pulse_compensation: PulseCompensationModule#

Submodule PulseCompensationModule.

ports: Ports#

Submodule Ports.

clock_freqs: ClocksFrequencies#

Submodule ClocksFrequencies.

_generate_config() dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]][source]#

Generate part of the device configuration specific to a single qubit.

This method is intended to be used when this object is part of a device object containing multiple elements.

generate_device_config() quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig[source]#

Generate a valid device config.

The config will be used for the quantify-scheduler making use of the compile_circuit_to_device_with_config_validation() function.

This enables the settings of this qubit to be used in isolation.

class CompositeSquareEdge(parent_element_name: str, child_element_name: str, **kwargs)[source]#

Bases: quantify_scheduler.device_under_test.edge.Edge

An example Edge implementation which connects two BasicTransmonElements.

This edge implements a square flux pulse and two virtual z phase corrections for the CZ operation between the two BasicTransmonElements.

generate_edge_config() dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]][source]#

Generate valid device config.

Fills in the edges information to produce a valid device config for the quantify-scheduler making use of the compile_circuit_to_device_with_config_validation() function.

class QuantumDevice(name: str)[source]#

Bases: quantify_scheduler.json_utils.JSONSerializableMixin, qcodes.instrument.base.Instrument

The QuantumDevice directly represents the device under test (DUT).

This contains a description of the connectivity to the control hardware as well as parameters specifying quantities like cross talk, attenuation and calibrated cable-delays. The QuantumDevice also contains references to individual DeviceElements, representations of elements on a device (e.g, a transmon qubit) containing the (calibrated) control-pulse parameters.

This object can be used to generate configuration files for the compilation step from the gate-level to the pulse level description. These configuration files should be compatible with the compile() function.

elements#
edges#
instr_measurement_control#
instr_instrument_coordinator#
cfg_sched_repetitions#
keep_original_schedule#
hardware_config: quantify_scheduler.device_under_test.hardware_config.HardwareConfig#

The input dictionary used to generate a valid HardwareCompilationConfig using generate_hardware_compilation_config(). This configures the compilation from the quantum-device layer to the control-hardware layer.

Useful methods to write and reload the configuration from a json file are load_from_json_file() and write_to_json_file().

scheduling_strategy#
_instrument_references#
to_json() str[source]#

Convert the QuantumDevice data structure to a JSON string. Overrides the base mixin method to perform additional checks.

Returns:

The json string containing the serialized QuantumDevice.

generate_compilation_config() quantify_scheduler.backends.graph_compilation.SerialCompilationConfig[source]#

Generate a config for use with a QuantifyCompiler.

generate_hardware_config() dict[str, Any][source]#

Generate a valid hardware configuration describing the quantum device.

Returns:

  • The hardware configuration file used for compiling from the quantum-device layer to a hardware backend.

  • .. warning – The config currently has to be specified by the user using the hardware_config parameter.

generate_device_config() quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig[source]#

Generate a device config.

This config is used to compile from the quantum-circuit to the quantum-device layer.

generate_hardware_compilation_config() quantify_scheduler.backends.types.common.HardwareCompilationConfig | None[source]#

Generate a hardware compilation config.

The compilation config is used to compile from the quantum-device to the control-hardware layer.

get_element(name: str) quantify_scheduler.device_under_test.device_element.DeviceElement[source]#

Return a DeviceElement by name.

Parameters:

name – The element name.

Returns:

The element.

Raises:

KeyError – If key name is not present in self.elements.

add_element(element: quantify_scheduler.device_under_test.device_element.DeviceElement) None[source]#

Add an element to the elements collection.

Parameters:

element – The element to add.

Raises:
  • ValueError – If a element with a duplicated name is added to the collection.

  • TypeError – If element is not an instance of the base element.

remove_element(name: str) None[source]#

Removes an element by name.

Parameters:

name – The element name.

get_edge(name: str) qcodes.instrument.base.Instrument[source]#

Returns an edge by name.

Parameters:

name – The edge name.

Returns:

The edge.

Raises:

KeyError – If key name is not present in self.edges.

add_edge(edge: quantify_scheduler.device_under_test.edge.Edge) None[source]#

Add the edges.

Parameters:

edge – The edge name connecting the elements. Has to follow the convention ‘element_0’-‘element_1’

remove_edge(edge_name: str) None[source]#

Remove an edge by name.

Parameters:

edge_name – The edge name.

class ScheduleGettable(quantum_device: quantify_scheduler.device_under_test.quantum_device.QuantumDevice, schedule_function: Callable[Ellipsis, quantify_scheduler.schedules.schedule.Schedule], schedule_kwargs: dict[str, Any], num_channels: int = 1, data_labels: list[str] | None = None, real_imag: bool = True, batched: bool = False, max_batch_size: int = 1024, always_initialize: bool = True, return_xarray: bool = False)[source]#

Generic gettable for a quantify schedule using vector (I,Q) acquisition.

The gettable evaluates the parameters passed as schedule_kwargs, then generates the quantify_scheduler.schedules.schedule.Schedule using the schedule_function, this is then compiled and finally executed by the InstrumentCoordinator.

ScheduleGettable can be set to return either static (demodulated) I and Q values or magnitude and phase.

Parameters:
  • quantum_device – The qcodes instrument representing the quantum device under test (DUT) containing quantum device properties and setup configuration information.

  • schedule_function – A function which returns a quantify_scheduler.schedules.schedule.Schedule. The function is required to have the repetitions keyword argument.

  • schedule_kwargs – The schedule function keyword arguments, when a value in this dictionary is a Parameter, this parameter will be evaluated every time .get() is called before being passed to the schedule_function.

  • num_channels – The number of channels to expect in the acquisition data.

  • data_labels – Allows to specify custom labels. Needs to be precisely 2*num_channels if specified. The order is [Voltage I 0, Voltage Q 0, Voltage I 1, Voltage Q 1, …], in case real_imag==True, otherwise [Magnitude 0, Phase 0, Magnitude 1, Phase 1, …].

  • real_imag – If true, the gettable returns I, Q values. Otherwise, magnitude and phase (degrees) are returned.

  • batched – Used to indicate if the experiment is performed in batches or in an iterative fashion.

  • max_batch_size – Determines the maximum number of points to acquire when acquiring in batched mode. Can be used to split up a program in parts if required due to hardware constraints.

  • always_initialize – If True, then reinitialize the schedule on each invocation of get. If False, then only initialize the first invocation of get.

_data_labels_specified#
always_initialize#
is_initialized = False#
_compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule | None = None#
real_imag#
batched#
batch_size#
_return_xarray#
schedule_function#
schedule_kwargs#
_evaluated_sched_kwargs#
quantum_device#
_backend = None#
_debug_mode: bool = False#
_compile(sched: quantify_scheduler.schedules.schedule.Schedule) None[source]#

Compile schedule, separated to allow for profiling compilation duration.

initialize() None[source]#

Generates the schedule and uploads the compiled instructions to the hardware using the instrument coordinator.

property compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule | None#

Return the schedule used in this class.

get() tuple[numpy.ndarray, Ellipsis][source]#

Start the experimental sequence and retrieve acquisition data.

The data format returned is dependent on the type of acquisitions used in the schedule. These data formats can be found in the user guide.

Returns:

A tuple of acquisition data per acquisition channel as specified above.

initialize_and_get_with_report() str[source]#

Create a report that saves all information from this experiment in a zipfile.

Run initialize() and get() and capture all information from the experiment in a zipfile in the quantify datadir. The basic information in the report includes the schedule, device config and hardware config. The method attempts to compile the schedule, and if it succeeds, it runs the experiment and adds the compiled schedule, a snapshot of the instruments, and logs from the actual hardware (only Qblox instruments supported currently) to the zipfile. A full error trace is also included if any of these steps fail.

Returns:

A path to the generated report. Directory name includes a flag indicating at which state the experiment and report retrieval stopped.

Flags (defined in :func: ~._generate_diagnostics_report):

  • failed_initialization: The experiment failed during initialize().

  • failed_exp: The experiment initialized failed during get().

  • failed_connection_to_hw: The experiment initialized but both get() and retrieve_hardware_logs() failed. Connection to hardware was likely interrupted during runtime.

  • failed_hw_log_retrieval: The experiment succeeded but retrieve_hardware_logs() failed.

  • completed_exp: The experiment succeeded.

class MockLocalOscillator(name: str)[source]#

Bases: qcodes.instrument.instrument.Instrument

A class representing a dummy Local Oscillator.

Parameters:

name – QCoDeS name of the intstrument.

_add_qcodes_parameters_dummy() None[source]#

Use to fake communications.

class InstrumentCoordinator(name: str, add_default_generic_icc: bool = True)[source]#

Bases: qcodes.instrument.base.Instrument

The InstrumentCoordinator serves as the central interface of the hardware abstraction layer.

It provides a standardized interface to execute Schedules on control hardware.

The InstrumentCoordinator has two main functionalities exposed to the user, the ability to configure its components representing physical instruments, and the ability to execute experiments.

Parameters:
  • name – The name for the instrument coordinator instance.

  • add_default_generic_icc – If True, automatically adds a GenericInstrumentCoordinatorComponent to this instrument coordinator with the default name.

components#
timeout#
_last_schedule = None#
_compiled_schedule = None#
property last_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule#

Returns the last schedule used to prepare the instrument coordinator.

This feature is intended to aid users in debugging.

property is_running: bool#

Returns if any of the InstrumentCoordinator components is running.

Returns:

The InstrumentCoordinator’s running state.

get_component(full_name: str) quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase[source]#

Returns the InstrumentCoordinator component by name.

Parameters:

full_name – The component name.

Returns:

The component.

Raises:

KeyError – If key name is not present in self.components.

add_component(component: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase) None[source]#

Adds a component to the components collection.

Parameters:

component – The component to add.

Raises:
  • ValueError – If a component with a duplicated name is added to the collection.

  • TypeError – If component is not an instance of the base component.

remove_component(name: str) None[source]#

Removes a component by name.

Parameters:

name – The component name.

prepare(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) None[source]#

Prepares each component for execution of a schedule.

It attempts to configure all instrument coordinator components for which compiled instructions, typically consisting of a combination of sequence programs, waveforms and other instrument settings, are available in the compiled schedule.

Parameters:

compiled_schedule – A schedule containing the information required to execute the program.

Raises:
  • KeyError – If the compiled schedule contains instructions for a component absent in the instrument coordinator.

  • TypeError – If the schedule provided is not a valid CompiledSchedule.

start() None[source]#

Start all of the components that appear in the compiled instructions.

The instruments will be started in the order in which they were added to the instrument coordinator.

stop(allow_failure: bool = False) None[source]#

Stops all components.

The components are stopped in the order in which they were added.

Parameters:

allow_failure – By default it is set to False. When set to True, the AttributeErrors raised by a component are demoted to warnings to allow other components to stop.

retrieve_acquisition() xarray.Dataset[source]#

Retrieves the latest acquisition results of the components with acquisition capabilities.

Returns:

The acquisition data in an xarray.Dataset. For each acquisition channel it contains an xarray.DataArray.

wait_done(timeout_sec: int = 10) None[source]#

Awaits each component until it is done.

The timeout in seconds specifies the allowed amount of time to run before it times out.

Parameters:

timeout_sec – The maximum amount of time in seconds before a timeout.

retrieve_hardware_logs() dict[str, dict][source]#

Return the hardware logs of the instruments of each component.

The instruments must be referenced in the CompiledSchedule.

Returns:

A nested dict containing the components hardware logs

class GenericInstrumentCoordinatorComponent(instrument_reference: str | qcodes.instrument.base.InstrumentBase = DEFAULT_NAME)[source]#

Bases: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase

A Generic class which can be used for interaction with the InstrumentCoordinator.

The GenericInstrumentCoordinatorComponent should be able to accept any type of qcodes instrument. The component is meant to serve as an interface for simple access to instruments such as the local oscillator, or current source which needs to only set parameters. For now this component is not being used in any of the hardware backends’ compilation step. This will be fixed in the next official release.

_no_gc_instances: dict[str, quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase]#
property is_running: bool#

A state whether an instrument is capable of running in a program.

Not to be confused with the on/off state of an instrument.

start() None[source]#

Start the instrument.

stop() None[source]#

Stop the instrument.

prepare(params_config: dict[str, Any]) None[source]#

Prepare the instrument.

params_config has keys which should correspond to parameter names of the instrument and the corresponding values to be set. Always ensure that the key to the params_config is in the format ‘instrument_name.parameter_name’ See example below.

params_config = {
                 "lo_mw_q0.frequency": 6e9,
                 "lo_mw_q0.power": 13, "lo_mw_q0.status": True,
                 "lo_ro_q0.frequency": 8.3e9, "lo_ro_q0.power": 16,
                 "lo_ro_q0.status": True,
                 "lo_spec_q0.status": False,
                }
_set_params_to_devices(params_config: dict) None[source]#

Set the parameters in the params_config dict to the generic devices set in the hardware_config.

The bool force_set_parameters is used to change the lazy_set behavior.

retrieve_acquisition() xarray.Dataset | None[source]#

Retrieve acquisition.

get_hardware_log(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) dict | None[source]#

Get the hardware log.

wait_done(timeout_sec: int = 10) None[source]#

Wait till done.

class Operation(name: str)[source]#

Bases: quantify_scheduler.json_utils.JSONSchemaValMixin, collections.UserDict

A representation of quantum circuit operations.

The Operation class is a JSON-compatible data structure that contains information on how to represent the operation on the quantum-circuit and/or the quantum-device layer. It also contains information on where the operation should be applied: the Resource s used.

An operation always has the following attributes:

  • duration (float): duration of the operation in seconds (can be 0).

  • hash (str): an auto generated unique identifier.

  • name (str): a readable identifier, does not have to be unique.

An Operation can contain information on several levels of abstraction. This information is used when different representations are required. Note that when initializing an operation not all of this information needs to be available as operations are typically modified during the compilation steps.

Tip

quantify_scheduler comes with a gate_library and a pulse_library , both containing common operations.

JSON schema of a valid Operation

JSON schema for a quantify sequencer operation.

type

object

properties

  • name

type

string

  • gate_info

type

object

properties

  • unitary

A unitary matrix describing the operation.

  • operation_type

Defines what class of operations this gate refers to (e.g. Rxy, CZ etc.).

type

string

  • qubits

A list of strings indicating the qubits the gate acts on. Valid qubits are strings that appear in the device_config.json file.

type

array

  • symmetric

A boolean to indicate whether a two qubit gate is symmetric. This is used in the device config compilation stage. By default, it is set as False

type

boolean

  • tex

latex snippet for plotting

type

string

  • plot_func

reference to a function for plotting this operation. If not specified, defaults to using gate_box().

type

string / null

additionalProperties

True

  • pulse_info

A list containing the pulses that are part of the operation

type

array

items

Info to generate an individual pulse.

type

object

properties

  • port

A string specifying the port used by the pulse.

type

string / null

  • clock

A string specifying the clock used to modulate the pulse.

type

string

  • wf_func

reference to a function to generate the pulse of this operation.

type

string / null

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the pulse in seconds.

type

number

  • acquisition_info

A list containing the acquisitions that are part of the operation

type

array

items

Info to generate an individual acquisition.

type

object

properties

  • port

A string specifying the port used by the acquisition.

type

string

  • clock

A string specifying the clock used to demodulate the acquisition.

type

string

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the acquisition in seconds.

type

number

  • acq_channel

The acquisition channel to use.

type

number

  • acq_index

The acquisition index where to store the result of the acquisition protocol.

type

number

  • acq_return_type

Describes the return type of an acquisition performed using this protocol.

additionalProperties

True

  • logic_info

Not Implemented.

additionalProperties

False

Note

Two different Operations containing the same information generate the same hash and are considered identical.

schema_filename = 'operation.json'#
_class_signature = None#
_duration: float = 0#
_update() None[source]#

Update the Operation’s internals.

property name: str#

Return the name of the operation.

property duration: float#

Determine operation duration from pulse_info.

If the operation contains no pulse info, it is assumed to be ideal and have zero duration.

property hash: str#

A hash based on the contents of the Operation.

Needs to be a str for easy compatibility with json.

classmethod _get_signature(parameters: dict) str[source]#

Returns the constructor call signature of this instance for serialization.

The string constructor representation can be used to recreate the object using eval(signature).

Parameters:

parameters (dict) – The current data dictionary.

add_gate_info(gate_operation: Operation) None[source]#

Updates self.data[‘gate_info’] with contents of gate_operation.

Parameters:

gate_operation – an operation containing gate_info.

add_device_representation(device_operation: Operation) None[source]#

Adds device-level representation details to the current operation.

Parameters:

device_operation – an operation containing the pulse_info and/or acquisition info describing how to represent the current operation at the quantum-device layer.

add_pulse(pulse_operation: Operation) None[source]#

Adds pulse_info of pulse_operation Operation to this Operation.

Parameters:

pulse_operation – an operation containing pulse_info.

add_acquisition(acquisition_operation: Operation) None[source]#

Adds acquisition_info of acquisition_operation Operation to this Operation.

Parameters:

acquisition_operation – an operation containing acquisition_info.

classmethod is_valid(object_to_be_validated: Operation) bool[source]#

Validates the object’s contents against the schema.

Additionally checks if the hash property of the object evaluates correctly.

property valid_gate: bool#

An operation is a valid gate if it has gate-level representation details.

property valid_pulse: bool#

An operation is a valid pulse if it has pulse-level representation details.

property valid_acquisition: bool#

An operation is a valid acquisition if it has pulse-level acquisition representation details.

property is_conditional_acquisition: bool#

An operation is conditional if one of the following holds, self is an an acquisition with a feedback_trigger_label assigned to it.

property is_control_flow: bool#

Determine if operation is a control flow operation.

Returns:

Whether the operation is a control flow operation.

Return type:

bool

property has_voltage_offset: bool#

Checks if the operation contains information for a voltage offset.

class BasebandClockResource(name: str)[source]#

Bases: Resource

Global identity for a virtual baseband clock.

Baseband signals are assumed to be real-valued and will not be modulated.

Parameters:

name – the name of this clock

IDENTITY = 'cl0.baseband'#
data#
class ClockResource(name: str, freq: float, phase: float = 0)[source]#

Bases: Resource

The ClockResource corresponds to a physical clock used to modulate pulses.

Parameters:
  • name – the name of this clock

  • freq – the frequency of the clock in Hz

  • phase – the starting phase of the clock in deg

data#
class DigitalClockResource(name: str)[source]#

Bases: Resource

Global identity for a virtual digital clock.

Digital clocks can only be associated with digital channels.

Parameters:

name – the name of this clock

IDENTITY = 'digital'#
data#
class Resource(name: str)[source]#

Bases: collections.UserDict

A resource corresponds to a physical resource such as a port or a clock.

Parameters:

name – The resource name.

property name: str#

Returns the name of the Resource.

property hash: str#

A hash based on the contents of the Operation.

class Schedule(name: str, repetitions: int = 1, data: dict = None)[source]#

Bases: ScheduleBase

A modifiable schedule.

Operations quantify_scheduler.operations.operation.Operation can be added using the add() method, allowing precise specification when to perform an operation using timing constraints.

When adding an operation, it is not required to specify how to represent this quantify_scheduler.operations.operation.Operation on all layers. Instead, this information can be added later during compilation. This allows the user to effortlessly mix the gate- and pulse-level descriptions as required for many (calibration) experiments.

Parameters:
  • name – The name of the schedule

  • repetitions – The amount of times the schedule will be repeated, by default 1

  • data – A dictionary containing a pre-existing schedule, by default None

schema_filename = 'schedule.json'#
add_resources(resources_list: list) None[source]#

Add wrapper for adding multiple resources.

add_resource(resource: quantify_scheduler.resources.Resource) None[source]#

Add a resource such as a channel or qubit to the schedule.

add(operation: quantify_scheduler.operations.operation.Operation | Schedule, rel_time: float = 0, ref_op: Schedulable | str | None = None, ref_pt: Literal['start', 'center', 'end'] | None = None, ref_pt_new: Literal['start', 'center', 'end'] | None = None, label: str | None = None, control_flow: quantify_scheduler.operations.control_flow_library.ControlFlowSpec | None = None) Schedulable[source]#

Add an operation or a subschedule to the schedule.

Parameters:
  • operation – The operation to add to the schedule, or another schedule to add as a subschedule.

  • rel_time – relative time between the reference operation and the added operation. the time is the time between the “ref_pt” in the reference operation and “ref_pt_new” of the operation that is added.

  • ref_op – reference schedulable. If set to None, will default to the last added operation.

  • ref_pt – reference point in reference operation must be one of "start", "center", "end", or None; in case of None, _determine_absolute_timing() assumes "end".

  • ref_pt_new – reference point in added operation must be one of "start", "center", "end", or None; in case of None, _determine_absolute_timing() assumes "start".

  • label – a unique string that can be used as an identifier when adding operations. if set to None, a random hash will be generated instead.

  • control_flow – Virtual operation describing if the operation should be subject to control flow (loop, conditional, …). See control flow reference documentation for a detailed explanation.

Returns:

Returns the schedulable created in the schedule.

_add(operation: quantify_scheduler.operations.operation.Operation | Schedule, rel_time: float = 0, ref_op: Schedulable | str | None = None, ref_pt: Literal['start', 'center', 'end'] | None = None, ref_pt_new: Literal['start', 'center', 'end'] | None = None, label: str | None = None) Schedulable[source]#
_validate_add_arguments(operation: quantify_scheduler.operations.operation.Operation | Schedule, label: str, control_flow: quantify_scheduler.operations.operation.Operation | None) None[source]#