quantify_scheduler#
Import alias |
Target |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subpackages#
- backends
- mock
- qblox
- operation_handling
- operations
- analog
- compiler_abc
- compiler_container
- conditional
- constants
- crosstalk_compensation
- driver_version_check
- enums
- exceptions
- hardware_config_nv_center_old_style
- hardware_config_transmon_old_style
- helpers
- instrument_compilers
- q1asm_instructions
- qasm_program
- register_manager
- stack_pulses
- timetag
- types
- zhinst
- circuit_to_device
- corrections
- graph_compilation
- qblox_backend
- zhinst_backend
- device_under_test
- helpers
- instrument_coordinator
- operations
- qblox
- schedules
- schemas
- structure
Submodules#
Package Contents#
Classes#
A compiler that executes compilation passes sequentially. |
|
A device element representing an electronic qubit in an NV center. |
|
A device element representing a Loss–DiVincenzo Spin qubit. |
|
A device element representing a single fixed-frequency transmon qubit. |
|
An example Edge implementation which connects two BasicTransmonElements. |
|
The QuantumDevice directly represents the device under test (DUT). |
|
Generic gettable for a quantify schedule using vector (I,Q) acquisition. |
|
A class representing a dummy Local Oscillator. |
|
The |
|
A Generic class which can be used for interaction with the InstrumentCoordinator. |
|
A representation of quantum circuit operations. |
|
Global identity for a virtual baseband clock. |
|
The ClockResource corresponds to a physical clock used to modulate pulses. |
|
Global identity for a virtual digital clock. |
|
A resource corresponds to a physical resource such as a port or a clock. |
|
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
.
- clock_freqs: ClockFrequencies#
Submodule
ClockFrequencies
.
- reset: ResetSpinpump#
Submodule
ResetSpinpump
.
- charge_reset: ChargeReset#
Submodule
ChargeReset
.
- pulse_compensation: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule#
Submodule
PulseCompensationModule
.
- 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.
- rxy: RxyGaussian#
Submodule
RxyGaussian
.
- measure: DispersiveMeasurementSpin#
Submodule
DispersiveMeasurementSpin
.
- pulse_compensation: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule#
Submodule
PulseCompensationModule
.
- 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
.
- measure: DispersiveMeasurement#
Submodule
DispersiveMeasurement
.
- pulse_compensation: PulseCompensationModule#
Submodule
PulseCompensationModule
.
- 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()
andwrite_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 inself.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’
- 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 thequantify_scheduler.schedules.schedule.Schedule
using theschedule_function
, this is then compiled and finally executed by theInstrumentCoordinator
.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 therepetitions
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 theschedule_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 ofget
.
- _data_labels_specified#
- always_initialize = True#
- is_initialized = False#
- _compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule | None = None#
- real_imag = True#
- batched = False#
- batch_size = 1024#
- _return_xarray = False#
- schedule_function#
- schedule_kwargs#
- _evaluated_sched_kwargs#
- quantum_device#
- _backend = None#
- _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()
andget()
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 duringinitialize()
.failed_exp
: The experiment initialized failed duringget()
.failed_connection_to_hw
: The experiment initialized but bothget()
andretrieve_hardware_logs()
failed. Connection to hardware was likely interrupted during runtime.failed_hw_log_retrieval
: The experiment succeeded butretrieve_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.
- 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 itscomponents
representing physical instruments, and the ability to execute experiments.Executing a schedule using the instrument coordinator
To execute a
Schedule
, one needs to first compile a schedule and then configure all the instrument coordinator components usingprepare()
. After starting the experiment, the results can be retrieved usingretrieve_acquisition()
.from quantify_scheduler.backends.graph_compilation import SerialCompiler my_sched: Schedule = ... # a Schedule describing the experiment to perform quantum_device: QuantumDevice = ... # the device under test hardware_config: dict = ... # a config file describing the connection to the hardware quantum_device.hardware_config(hardware_config) compiler = SerialCompiler(name="compiler") compiled_sched = compiler.compile( schedule=sched, config=quantum_device.generate_compilation_config() ) instrument_coordinator.prepare(compiled_sched) instrument_coordinator.start() dataset = instrument_coordinator.retrieve_acquisition()
Adding components to the instrument coordinator
In order to distribute compiled instructions and execute an experiment, the instrument coordinator needs to have references to the individual instrument coordinator components. They can be added using
add_component()
.instrument_coordinator.add_component(qcm_component)
- 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 inself.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 anxarray.DataArray
.
- 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.
- 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.
- 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: theResource
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 agate_library
and apulse_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#
- 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.
- get_used_port_clocks() set[tuple[str, str]] [source]#
Extracts which port-clock combinations are used in this operation.
- Returns:
All (port, clock) combinations this operation uses.
- 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 afeedback_trigger_label
assigned to it.
- 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.
- 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 theadd()
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_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"
, orNone
; in case ofNone
,_determine_absolute_timing()
assumes"end"
.ref_pt_new – reference point in added operation must be one of
"start"
,"center"
,"end"
, orNone
; in case ofNone
,_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]#