quackseq.options#
Options for the pulse parameters. Options can be of different types, for example boolean, numeric or function. Generally pulse parameters have different values for the different events in a pulse sequence.
Classes
|
Defines a boolean option for a pulse parameter option. |
|
Defines a selection option for a pulse parameter option. |
|
Defines a numeric option for a pulse parameter option. |
|
Defines options for the pulse parameters which can then be set accordingly. |
|
A table option has rows and columns and can be used to store a table of values. |
- class quackseq.options.BooleanOption(name: str, value)#
Defines a boolean option for a pulse parameter option.
- set_value(value)#
Sets the value of the option.
- class quackseq.options.FunctionOption(name, functions)#
Defines a selection option for a pulse parameter option.
It takes different function objects.
- Parameters:
name (str) – The name of the option.
functions (list) – The functions that can be selected.
- name#
The name of the option.
- Type:
str
- functions#
The functions that can be selected.
- Type:
list
- classmethod from_json(data)#
Creates a FunctionOption from a json representation.
- Parameters:
data (dict) – The json representation of the FunctionOption.
- Returns:
The FunctionOption.
- Return type:
- get_function_by_name(name)#
Returns the function with the given name.
- Parameters:
name (str) – The name of the function.
- Returns:
The function with the given name.
- Return type:
- set_value(value)#
Sets the value of the option.
- Parameters:
value – The value of the option.
- to_json()#
Returns a json representation of the option.
- Returns:
The json representation of the option.
- Return type:
dict
- class quackseq.options.NumericOption(name: str, value, is_float=True, min_value=None, max_value=None, slider=False)#
Defines a numeric option for a pulse parameter option.
- classmethod from_json(data)#
Creates a NumericOption from a json representation.
- Parameters:
data (dict) – The json representation of the NumericOption.
- Returns:
The NumericOption.
- Return type:
- set_value(value)#
Sets the value of the option.
- to_json()#
Returns a json representation of the option.
- Returns:
The json representation of the option.
- Return type:
dict
- class quackseq.options.Option(name: str, value)#
Defines options for the pulse parameters which can then be set accordingly.
Options can be of different types, for example boolean, numeric or function.
- Parameters:
name (str) – The name of the option.
value – The value of the option.
- name#
The name of the option.
- Type:
str
- value#
The value of the option.
- classmethod from_json(data) Option#
Creates an option from a json representation.
- Parameters:
data (dict) – The json representation of the option.
- Returns:
The option.
- Return type:
- set_value()#
Sets the value of the option.
This method has to be implemented in the derived classes.
- to_json()#
Returns a json representation of the option.
- Returns:
The json representation of the option.
- Return type:
dict
- class quackseq.options.TableOption(name: str, value=None)#
A table option has rows and columns and can be used to store a table of values.
The table option acts as a ‘meta’ option, which means that we can add different types of options to the table as columns. Associated with every row we can add a number of different values. The number of rows can be adjusted at runtime.
- class Column(name: str, type, default_value, n_rows: int)#
Defines a column option for a table option.
- Parameters:
name (str) – The name of the option.
type (type) – The type of the option.
default_value – The default value of the option.
- classmethod from_json(data)#
Creates a Column from a json representation.
- Parameters:
data (dict) – The json representation of the Column.
- Returns:
The Column.
- Return type:
- get_values() list#
Gets the values of the options in the column.
- Returns:
The values of the options in the column.
- Return type:
list
- set_row_values(values: list) None#
Sets the values of the options in the column.
- Parameters:
values – The values of the options in the column.
- to_json()#
Returns a json representation of the column.
- Returns:
The json representation of the column.
- Return type:
dict
- update_n_rows(n_rows: int) None#
Updates the number of rows in the column.
- Parameters:
n_rows (int) – The number of rows.
- add_column(column_name: str, option: Option, default_value) None#
Adds an option to the table as column.
Options are added as columns.
- Parameters:
option (Option) – The class of the option to add.
column_name (str) – The name of the column.
default_value – The default value of the column.
- classmethod from_json(data)#
Creates a TableOption from a json representation.
- Parameters:
data (dict) – The json representation of the TableOption.
- Returns:
The TableOption.
- Return type:
- get_column_by_name(name: str) Option#
Gets an option by its name.
- Parameters:
name (str) – The name of the option.
- Returns:
The option with the given name.
- Return type:
- get_value() list#
Gets the value of the option.
- Returns:
The values of the different options in the table.
- Return type:
list
- set_column(column_name: str, values: list) None#
Sets the values of a column in the table.
- Parameters:
column_name (str) – The name of the column.
values – The values of the column.
- set_n_rows(n_rows: int) None#
Sets the number of rows in the table.
- Parameters:
n_rows (int) – The number of rows.
- set_value(values: list) None#
Sets the value of the option.
- Parameters:
values – The values of the different options in the table.
- to_json()#
Returns a json representation of the option.
- Returns:
The json representation of the option.
- Return type:
dict