9.3.1. qumada.measurement.device_object
- class qumada.measurement.device_object.QumadaDevice(namespace=None, station=None)[source]
Bases:
object- static create_from_dict(data, station=None, namespace=None)[source]
Creates a QumadaDevice object from valid parameter dictionaries as used in Qumada measurement scripts. Be aware that the validity is not checked at the moment, so there might be unexpected exceptions! Parameter values are not set upon initialization for safety reason! They are stored in the _stored_values attribute. By default terminals are added to the namespace provided by the namespace argument. If you set namespace=globals() you can make the terminals available in global namespace. TODO: Remove make_terminals_global parameter and check if namespace is not None
- load_from_dict(data)[source]
Adds terminals and corresponding parameters to an existing QumadaDevice. Values are not set automatically for safety reasons, they are stored in the _stored_value attribute. TODO: Check behaviour for existing terminals/parameters
- pulsed_measurement(params, setpoints, repetitions=1, name=None, metadata=None, station=None, buffer_settings=None, priorize_stored_value=False, **kwargs)[source]
Perform a buffered pulsed measurement with optional repetitions. Results from repetitions are averaged.
- Parameters:
setpoints (list[list[float]]) – A list of setpoints for each parameter. Each sublist must have the same length.
repetitions (int, optional) – Number of repetitions for the measurement. Default is 1.
name (str, optional) – Measurement name. Default is None.
metadata (dict, optional) – Metadata for the measurement. Default is None.
station (Station, optional) – Station object associated with the measurement. Default is the station of the instance.
buffer_settings (dict, optional) – Buffer settings for the measurement. Must include “num_points”. Default is the instance’s buffer settings.
priorize_stored_value (bool, optional) – If True, prioritizes stored values in the setup. Default is False.
**kwargs – Additional keyword arguments passed to the measurement script.
- Returns:
data – The dataset containing the measurement results.
- Return type:
qcodes.dataset.data_set.DataSet
- Raises:
TypeError – If the provided station is not of type Station.
AssertionError – If parameter or setpoint mismatches occur.
Exception – If buffer settings are invalid.
Notes
Configures dynamic and static parameters based on their usage in the measurement.
Uses Generic_Pulsed_Measurement for single repetition or Generic_Pulsed_Repeated_Measurement for multiple repetitions.
Buffer settings are adjusted to match the length of the setpoints.
Is always buffered (no need for buffered = True here)
- run_measurement(script, dynamic_params, setpoints, dynamic_values=None, static_params=None, static_values=None, gettable_params=None, break_conditions=None, name=None, metadata=None, station=None, buffered=False, buffer_settings=None, priorize_stored_value=False, **kwargs)[source]
Runs any Qumada Measurement Script. Alters parameter attributes of device according to their type.
- Parameters:
script (MeasurementScript) – The script you want to use. Has to be of type MeasurementScript.
dynamic_params (list) – List of parameters that should be set to dynamic. Parameters that already are of the type “dynamic”, but not listed here, will be set to “static gettable” to avoid user errors.
setpoints (list) – Setpoints for the parameters listed before.
dynamic_values (list|None, optional) – Values for the dynamic parameters (if required). Same length as dynamic parameters or None. The default is None.
static_params (list|None, optional) – Parameters to set to static. Parameters that are already static will stay that way even if not listed here. For static gettable parameters add the parameter to the gettable list as well.The default is None.
static_values (list|None, optional) – Values for the static params listed above explicitely. Same lenght as static params. The default is None.
gettable_params (list|None, optional) – Parameters in this list are set to gettable. Parameters that are already gettable but not in this list, will stay gettable. The default is None.
break_conditions (list|None, optional) – Break conditions for gettable parameters listed explicitely in the gettable_params above. Same lenght as gettable_params. The default is None.
name (str|None, optional) – Custom name if required. If None name is generated by QuMada. The default is None.
metadata (metadata object|None, optional) – Metadata Object to store. The default is None.
station (QCoDeS Station, optional) – QCoDeS station. Overwrites device.station if not None. If None the device.station will be used. The default is None.
buffered (Bool, optional) – Set to true for buffered measurements. Otherwise buffer settings etc are not passed on (measurements might still work though if everything was already defined in device. The default is False.
buffer_settings (dict | None, optional) – Buffer settings. Overwrites settings stored in device if not None. The default is None.
priorize_stored_value (Bool, optional) – Use values from dictionionary used to create device object instead of current values of the parameters if available. The default is False.
**kwargs (dict|None) – Additional params, possibly depending on the measurement script. (e.g. duration for timetraces)
- Raises:
- Returns:
data – List of Datasets with measurement reuslts.
- Return type:
list[Dataset]
- save_defaults(ramp=None, **kwargs)[source]
Saves current values as default for all Terminals and their parameters
- save_state(name)[source]
Saves current state (inclung types, limits etc) as entry in the tuning dict with name as key.
- save_to_dict(priorize_stored_value=False)[source]
Returns a dict compatible with the qumada measurements scripts. Contains type, setpoints, delay, start, stop, num_points and value of the terminal parameters. For the value, by default the current value of the parameter is used (the parameter is called therefore). If the parameter is not callable (e.g. because no mapping was done so far), the _stored_value attribute is used. If priorize_stored_values is set to True, the _stored_value attribute will be used if available and the return value of the parameters callable only if _stored_value is not available (or None). None values will be always ignored, the value will not be set in this case.
- set_defaults(ramp=None, **kwargs)[source]
Sets all Terminals and their parameters to their default values
- sweep_2D(slow_param, fast_param, slow_param_range, fast_param_range, slow_num_points=50, fast_num_points=100, name=None, metadata=None, station=None, buffered=False, buffer_settings=None, priorize_stored_value=False, restore_state=True)[source]
Perform a 2D sweep over two parameters. The current values are in the center of the sweep (the sweep ranges from currentvalue - 0.5*range to current value + 0.5*range). Can be buffered.
- Parameters:
slow_param (Parameter) – The slow parameter to be swept.
fast_param (Parameter) – The fast parameter to be swept.
slow_param_range (float) – Range for the slow parameter sweep.
fast_param_range (float) – Range for the fast parameter sweep.
slow_num_points (int, optional) – Number of points for the slow parameter sweep. Default is 50.
fast_num_points (int, optional) – Number of points for the fast parameter sweep. Default is 100.
name (str, optional) – Measurement name. Default is None.
metadata (dict, optional) – Metadata for the measurement. Default is None.
station (Station, optional) – Station object associated with the measurement. Default is the station of the instance.
buffered (bool, optional) – If True, performs a buffered 2D sweep. Default is False.
buffer_settings (dict, optional) – Buffer settings for the measurement. Default is the instance’s buffer settings.
priorize_stored_value (bool, optional) – If True, prioritizes stored values in the setup. Default is False.
restore_state (bool, optional) – If True, restores the original state of the parameters after the measurement. Default is True.
- Returns:
data – The dataset containing the measurement results.
- Return type:
qcodes.dataset.data_set.DataSet
- Raises:
Notes
Uses Generic_2D_Sweep_buffered for buffered measurements and Generic_nD_Sweep for unbuffered measurements.
Temporarily modifies buffer settings if buffered is True.
Restores the parameter state upon completion or exception.
- sweep_parallel(params, setpoints=None, target_values=None, num_points=100, name=None, metadata=None, station=None, priorize_stored_value=False, **kwargs)[source]
Sweep multiple parameters in parallel. Provide either setpoints or target_values. Setpoints have to have the same length for all parameters. If no setpoints are provided, the target_values will be used to create the setpoints. Ramps will start from the current value of the parameters then. Gettable parameters and break conditions will be set according to their state in the device object. You can pass backsweep_after_break as a kwarg. If set to True, the sweep will continue in the opposite direction after a break condition is reached.
- Parameters:
setpoints (list[list[float]], optional) – A list of setpoints for each parameter. Each sublist must have the same length.
target_values (list[float], optional) – Target values for each parameter. Used to generate setpoints if setpoints is not provided.
num_points (int, optional) – Number of points for the generated setpoints. Default is 100.
name (str, optional) – Measurement name. Default is None.
metadata (dict, optional) – Metadata for the measurement. Default is None.
station (Station, optional) – Station object associated with the measurement. Default is the station of the instance.
priorize_stored_value (bool, optional) – If True, prioritizes stored values in the setup. Default is False.
**kwargs – Additional keyword arguments passed to the measurement script.
- Returns:
data – The dataset containing the measurement results.
- Return type:
qcodes.dataset.data_set.DataSet
- Raises:
TypeError – If the provided station is not of type Station.
Exception – If neither setpoints nor target_values are provided or both are provided.
AssertionError – If parameter or setpoint mismatches occur.
Notes
Dynamic and static parameters are automatically configured during the measurement.
The script used for the measurement is Generic_1D_parallel_Sweep.
- timetrace(duration, timestep=1, name=None, metadata=None, station=None, buffered=False, buffer_settings=None, priorize_stored_value=False)[source]
Perform a time-trace measurement over a specified duration and timestep. Uses the current values of the parameters. Can be buffered.
- Parameters:
duration (float) – Total duration of the time-trace measurement in seconds.
timestep (float, optional) – Time interval between data points in seconds. Default is 1.
name (str, optional) – Measurement name. Default is None.
metadata (dict, optional) – Metadata for the measurement. Default is None.
station (Station, optional) – Station object associated with the measurement. Default is the station of the instance.
buffered (bool, optional) – If True, performs a buffered time-trace measurement. Default is False.
buffer_settings (dict, optional) – Buffer settings for the measurement. Default is the instance’s buffer settings.
priorize_stored_value (bool, optional) – If True, prioritizes stored values in the setup. Default is False.
- Returns:
data – The dataset containing the measurement results.
- Return type:
qcodes.dataset.data_set.DataSet
- Raises:
TypeError – If the provided station is not of type Station.
Notes
Adjusts buffer settings temporarily when buffered is True.
Uses Timetrace_buffered for buffered measurements and Timetrace for unbuffered measurements.
- class qumada.measurement.device_object.Terminal(name, parent=None, type=None)[source]
Bases:
ABCBase class for Terminals scripts.
The abstract functions “reset” has to be implemented.
-
PARAMETER_NAMES:
set[str] = {'amplitude', 'aux_voltage_1', 'aux_voltage_2', 'count', 'current', 'current_compliance', 'current_x_component', 'current_y_component', 'demod0_aux_in_1', 'demod0_aux_in_2', 'frequency', 'output_enabled', 'phase', 'temperature', 'test_parameter', 'time_constant', 'voltage', 'voltage_offset', 'voltage_x_component', 'voltage_y_component'}
- add_terminal_parameter(parameter_name, parameter=None, properties=None)[source]
Adds a gate parameter to self.terminal_parameters.
- Parameters:
parameter_name (str) – Name of the parameter. Has to be in MeasurementScript.PARAMETER_NAMES.
terminal_name (str) – Name of the parameter’s gate. Set this, if you want to define the parameter under a specific gate. Defaults to None.
parameter (Parameter) – Custom parameter. Set this, if you want to set a custom parameter. Defaults to None.
- Return type:
- remove_terminal_parameter(parameter_name)[source]
Adds a gate parameter to self.terminal_parameters.
- Parameters:
parameter_name (str) – Name of the parameter. Has to be in MeasurementScript.PARAMETER_NAMES.
terminal_name (str) – Name of the parameter’s gate. Set this, if you want to define the parameter under a specific gate. Defaults to None.
parameter (Parameter) – Custom parameter. Set this, if you want to set a custom parameter. Defaults to None.
- Return type:
-
PARAMETER_NAMES:
- class qumada.measurement.device_object.Terminal_Parameter(name, Terminal, properties={})[source]
Bases:
ABC- property instrument_parameter
- property limits
- measured_ramp(value, num_points=100, start=None, station=None, name=None, metadata=None, backsweep=False, buffered=False, buffer_settings=None, priorize_stored_value=False)[source]
Perform a ramp of the parameter value and measure all gettable parameters. Can be buffered.
- Parameters:
value (float) – Target value for the ramp.
num_points (int, optional) – Number of points for the ramp. Default is 100.
start (float, optional) – Starting value for the ramp. If None, the current parameter value is used. Default is None.
station (Station, optional) – Station object for the measurement. Default is the station of the parent device.
name (str, optional) – Measurement name. Default is None.
metadata (dict, optional) – Metadata for the measurement. Default is None.
backsweep (bool, optional) – If True, includes a backsweep to return to the starting value after reaching the target value. Default is False.
buffered (bool, optional) – If True, performs a buffered ramp measurement. Default is False.
buffer_settings (dict, optional) – Additional buffer settings for the measurement. Default is None.
priorize_stored_value (bool, optional) – If True, prioritizes stored values in the setup. Default is False.
- Returns:
data – The dataset containing the measurement results.
- Return type:
qcodes.dataset.data_set.DataSet
- Raises:
Notes
Uses Generic_1D_Hysteresis_buffered for buffered ramps with backsweep.
Uses Generic_1D_Sweep_buffered for buffered ramps without backsweep.
Uses Generic_1D_Sweep for unbuffered ramps.
Temporarily modifies buffer settings to match the number of points if buffered.
Ensures all other dynamic parameters are set to “static gettable” before the ramp.
- property value