qiskit.aqua.algorithms.QuantumAlgorithm
class QuantumAlgorithm(quantum_instance)
Base class for Quantum Algorithms.
This method should initialize the module and use an exception if a component of the module is available.
__init__
abstract __init__(quantum_instance)
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
backend | Returns backend. |
quantum_instance | Returns quantum instance. |
random | Return a numpy random. |
backend
Returns backend.
Return type
Union
[Backend
, BaseBackend
]
quantum_instance
Returns quantum instance.
Return type
Optional
[QuantumInstance
]
random
Return a numpy random.
run
run(quantum_instance=None, **kwargs)
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
set_backend
set_backend(backend, **kwargs)
Sets backend with configuration.
Return type
None
Was this page helpful?
Report a bug or request content on GitHub.