6.2.2. qumada.instrument.buffers

qumada.instrument.buffers.buffer

qumada.instrument.buffers.dummy_dmm_buffer

Created on Tue Jan 3 15:20:07 2023

qumada.instrument.buffers.mfli_buffer

qumada.instrument.buffers.sr830_buffer

class qumada.instrument.buffers.Buffer[source]

Bases: ABC

Base class for a general buffer interface for an instrument.

AVAILABLE_TRIGGERS: list[str] = []
GRID_INTERPOLATION_NAMES: list[str] = ['exact', 'nearest', 'linear']
SETTING_NAMES: set[str] = {'burst_duration', 'channel', 'delay', 'duration', 'grid_interpolation', 'num_bursts', 'num_points', 'sampling_rate', 'trigger_mode', 'trigger_threshold'}
TRIGGER_MODE_NAMES: list[str] = ['continuous', 'edge', 'tracking_edge', 'pulse', 'tracking_pulse', 'digital']
TRIGGER_MODE_POLARITY_NAMES: list[str] = ['positive', 'negative', 'both']
abstract force_trigger()[source]

Triggers the trigger.

Return type:

None

abstract is_finished()[source]

True, if measurement is done and data has finished reading from the buffer.

Return type:

bool

abstract is_ready()[source]

True, if buffer is correctly initialized and ready to measure.

Return type:

bool

abstract is_subscribed(parameter)[source]

True, if the parameter is subscribed and saved in buffer.

Return type:

bool

abstract property num_points: int | None

Number of points to write into buffer for each burst. Required to setup qcodes datastructure and to compare with max. buffer length.

abstract read()[source]

Read the buffer

Output is a dict with the following structure:

{
    "timestamps": list[float],
    "param1": list[float],
    "param2": list[float],
    ...
}
Return type:

dict

abstract read_raw()[source]

Read the buffer and return raw output.

Return type:

Any

settings_schema = {'additionalProperties': False, 'oneOf': [{'required': ['sampling_rate', 'duration'], 'not': {'required': ['num_points']}}, {'required': ['sampling_rate', 'num_points'], 'not': {'required': ['duration']}}, {'required': ['duration', 'num_points'], 'not': {'required': ['sampling_rate']}}], 'properties': {'burst_duration': {'type': 'number'}, 'channel': {'type': 'integer'}, 'delay': {'type': 'number'}, 'duration': {'type': 'number'}, 'grid_interpolation': {'enum': ['exact', 'nearest', 'linear'], 'type': 'string'}, 'num_bursts': {'type': 'integer'}, 'num_points': {'type': 'integer'}, 'sampling_rate': {'type': 'number'}, 'trigger_mode': {'enum': ['continuous', 'edge', 'tracking_edge', 'pulse', 'tracking_pulse', 'digital'], 'type': 'string'}, 'trigger_mode_polarity': {'enum': ['positive', 'negative', 'both'], 'type': 'string'}, 'trigger_threshold': {'type': 'number'}}, 'type': 'object'}
abstract setup_buffer(settings)[source]

Sets instrument related settings for the buffer.

Return type:

None

abstract start()[source]

Start the buffer. This is not the trigger.

Return type:

None

abstract stop()[source]

Stop the buffer.

Return type:

None

abstract subscribe(parameters)[source]

Measure provided parameters with the buffer.

Return type:

None

abstract property trigger: Parameter | None

The parameter, that triggers the instruments buffer. Set the trigger parameter using a qcodes parameter.

abstract unsubscribe(parameters)[source]

Unsubscribe provided parameters, if they were subscribed.

Return type:

None

exception qumada.instrument.buffers.BufferException[source]

Bases: Exception

General Buffer Exception

class qumada.instrument.buffers.DummyDMMBuffer(device)[source]

Bases: Buffer

Buffer for Dummy DMM

AVAILABLE_TRIGGERS: list[str] = ['software']
force_trigger()[source]

Triggers the trigger.

Return type:

None

is_finished()[source]

True, if measurement is done and data has finished reading from the buffer.

Return type:

bool

is_ready()[source]

True, if buffer is correctly initialized and ready to measure.

Return type:

bool

is_subscribed(parameter)[source]

True, if the parameter is subscribed and saved in buffer.

Return type:

bool

property num_points: int | None

Number of points to write into buffer for each burst. Required to setup qcodes datastructure and to compare with max. buffer length.

read()[source]

Read the buffer

Output is a dict with the following structure:

{
    "timestamps": list[float],
    "param1": list[float],
    "param2": list[float],
    ...
}
Return type:

dict

read_raw()[source]

Read the buffer and return raw output.

Return type:

