# GroverOptimizationResult¶

class GroverOptimizationResult(x, fval, variables, operation_counts, n_input_qubits, n_output_qubits, intermediate_fval, threshold, status)[source]

Bases: qiskit.optimization.algorithms.optimization_algorithm.OptimizationResult

A result object for Grover Optimization methods.

Constructs a result object with the specific Grover properties.

Parameters
• x (Union[List[float], ndarray]) -- The solution of the problem

• fval (float) -- The value of the objective function of the solution

• variables (List[Variable]) -- A list of variables defined in the problem

• operation_counts (Dict[int, Dict[str, int]]) -- The counts of each operation performed per iteration.

• n_input_qubits (int) -- The number of qubits used to represent the input.

• n_output_qubits (int) -- The number of qubits used to represent the output.

• intermediate_fval (float) -- The intermediate value of the objective function of the solution, that is expected to be identical with fval.

• threshold (float) -- The threshold of Grover algorithm.

• status (OptimizationResultStatus) -- the termination status of the optimization algorithm.

Attributes

fval

Returns the optimal function value.

Return type

float

Returns

The function value corresponding to the optimal value found in the optimization.

intermediate_fval

Getter of the intermediate fval

Return type

float

Returns

The intermediate value of fval before interpret.

n_input_qubits

Getter of n_input_qubits

Return type

int

Returns

The number of qubits used to represent the input.

n_output_qubits

Getter of n_output_qubits

Return type

int

Returns

The number of qubits used to represent the output.

operation_counts

Get the operation counts.

Return type

Dict[int, Dict[str, int]]

Returns

The counts of each operation performed per iteration.

raw_results

Return the original results object from the optimization algorithm.

Currently a dump for any leftovers.

Return type

Any

Returns

Additional result information of the optimization algorithm.

samples

Returns the list of solution samples

Return type

List[SolutionSample]

Returns

The list of solution samples.

status

Returns the termination status of the optimization algorithm.

Return type

OptimizationResultStatus

Returns

The termination status of the algorithm.

threshold

Getter of the threshold of Grover algorithm.

Return type

float

Returns

The threshold of Grover algorithm.

variable_names

Returns the list of variable names of the optimization problem.

Return type

List[str]

Returns

The list of variable names of the optimization problem.

variables

Returns the list of variables of the optimization problem.

Return type

List[Variable]

Returns

The list of variables.

variables_dict

Returns the optimal value as a dictionary of the variable name and corresponding value.

Return type

Dict[str, float]

Returns

The optimal value as a dictionary of the variable name and corresponding value.

x

Returns the optimal value found in the optimization or None in case of FAILURE.

Return type

Optional[ndarray]

Returns

The optimal value found in the optimization.