quantum_device ============== .. py:module:: quantify_scheduler.device_under_test.quantum_device .. autoapi-nested-parse:: Module containing the QuantumDevice object. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.device_under_test.quantum_device.QuantumDevice .. 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: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) -> 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. :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.