qiskit.aqua.algorithms.QuantumAlgorithm¶
-
class
QuantumAlgorithm
(quantum_instance)[source]¶ Base class for Quantum Algorithms.
This method should initialize the module and use an exception if a component of the module is available.
-
abstract
__init__
(quantum_instance)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(quantum_instance)Initialize self.
run
([quantum_instance])Execute the algorithm with selected backend.
set_backend
(backend, **kwargs)Sets backend with configuration.
Attributes
Returns backend.
Returns quantum instance.
Return a numpy random.
-
property
backend
¶ Returns backend.
- Return type
Union
[Backend
,BaseBackend
]
-
property
quantum_instance
¶ Returns quantum instance.
- Return type
Optional
[QuantumInstance
]
-
property
random
¶ Return a numpy random.
-
run
(quantum_instance=None, **kwargs)[source]¶ Execute the algorithm with selected backend.
- Parameters
quantum_instance (
Union
[QuantumInstance
,Backend
,BaseBackend
,None
]) – the experimental setting.kwargs (dict) – kwargs
- Returns
results of an algorithm.
- Return type
dict
- Raises
AquaError – If a quantum instance or backend has not been provided
-
abstract