quantify_scheduler ================== .. py:module:: quantify_scheduler .. autoapi-nested-parse:: .. list-table:: :header-rows: 1 :widths: auto * - Import alias - Target * - :class:`.QuantumDevice` - :class:`!quantify_scheduler.QuantumDevice` * - :class:`.Schedule` - :class:`!quantify_scheduler.Schedule` * - :class:`.Resource` - :class:`!quantify_scheduler.Resource` * - :class:`.ClockResource` - :class:`!quantify_scheduler.ClockResource` * - :class:`.BasebandClockResource` - :class:`!quantify_scheduler.BasebandClockResource` * - :class:`.DigitalClockResource` - :class:`!quantify_scheduler.DigitalClockResource` * - :class:`.Operation` - :class:`!quantify_scheduler.Operation` * - :obj:`.structure` - :obj:`!quantify_scheduler.structure` * - :class:`.ScheduleGettable` - :class:`!quantify_scheduler.ScheduleGettable` * - :class:`.BasicElectronicNVElement` - :class:`!quantify_scheduler.BasicElectronicNVElement` * - :class:`.BasicSpinElement` - :class:`!quantify_scheduler.BasicSpinElement` * - :class:`.BasicTransmonElement` - :class:`!quantify_scheduler.BasicTransmonElement` * - :class:`.CompositeSquareEdge` - :class:`!quantify_scheduler.CompositeSquareEdge` * - :class:`.InstrumentCoordinator` - :class:`!quantify_scheduler.InstrumentCoordinator` * - :class:`.GenericInstrumentCoordinatorComponent` - :class:`!quantify_scheduler.GenericInstrumentCoordinatorComponent` * - :class:`.SerialCompiler` - :class:`!quantify_scheduler.SerialCompiler` * - :class:`.MockLocalOscillator` - :class:`!quantify_scheduler.MockLocalOscillator` Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 backends/index.rst device_under_test/index.rst helpers/index.rst instrument_coordinator/index.rst operations/index.rst qblox/index.rst schedules/index.rst schemas/index.rst structure/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 _static_version/index.rst _version/index.rst compatibility_check/index.rst compilation/index.rst enums/index.rst gettables/index.rst gettables_profiled/index.rst json_utils/index.rst math/index.rst pulse_compensation/index.rst resources/index.rst waveforms/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.SerialCompiler quantify_scheduler.BasicElectronicNVElement quantify_scheduler.BasicSpinElement quantify_scheduler.BasicTransmonElement quantify_scheduler.CompositeSquareEdge quantify_scheduler.QuantumDevice quantify_scheduler.ScheduleGettable quantify_scheduler.MockLocalOscillator quantify_scheduler.InstrumentCoordinator quantify_scheduler.GenericInstrumentCoordinatorComponent quantify_scheduler.Operation quantify_scheduler.BasebandClockResource quantify_scheduler.ClockResource quantify_scheduler.DigitalClockResource quantify_scheduler.Resource quantify_scheduler.Schedule .. py:class:: SerialCompiler(name: str, quantum_device: quantify_scheduler.device_under_test.quantum_device.QuantumDevice | None = None) Bases: :py:obj:`QuantifyCompiler` A compiler that executes compilation passes sequentially. .. py:method:: construct_graph(config: SerialCompilationConfig) -> None Construct the compilation graph based on a provided config. For a serial backend, it is just a list of compilation passes. .. py:method:: _compilation_func(schedule: quantify_scheduler.schedules.schedule.Schedule, config: SerialCompilationConfig) -> quantify_scheduler.schedules.schedule.CompiledSchedule Compile a schedule using the backend and the information provided in the config. :param schedule: The schedule to compile. :param 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. .. py:class:: BasicElectronicNVElement(name: str, **kwargs) Bases: :py:obj:`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. .. py:attribute:: submodules_to_add .. py:attribute:: submodule_data .. py:attribute:: spectroscopy_operation :type: SpectroscopyOperationHermiteMW Submodule :class:`~.SpectroscopyOperationHermiteMW`. .. py:attribute:: ports :type: Ports Submodule :class:`~.Ports`. .. py:attribute:: clock_freqs :type: ClockFrequencies Submodule :class:`~.ClockFrequencies`. .. py:attribute:: reset :type: ResetSpinpump Submodule :class:`~.ResetSpinpump`. .. py:attribute:: charge_reset :type: ChargeReset Submodule :class:`~.ChargeReset`. .. py:attribute:: measure :type: Measure Submodule :class:`~.Measure`. .. py:attribute:: pulse_compensation :type: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule Submodule :class:`~.PulseCompensationModule`. .. py:attribute:: cr_count :type: CRCount Submodule :class:`~.CRCount`. .. py:attribute:: rxy :type: RxyHermite Submodule :class:`~.Rxy`. .. py:method:: _generate_config() -> dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]] 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. .. py:method:: generate_device_config() -> quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig Generate a valid device config for the quantify-scheduler. This makes use of the :func:`~.circuit_to_device.compile_circuit_to_device_with_config_validation` function. This enables the settings of this qubit to be used in isolation. .. note: This config is only valid for single qubit experiments. .. py:class:: BasicSpinElement(name: str, **kwargs: Any) Bases: :py:obj:`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 particule is coupled to a resonator. :param name: The name of the spin element. :param 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. .. py:attribute:: submodules_to_add .. py:attribute:: submodule_data .. py:attribute:: reset :type: quantify_scheduler.device_under_test.transmon_element.IdlingReset Submodule :class:`~.IdlingReset`. .. py:attribute:: rxy :type: RxyGaussian Submodule :class:`~.RxyGaussian`. .. py:attribute:: measure :type: DispersiveMeasurementSpin Submodule :class:`~.DispersiveMeasurementSpin`. .. py:attribute:: pulse_compensation :type: quantify_scheduler.device_under_test.transmon_element.PulseCompensationModule Submodule :class:`~.PulseCompensationModule`. .. py:attribute:: ports :type: PortsSpin Submodule :class:`~.PortsSpin`. .. py:attribute:: clock_freqs :type: ClocksFrequenciesSpin Submodule :class:`~.ClocksFrequenciesSpin`. .. py:method:: _generate_config() -> dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]] 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. .. py:method:: generate_device_config() -> quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig Generate a valid device config. The config will be used for the quantify-scheduler making use of the :func:`~.circuit_to_device.compile_circuit_to_device_with_config_validation` function. This enables the settings of this qubit to be used in isolation. .. note: This config is only valid for single qubit experiments. .. py:class:: BasicTransmonElement(name: str, **kwargs) Bases: :py:obj:`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. :param name: The name of the transmon element. :param 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. .. py:attribute:: submodules_to_add .. py:attribute:: submodule_data .. py:attribute:: reset :type: IdlingReset Submodule :class:`~.IdlingReset`. .. py:attribute:: rxy :type: RxyDRAG Submodule :class:`~.RxyDRAG`. .. py:attribute:: measure :type: DispersiveMeasurement Submodule :class:`~.DispersiveMeasurement`. .. py:attribute:: pulse_compensation :type: PulseCompensationModule Submodule :class:`~.PulseCompensationModule`. .. py:attribute:: ports :type: Ports Submodule :class:`~.Ports`. .. py:attribute:: clock_freqs :type: ClocksFrequencies Submodule :class:`~.ClocksFrequencies`. .. py:method:: _generate_config() -> dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]] 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. .. py:method:: generate_device_config() -> quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig Generate a valid device config. The config will be used for the quantify-scheduler making use of the :func:`~.circuit_to_device.compile_circuit_to_device_with_config_validation` function. This enables the settings of this qubit to be used in isolation. .. note: This config is only valid for single qubit experiments. .. py:class:: CompositeSquareEdge(parent_element_name: str, child_element_name: str, **kwargs) Bases: :py:obj:`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. .. py:attribute:: cz_data .. py:method:: generate_edge_config() -> dict[str, dict[str, quantify_scheduler.backends.graph_compilation.OperationCompilationConfig]] Generate valid device config. Fills in the edges information to produce a valid device config for the quantify-scheduler making use of the :func:`~.circuit_to_device.compile_circuit_to_device_with_config_validation` function. .. py:class:: QuantumDevice(name: str) Bases: :py:obj:`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 :meth:`~quantify_scheduler.backends.graph_compilation.QuantifyCompiler.compile` function. .. py:attribute:: elements .. py:attribute:: edges .. py:attribute:: instr_measurement_control .. py:attribute:: instr_instrument_coordinator .. py:attribute:: cfg_sched_repetitions .. py:attribute:: keep_original_schedule .. py:attribute:: hardware_config .. py:attribute:: scheduling_strategy .. py:attribute:: _instrument_references .. py:method:: to_json() -> str Convert the :class:`~QuantumDevice` data structure to a JSON string. :returns: The json string containing the serialized `QuantumDevice`. .. py:method:: to_json_file(path: str | None = None, add_timestamp: bool = True) -> str Convert the `QuantumDevice` data structure to a JSON string and store it in a file. :param path: The path to the directory where the file is created. :param add_timestamp: Specify whether or not to append timestamp to the filename. Default is True. :returns: The name of the file containing the serialized `QuantumDevice`. .. py:method:: from_json(data: str) -> QuantumDevice :classmethod: Convert the JSON data to a `QuantumDevice`. :param data: The JSON data in str format. :returns: The deserialized :class:`~QuantumDevice` object. .. py:method:: from_json_file(filename: str) -> QuantumDevice :classmethod: Read JSON data from a file and convert it to a `QuantumDevice`. :param filename: The name of the file containing the serialized `QuantumDevice`. :returns: The deserialized :class:`~QuantumDevice` object. .. py:method:: generate_compilation_config() -> quantify_scheduler.backends.graph_compilation.SerialCompilationConfig Generate a config for use with a :class:`~.graph_compilation.QuantifyCompiler`. .. py:method:: generate_hardware_config() -> dict[str, Any] 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 :code:`hardware_config` parameter. .. py:method:: generate_device_config() -> quantify_scheduler.backends.graph_compilation.DeviceCompilationConfig Generate a device config. This config is used to compile from the quantum-circuit to the quantum-device layer. .. py:method:: generate_hardware_compilation_config() -> quantify_scheduler.backends.types.common.HardwareCompilationConfig | None Generate a hardware compilation config. The compilation config is used to compile from the quantum-device to the control-hardware layer. .. py:method:: get_element(name: str) -> quantify_scheduler.device_under_test.device_element.DeviceElement Return a :class:`~quantify_scheduler.device_under_test.device_element.DeviceElement` by name. :param name: The element name. :returns: The element. :raises KeyError: If key ``name`` is not present in `self.elements`. .. py:method:: add_element(element: quantify_scheduler.device_under_test.device_element.DeviceElement) -> None Add an element to the elements collection. :param element: The element to add. :raises ValueError: If a element with a duplicated name is added to the collection. :raises TypeError: If :code:`element` is not an instance of the base element. .. py:method:: remove_element(name: str) -> None Removes an element by name. :param name: The element name. .. py:method:: get_edge(name: str) -> qcodes.instrument.base.Instrument Returns an edge by name. :param name: The edge name. :returns: The edge. :raises KeyError: If key ``name`` is not present in ``self.edges``. .. py:method:: add_edge(edge: quantify_scheduler.device_under_test.edge.Edge) -> None Add the edges. :param edge: The edge name connecting the elements. Has to follow the convention 'element_0'-'element_1' .. py:method:: remove_edge(edge_name: str) -> None Remove an edge by name. :param edge_name: The edge name. .. py: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) Generic gettable for a quantify schedule using vector (I,Q) acquisition. The gettable evaluates the parameters passed as ``schedule_kwargs``, then generates the :class:`quantify_scheduler.schedules.schedule.Schedule` using the ``schedule_function``, this is then compiled and finally executed by the :class:`~.InstrumentCoordinator`. ``ScheduleGettable`` can be set to return either static (demodulated) I and Q values or magnitude and phase. :param quantum_device: The qcodes instrument representing the quantum device under test (DUT) containing quantum device properties and setup configuration information. :param schedule_function: A function which returns a :class:`quantify_scheduler.schedules.schedule.Schedule`. The function is required to have the ``repetitions`` keyword argument. :param schedule_kwargs: The schedule function keyword arguments, when a value in this dictionary is a :class:`~qcodes.instrument.parameter.Parameter`, this parameter will be evaluated every time :code:`.get()` is called before being passed to the :code:`schedule_function`. :param num_channels: The number of channels to expect in the acquisition data. :param 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, ...]. :param real_imag: If true, the gettable returns I, Q values. Otherwise, magnitude and phase (degrees) are returned. :param batched: Used to indicate if the experiment is performed in batches or in an iterative fashion. :param 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. :param always_initialize: If True, then reinitialize the schedule on each invocation of ``get``. If False, then only initialize the first invocation of ``get``. .. py:attribute:: _data_labels_specified .. py:attribute:: always_initialize .. py:attribute:: is_initialized :value: False .. py:attribute:: _compiled_schedule :type: quantify_scheduler.schedules.schedule.CompiledSchedule | None :value: None .. py:attribute:: real_imag .. py:attribute:: batched .. py:attribute:: batch_size .. py:attribute:: schedule_function .. py:attribute:: schedule_kwargs .. py:attribute:: _evaluated_sched_kwargs .. py:attribute:: quantum_device .. py:attribute:: _backend :value: None .. py:attribute:: _debug_mode :type: bool :value: False .. py:method:: _compile(sched: quantify_scheduler.schedules.schedule.Schedule) -> None Compile schedule, separated to allow for profiling compilation duration. .. py:method:: initialize() -> None Generates the schedule and uploads the compiled instructions to the hardware using the instrument coordinator. .. py:property:: compiled_schedule :type: quantify_scheduler.schedules.schedule.CompiledSchedule | None Return the schedule used in this class. .. py:method:: get() -> tuple[numpy.ndarray, Ellipsis] 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 :ref:`user guide `. :returns: A tuple of acquisition data per acquisition channel as specified above. .. py:method:: _reshape_data(acq_protocol: str, vals: numpy.typing.NDArray) -> list[numpy.typing.NDArray] .. py:method:: process_acquired_data(acquired_data: xarray.Dataset) -> tuple[numpy.typing.NDArray[numpy.float64], Ellipsis] Reshapes the data as returned from the instrument coordinator into the form accepted by the measurement control. :param acquired_data: Data that is returned by instrument coordinator. :returns: A tuple of data, casted to a historical conventions on data format. .. py:method:: initialize_and_get_with_report() -> str Create a report that saves all information from this experiment in a zipfile. Run :meth:`~.ScheduleGettable.initialize` and :meth:`~.ScheduleGettable.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 :meth:`~.ScheduleGettable.initialize`. - ``failed_exp``: The experiment initialized failed during :meth:`~.ScheduleGettable.get`. - ``failed_connection_to_hw``: The experiment initialized but both :meth:`~.ScheduleGettable.get` and :meth:`~.InstrumentCoordinator.retrieve_hardware_logs` failed. Connection to hardware was likely interrupted during runtime. - ``failed_hw_log_retrieval``: The experiment succeeded but :meth:`~.InstrumentCoordinator.retrieve_hardware_logs` failed. - ``completed_exp``: The experiment succeeded. .. py:class:: MockLocalOscillator(name: str) Bases: :py:obj:`qcodes.instrument.instrument.Instrument` A class representing a dummy Local Oscillator. :param name: QCoDeS name of the intstrument. .. py:method:: _add_qcodes_parameters_dummy() -> None Use to fake communications. .. py:class:: InstrumentCoordinator(name: str, add_default_generic_icc: bool = True) Bases: :py:obj:`qcodes.instrument.base.Instrument` The :class:`~.InstrumentCoordinator` serves as the central interface of the hardware abstraction layer. It provides a standardized interface to execute Schedules on control hardware. The :class:`~.InstrumentCoordinator` has two main functionalities exposed to the user, the ability to configure its :mod:`~.instrument_coordinator.components` representing physical instruments, and the ability to execute experiments. .. admonition:: Executing a schedule using the instrument coordinator :class: dropdown To execute a :class:`~.Schedule` , one needs to first compile a schedule and then configure all the instrument coordinator components using :meth:`~.InstrumentCoordinator.prepare`. After starting the experiment, the results can be retrieved using :meth:`~.InstrumentCoordinator.retrieve_acquisition`. .. code-block:: 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() .. admonition:: Adding components to the instrument coordinator :class: dropdown 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 :meth:`~.InstrumentCoordinator.add_component`. .. code-block:: instrument_coordinator.add_component(qcm_component) :param name: The name for the instrument coordinator instance. :param add_default_generic_icc: If True, automatically adds a GenericInstrumentCoordinatorComponent to this instrument coordinator with the default name. .. py:attribute:: components .. py:attribute:: timeout .. py:attribute:: _last_schedule :value: None .. py:attribute:: _compiled_schedule :value: None .. py:property:: last_schedule :type: quantify_scheduler.schedules.schedule.CompiledSchedule Returns the last schedule used to prepare the instrument coordinator. This feature is intended to aid users in debugging. .. py:property:: is_running :type: bool Returns if any of the :class:`.InstrumentCoordinator` components is running. :returns: The :class:`.InstrumentCoordinator`'s running state. .. py:method:: get_component(full_name: str) -> quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase Returns the InstrumentCoordinator component by name. :param full_name: The component name. :returns: The component. :raises KeyError: If key ``name`` is not present in ``self.components``. .. py:method:: add_component(component: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase) -> None Adds a component to the components collection. :param component: The component to add. :raises ValueError: If a component with a duplicated name is added to the collection. :raises TypeError: If :code:`component` is not an instance of the base component. .. py:method:: remove_component(name: str) -> None Removes a component by name. :param name: The component name. .. py:method:: prepare(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> None 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. :param 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. :raises TypeError: If the schedule provided is not a valid :class:`.CompiledSchedule`. .. py:method:: start() -> None 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. .. py:method:: stop(allow_failure: bool = False) -> None Stops all components. The components are stopped in the order in which they were added. :param 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. .. py:method:: retrieve_acquisition() -> xarray.Dataset Retrieves the latest acquisition results of the components with acquisition capabilities. :returns: The acquisition data in an :code:`xarray.Dataset`. For each acquisition channel it contains an :code:`xarray.DataArray`. .. py:method:: wait_done(timeout_sec: int = 10) -> None Awaits each component until it is done. The timeout in seconds specifies the allowed amount of time to run before it times out. :param timeout_sec: The maximum amount of time in seconds before a timeout. .. py:method:: retrieve_hardware_logs() -> dict[str, dict] Return the hardware logs of the instruments of each component. The instruments must be referenced in the :class:`.CompiledSchedule`. :returns: A nested dict containing the components hardware logs .. py:class:: GenericInstrumentCoordinatorComponent(instrument_reference: str | qcodes.instrument.base.InstrumentBase = DEFAULT_NAME) Bases: :py:obj:`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. .. py:attribute:: _no_gc_instances :type: dict[str, quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase] .. py:property:: is_running :type: 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. .. py:method:: start() -> None Start the instrument. .. py:method:: stop() -> None Stop the instrument. .. py:method:: prepare(params_config: dict[str, Any]) -> None 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. .. code-block:: python 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, } .. py:method:: _set_params_to_devices(params_config: dict) -> None 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. .. py:method:: retrieve_acquisition() -> xarray.Dataset | None Retrieve acquisition. .. py:method:: get_hardware_log(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> dict | None Get the hardware log. .. py:method:: wait_done(timeout_sec: int = 10) -> None Wait till done. .. py:class:: Operation(name: str) Bases: :py:obj:`quantify_scheduler.json_utils.JSONSchemaValMixin`, :py:obj:`collections.UserDict` A representation of quantum circuit operations. The :class:`~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 :class:`~quantify_scheduler.resources.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:: :mod:`quantify_scheduler` comes with a :mod:`~quantify_scheduler.operations.gate_library` and a :mod:`~quantify_scheduler.operations.pulse_library` , both containing common operations. **JSON schema of a valid Operation** .. jsonschema:: https://gitlab.com/quantify-os/quantify-scheduler/-/raw/main/quantify_scheduler/schemas/operation.json .. note:: Two different Operations containing the same information generate the same hash and are considered identical. .. py:attribute:: schema_filename :value: 'operation.json' .. py:attribute:: _class_signature :value: None .. py:attribute:: _duration :type: float :value: 0 .. py:method:: _update() -> None Update the Operation's internals. .. py:property:: name :type: str Return the name of the operation. .. py:property:: duration :type: float Determine operation duration from pulse_info. If the operation contains no pulse info, it is assumed to be ideal and have zero duration. .. py:property:: hash :type: str A hash based on the contents of the Operation. Needs to be a str for easy compatibility with json. .. py:method:: _get_signature(parameters: dict) -> str :classmethod: Returns the constructor call signature of this instance for serialization. The string constructor representation can be used to recreate the object using eval(signature). :param parameters: The current data dictionary. :type parameters: dict .. py:method:: add_gate_info(gate_operation: Operation) -> None Updates self.data['gate_info'] with contents of gate_operation. :param gate_operation: an operation containing gate_info. .. py:method:: add_device_representation(device_operation: Operation) -> None Adds device-level representation details to the current operation. :param device_operation: an operation containing the pulse_info and/or acquisition info describing how to represent the current operation at the quantum-device layer. .. py:method:: add_pulse(pulse_operation: Operation) -> None Adds pulse_info of pulse_operation Operation to this Operation. :param pulse_operation: an operation containing pulse_info. .. py:method:: add_acquisition(acquisition_operation: Operation) -> None Adds acquisition_info of acquisition_operation Operation to this Operation. :param acquisition_operation: an operation containing acquisition_info. .. py:method:: is_valid(object_to_be_validated: Operation) -> bool :classmethod: Validates the object's contents against the schema. Additionally checks if the hash property of the object evaluates correctly. .. py:property:: valid_gate :type: bool An operation is a valid gate if it has gate-level representation details. .. py:property:: valid_pulse :type: bool An operation is a valid pulse if it has pulse-level representation details. .. py:property:: valid_acquisition :type: bool An operation is a valid acquisition if it has pulse-level acquisition representation details. .. py:property:: is_conditional_acquisition :type: bool An operation is conditional if one of the following holds, ``self`` is an an acquisition with a ``feedback_trigger_label`` assigned to it. .. py:property:: is_control_flow :type: bool Determine if operation is a control flow operation. :returns: Whether the operation is a control flow operation. :rtype: bool .. py:property:: has_voltage_offset :type: bool Checks if the operation contains information for a voltage offset. .. py:class:: BasebandClockResource(name: str) Bases: :py:obj:`Resource` Global identity for a virtual baseband clock. Baseband signals are assumed to be real-valued and will not be modulated. :param name: the name of this clock .. py:attribute:: IDENTITY :value: 'cl0.baseband' .. py:attribute:: data .. py:class:: ClockResource(name: str, freq: float, phase: float = 0) Bases: :py:obj:`Resource` The ClockResource corresponds to a physical clock used to modulate pulses. :param name: the name of this clock :param freq: the frequency of the clock in Hz :param phase: the starting phase of the clock in deg .. py:attribute:: data .. py:class:: DigitalClockResource(name: str) Bases: :py:obj:`Resource` Global identity for a virtual digital clock. Digital clocks can only be associated with digital channels. :param name: the name of this clock .. py:attribute:: IDENTITY :value: 'digital' .. py:attribute:: data .. py:class:: Resource(name: str) Bases: :py:obj:`collections.UserDict` A resource corresponds to a physical resource such as a port or a clock. :param name: The resource name. .. py:property:: name :type: str Returns the name of the Resource. .. py:property:: hash :type: str A hash based on the contents of the Operation. .. py:class:: Schedule(name: str, repetitions: int = 1, data: dict = None) Bases: :py:obj:`ScheduleBase` A modifiable schedule. Operations :class:`quantify_scheduler.operations.operation.Operation` can be added using the :meth:`~.Schedule.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 :class:`quantify_scheduler.operations.operation.Operation` on all layers. Instead, this information can be added later during :ref:`compilation `. This allows the user to effortlessly mix the gate- and pulse-level descriptions as required for many (calibration) experiments. :param name: The name of the schedule :param repetitions: The amount of times the schedule will be repeated, by default 1 :param data: A dictionary containing a pre-existing schedule, by default None .. py:attribute:: schema_filename :value: 'schedule.json' .. py:method:: add_resources(resources_list: list) -> None Add wrapper for adding multiple resources. .. py:method:: add_resource(resource: quantify_scheduler.resources.Resource) -> None Add a resource such as a channel or qubit to the schedule. .. py:method:: 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 Add an operation or a subschedule to the schedule. :param operation: The operation to add to the schedule, or another schedule to add as a subschedule. :param 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. :param ref_op: reference schedulable. If set to :code:`None`, will default to the last added operation. :param ref_pt: reference point in reference operation must be one of :code:`"start"`, :code:`"center"`, :code:`"end"`, or :code:`None`; in case of :code:`None`, :func:`~quantify_scheduler.compilation.determine_absolute_timing` assumes :code:`"end"`. :param ref_pt_new: reference point in added operation must be one of :code:`"start"`, :code:`"center"`, :code:`"end"`, or :code:`None`; in case of :code:`None`, :func:`~quantify_scheduler.compilation.determine_absolute_timing` assumes :code:`"start"`. :param 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. :param control_flow: Virtual operation describing if the operation should be subject to control flow (loop, conditional, ...). See :ref:`control flow reference documentation ` for a detailed explanation. :returns: Returns the schedulable created in the schedule. .. py:method:: _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 .. py:method:: _validate_add_arguments(operation: quantify_scheduler.operations.operation.Operation | Schedule, label: str, control_flow: quantify_scheduler.operations.operation.Operation | None) -> None