GroverOptimizer¶
-
class
GroverOptimizer
(num_value_qubits, num_iterations=3, quantum_instance=None, converters=None, penalty=None)[source]¶ Bases:
qiskit.optimization.algorithms.optimization_algorithm.OptimizationAlgorithm
Uses Grover Adaptive Search (GAS) to find the minimum of a QUBO function.
- Parameters
num_value_qubits (
int
) – The number of value qubits.num_iterations (
int
) – The number of iterations the algorithm will search with no improvement.quantum_instance (
Union
[BaseBackend
,Backend
,QuantumInstance
,None
]) – Instance of selected backend, defaults to Aer’s statevector simulator.converters (
Union
[QuadraticProgramConverter
,List
[QuadraticProgramConverter
],None
]) – The converters to use for converting a problem into a different form. By default, when None is specified, an internally created instance ofQuadraticProgramToQubo
will be used.penalty (
Optional
[float
]) – The penalty factor used in the defaultQuadraticProgramToQubo
converter
- Raises
TypeError – When there one of converters is an invalid type.
Methods
Checks whether a given problem can be solved with this optimizer.
Checks whether a given problem can be solved with the optimizer implementing this method.
Tries to solves the given problem using the grover optimizer.
Attributes
-
quantum_instance
¶ The quantum instance to run the circuits.
- Return type
QuantumInstance
- Returns
The quantum instance used in the algorithm.