GroverOptimizer.solve¶
- GroverOptimizer.solve(problem)[source]¶
Tries to solves the given problem using the grover optimizer.
Runs the optimizer to try to solve the optimization problem. If the problem cannot be, converted to a QUBO, this optimizer raises an exception due to incompatibility.
- Parameters
problem (
QuadraticProgram
) – The problem to be solved.- Return type
OptimizationResult
- Returns
The result of the optimizer applied to the problem.
- Raises
AttributeError – If the quantum instance has not been set.
QiskitOptimizationError – If the problem is incompatible with the optimizer.