6.2.5. qumada.instrument.mapping

qumada.instrument.mapping.base

qumada.instrument.mapping.mapping_gui

exception qumada.instrument.mapping.MappingError[source]

Bases: Exception

Exception is raised, if an error occured during Mapping.

qumada.instrument.mapping.add_mapping_to_instrument(instrument, *, path=None, mapping=None)[source]

Loads instrument mapping from mapping JSON file and adds it as instrument attribute. Alternatively, provide a mapping object, that contains the mapping contents, as well as wrapper functions e.g. for ramps

instr._mapping

Parameters:
  • instrument (Instrument) – Instrument, the mapping is added to.

  • path (str) – Path to the JSON file.

  • mapping (InstrumentMapping) – mapping object

Return type:

None

qumada.instrument.mapping.filter_flatten_parameters(node)[source]

Recursively filters objects of Parameter types from data structure, that consists of dicts, lists and Metadatable.

Parameters:

node (Union[Dict, List, Metadatable]) – Current/starting node in the data structure

Returns:

Flat dict of parameters

Return type:

Dict[Any, Parameter]

qumada.instrument.mapping.map_gates_to_instruments(components, gate_parameters, existing_gate_parameters=None, *, metadata=None, map_manually=False)[source]

Maps the gates, that were defined in the MeasurementScript to the instruments, that are initialized in QCoDeS.

Parameters:
  • components (Mapping[Any, Metadatable]) – Instruments/Components in QCoDeS

  • gate_parameters (Mapping[Any, Union[Mapping[Any, Parameter], Parameter]]) – Gates, as defined in the measurement script

  • existing_gate_parameters (Mapping[Any, Union[Mapping[Any, Parameter], Parameter]] | None) – Already existing mapping that is used to automatically create the mapping for already known gates without user input.

  • metadata (Metadata | None) – If provided, add mapping to the metadata object.

  • map_manually (bool) – If set to True, don’t try to automatically map parameters to gates. Defaults to False.

Return type:

None

qumada.instrument.mapping.map_terminals_gui(components, terminal_parameters, existing_terminal_parameters=None, metadata=None, monitoring=True, skip_gui_if_mapped=True)[source]

Maps the terminals, that were defined in the MeasurementScript to the instruments, that are initialized in QCoDeS.

Parameters:
  • components (Mapping[Any, Metadatable]) – Instruments/Components in QCoDeS

  • terminal_parameters (Mapping[Any, Union[Mapping[Any, Parameter], Parameter]]) – Terminals, as defined in the measurement script

  • existing_terminal_parameters (Mapping[Any, Union[Mapping[Any, Parameter], Parameter]] | None) – Already existing mapping that is used to automatically create the mapping for already known terminals without user input.

  • metadata (Metadata | None) – If provided, add mapping to the metadata object.

  • monitoring (bool) – if True the mapped parameters are periodically read out (either by get command (default) or cached value)

  • skip_gui_if_mapped (bool) – if True and existing_terminal_parameters completely covers all terminal_parameters, dont open gui and continue

Return type:

None