dict

setup_buffer(settings)[source]

Sets instrument related settings for the buffer.

Return type:

None

start()[source]

Start the buffer. This is not the trigger.

Return type:

None

stop()[source]

Stop the buffer.

Return type:

None

subscribe(parameters)[source]

Measure provided parameters with the buffer.

Return type:

None

property trigger: str | None

The parameter, that triggers the instruments buffer. Set the trigger parameter using a qcodes parameter.

unsubscribe(parameters)[source]

Unsubscribe provided parameters, if they were subscribed.

Return type:

None

class qumada.instrument.buffers.MFLIBuffer(mfli)[source]

Bases: Buffer

Buffer for ZurichInstruments MFLI

AVAILABLE_TRIGGERS: list[str] = ['trigger_in_1', 'trigger_in_2', 'aux_in_1', 'aux_in_2']
GRID_INTERPOLATION_MAPPING: dict = {'exact': 4, 'linear': 2, 'nearest': 1}
TRIGGER_MODE_MAPPING: dict = {'continuous': 0, 'digital': 6, 'edge': 1, 'pulse': 3, 'tracking_edge': 4, 'tracking_pulse': 7}
TRIGGER_MODE_POLARITY_MAPPING: dict = {'both': 3, 'negative': 2, 'positive': 1}
force_trigger()[source]

Triggers the trigger.

Return type:

None

is_finished()[source]

True, if measurement is done and data has finished reading from the buffer.

Return type:

bool

is_ready()[source]

True, if buffer is correctly initialized and ready to measure.

Return type:

bool

is_subscribed(parameter)[source]

True, if the parameter is subscribed and saved in buffer.

Return type:

bool

property num_points: int | None

Number of points to write into buffer for each burst. Required to setup qcodes datastructure and to compare with max. buffer length.

read()[source]

Read the buffer

Output is a dict with the following structure:

{
    "timestamps": list[float],
    "param1": list[float],
    "param2": list[float],
    ...
}
Return type:

dict

read_raw()[source]

Read the buffer and return raw output.

Return type:

dict

setup_buffer(settings)[source]

Sets instrument related settings for the buffer.

Return type:

None

start()[source]

Start the buffer. This is not the trigger.

Return type:

None

stop()[source]

Stop the buffer.

Return type:

None

subscribe(parameters)[source]

Measure provided parameters with the buffer.

Return type:

None

property trigger

The parameter, that triggers the instruments buffer. Set the trigger parameter using a qcodes parameter.

unsubscribe(parameters)[source]

Unsubscribe provided parameters, if they were subscribed.

Return type:

None

class qumada.instrument.buffers.SR830Buffer(device)[source]

Bases: Buffer

Buffer for Stanford SR830

AVAILABLE_TRIGGERS: list[str] = ['external', 'trig_in_1']
ch1_names = ['X', 'R', 'X Noise', 'aux_in1', 'aux_in2']
ch2_names = ['Y', 'Phase', 'Y Noise', 'aux_in3', 'aux_in4']
force_trigger()[source]

Triggers the trigger.

Return type:

None

is_finished()[source]

True, if measurement is done and data has finished reading from the buffer.

Return type:

bool

is_ready()[source]

True, if buffer is correctly initialized and ready to measure.

Return type:

bool

is_subscribed(parameter)[source]

True, if the parameter is subscribed and saved in buffer.

Return type:

bool

property num_points: int | None

Number of points to write into buffer for each burst. Required to setup qcodes datastructure and to compare with max. buffer length.

read()[source]

Read the buffer

Output is a dict with the following structure:

{
    "timestamps": list[float],
    "param1": list[float],
    "param2": list[float],
    ...
}
Return type:

dict

read_raw()[source]

Read the buffer and return raw output.

Return type:

dict

setup_buffer(settings)[source]

Sets instrument related settings for the buffer.

Return type:

None

start()[source]

Start the buffer. This is not the trigger.

Return type:

None

stop()[source]

Stop the buffer.

Return type:

None

subscribe(parameters)[source]

Measure provided parameters with the buffer.

Return type:

None

property trigger: str | None

The parameter, that triggers the instruments buffer. Set the trigger parameter using a qcodes parameter.

unsubscribe(parameters)[source]

Unsubscribe provided parameters, if they were subscribed.

Return type:

None

qumada.instrument.buffers.is_bufferable(object)[source]

Checks if the instrument or parameter is bufferable using the qumada Buffer definition.

qumada.instrument.buffers.map_buffers(components, properties, gate_parameters, overwrite_trigger=None, skip_mapped=True)[source]

Maps the bufferable instruments of gate parameters.

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

Return type:

None