hardware_config#

Module containing the HardwareConfig object.

Extends ManualParameter to add methods to load from/to file and reload. Note: ManualParameter might be refactored out at some point in the future.

Module Contents#

Classes#

HardwareConfig

The input dictionary used to generate a valid HardwareCompilationConfig.

class HardwareConfig(configuration: dict | None = None, instrument: quantify_scheduler.QuantumDevice | None = None)[source]#

Bases: qcodes.instrument.parameter.ManualParameter

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

Parameters:

configuration – A dictionary with the hardware configuration.

load_from_json_file(file_path: str | pathlib.Path) None[source]#

Reload the object’s configuration from a file. Updates the object’s data using the contents of the file.

Parameters:

file_path – The path to the file to reload from.

Raises:
  • FileNotFoundError – If the provided file path does not exist.

  • IOError – If an I/O error occurs during file reading.

write_to_json_file(file_path: str | pathlib.Path) None[source]#

Write the current configuration to a specified file. If the file does not exist, it is created. The data is written in JSON format, and an indentation of 2.

Parameters:

file_path – The path to the file where data will be written.

Raises:
  • ValueError – If neither a file path is provided nor a previously known file path exists.

  • IOError – If an I/O error occurs during file creation or writing.