nqrduck_spectrometer.pulsesequence#

Contains the PulseSequence class that is used to store a pulse sequence and its events.

Classes

PulseSequence(name[,Β version])

A pulse sequence is a collection of events that are executed in a certain order.

class nqrduck_spectrometer.pulsesequence.PulseSequence(name, version=None)#

A pulse sequence is a collection of events that are executed in a certain order.

Parameters:

name (str) – The name of the pulse sequence

name#

The name of the pulse sequence

Type:

str

events#

The events of the pulse sequence

Type:

list

class Event(name: str, duration: str)#

An event is a part of a pulse sequence. It has a name and a duration and different parameters that have to be set.

Parameters:
  • name (str) – The name of the event

  • duration (str) – The duration of the event

name#

The name of the event

Type:

str

duration#

The duration of the event

Type:

str

parameters#

The parameters of the event

Type:

OrderedDict

add_parameter(parameter) None#

Adds a parameter to the event.

Parameters:

parameter – The parameter to add

property duration#

The duration of the event.

classmethod load_event(event, pulse_parameter_options)#

Loads an event from a dict.

The pulse paramter options are needed to load the parameters and determine if the correct spectrometer is active.

Parameters:
  • event (dict) – The dict with the event data

  • pulse_parameter_options (dict) – The dict with the pulse parameter options

Returns:

The loaded event

Return type:

Event

on_duration_changed(duration: str) None#

This method is called when the duration of the event is changed.

Parameters:

duration (str) – The new duration of the event

class Variable#

A variable is a parameter that can be used within a pulsesequence as a placeholder.

For example the event duration a Variable with name a can be set. This variable can then be set to a list of different values. On execution of the pulse sequence the event duration will be set to the first value in the list. Then the pulse sequence will be executed with the second value of the list. This is repeated until the pulse sequence has been executed with all values in the list.

property name#

The name of the variable.

property values#

The values of the variable. This is a list of values that the variable can take.

class VariableGroup#

Variables can be grouped together.

If we have groups a and b the pulse sequence will be executed for all combinations of variables in a and b.

property name#

The name of the variable group.

property variables#

The variables in the group. This is a list of variables.

get_event_names() list#

Returns a list of the names of the events in the pulse sequence.

Returns:

The names of the events

Return type:

list

classmethod load_sequence(sequence, pulse_parameter_options)#

Loads a pulse sequence from a dict.

The pulse paramter options are needed to load the parameters and make sure the correct spectrometer is active.

Parameters:
  • sequence (dict) – The dict with the sequence data

  • pulse_parameter_options (dict) – The dict with the pulse parameter options

Returns:

The loaded pulse sequence

Return type:

PulseSequence

Raises:

KeyError – If the pulse parameter options are not the same as the ones in the pulse sequence

to_json()#

Returns a dict with all the data in the pulse sequence.

Returns:

The dict with the sequence data

Return type:

dict