modules.devices.pulser.pulser.Pulser
- class Pulser(device_name: str)
Bases:
Device,ABCAbstract class to use the Pulser devices.
- __init__(device_name: str)
Constructor method.
- Parameters:
device_name -- Name of the Pulser device.
Methods
__init__(device_name)Constructor method.
Gets the list of available options.
get_available_submodules(option)If the module has submodules depending on certain options, this method should adjust the submodule_options accordingly.
Returns backend.
Returns backend configurations.
get_default_submodule(option)Given an option string by the user, this returns a submodule.
get_depending_parameters(option, config)If the module has parameters depending on certain options, this method should return the parameters for the given option.
Returns device.
Returns the device name.
Returns the parameters to fine-tune the device.
Return requirements of this module.
get_submodule(option)Submodule is instantiated according to the information given in self.sub_options.
postprocess(input_data, config, **kwargs)Returns input data and adds device name to the metrics class instance.
preprocess(input_data, config, **kwargs)Returns instance of device class (self) and time it takes to call config.
set_config(config)Sets the device configuration.
- get_available_submodule_options() list
Gets the list of available options.
- Returns:
List of module options
- get_available_submodules(option: list) list
If the module has submodules depending on certain options, this method should adjust the submodule_options accordingly.
- Parameters:
option -- List of chosen options
- Returns:
List of available submodules
- get_backend() any
Returns backend.
- Returns:
Instance of the backend class
- abstract get_backend_config() any
Returns backend configurations.
- Returns:
Instance of the backend config class
- abstract get_default_submodule(option: str) Core
Given an option string by the user, this returns a submodule.
- Parameters:
option -- String with the chosen submodule
- Returns:
Module of type Core
- get_depending_parameters(option: str, config: dict) dict
If the module has parameters depending on certain options, this method should return the parameters for the given option.
- Parameters:
option -- The chosen option
config -- Current config dictionary
- Returns:
The parameters for the given option
- get_device() any
Returns device.
- Returns:
Instance of the device class
- get_device_name() str
Returns the device name.
- Returns:
Name of the device
- get_parameter_options() dict
Returns the parameters to fine-tune the device.
Should always be in this format: .. code-block:: json
- {
- "parameter_name":{
"values":[1, 2, 3], "description":"How many reads do you want?"
}
}
- Returns:
Available device settings for this device
- static get_requirements() list[dict]
Return requirements of this module.
- Returns:
List of dict with requirements of this module
- get_submodule(option: str) Core
Submodule is instantiated according to the information given in self.sub_options. If self.sub_options is None, get_default_submodule is called as a fallback.
- Parameters:
option -- String with the options
- Returns:
Instance of a module
- postprocess(input_data: any, config: dict, **kwargs) tuple[any, float]
Returns input data and adds device name to the metrics class instance.
- Parameters:
input_data -- Input data passed by the parent module
config -- Solver config
kwargs -- Optional keyword arguments
- Returns:
Output and time needed
- preprocess(input_data: any, config: dict, **kwargs) tuple[any, float]
Returns instance of device class (self) and time it takes to call config.
- Parameters:
input_data -- Input data (not used)
config -- Config for the device
kwargs -- Optional keyword arguments
- Returns:
Output and time needed
- set_config(config)
Sets the device configuration.
- Parameters:
config -- Configuration settings for the device