modules.applications.qml.generative_modeling.circuits.circuit_generative.CircuitGenerative
- class CircuitGenerative(name: str)
-
This module is abstract base class for the library-agnostic gate sequence, that define a quantum circuit.
- __init__(name: str)
Constructor method.
- Parameters:
name -- The name of the circuit architecture
Methods
__init__(name)Constructor method.
generate_gate_sequence(input_data, config)Generates the library agnostic gate sequence, a well-defined definition of the quantum circuit.
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.
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 the parameters for a given module.
Returns the required pip packages for this module.
get_submodule(option)Submodule is instantiated according to the information given in self.sub_options.
postprocess(input_data, config, **kwargs)Method that passes back information of the subsequent modules to the preceding modules.
preprocess(input_data, config, **kwargs)Library-agnostic implementation of the gate sequence, that will be mapped to backend such as Qiskit in the
- abstract generate_gate_sequence(input_data: dict, config: any) dict
Generates the library agnostic gate sequence, a well-defined definition of the quantum circuit.
- Parameters:
input_data -- Input data required to generate the gate sequence
config -- Configuration for the gate sequence
- Returns:
Generated gate sequence
- 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
- 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
- abstract get_parameter_options() dict
Returns the parameters for a given module.
Should always be in this format:
{ "parameter_name":{ "values":[1, 2, 3], "description":"How many nodes do you need?" }, "parameter_name_2":{ "values":["x", "y"], "description":"Which type of problem do you want?" } }
- Returns:
Available settings for this application
- static get_requirements() list
Returns the required pip packages for this module. Optionally, version requirements can be added.
- Returns:
List of dictionaries
- 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: dict, config: dict, **kwargs) tuple[dict, float]
Method that passes back information of the subsequent modules to the preceding modules.
- Parameters:
input_data -- Collected information of the benchmarking process
config -- Config specifying the number of qubits of the circuit
kwargs -- Optional keyword arguments
- Returns:
Same dictionary like input_data with architecture_name and execution time
- preprocess(input_data: dict, config: dict, **kwargs) tuple[dict, float]
- Library-agnostic implementation of the gate sequence, that will be mapped to backend such as Qiskit in the
subsequent module.
- Parameters:
input_data -- Collection of information from the previous modules
config -- Config specifying the number of qubits of the circuit
kwargs -- Optional keyword arguments
- Returns:
Dictionary including the dataset, the gate sequence needed for circuit construction, and the time it took generate the gate sequence.