# GroverOptimizationResult¶

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

Bases: qiskit.optimization.algorithms.optimization_algorithm.OptimizationResult

A result object for Grover Optimization methods.

Constructs a result object with the specific Grover properties.

Parameter
• 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.

Rückgabetyp

float

Rückgabe

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

intermediate_fval

Getter of the intermediate fval

Rückgabetyp

float

Rückgabe

The intermediate value of fval before interpret.

n_input_qubits

Getter of n_input_qubits

Rückgabetyp

int

Rückgabe

The number of qubits used to represent the input.

n_output_qubits

Getter of n_output_qubits

Rückgabetyp

int

Rückgabe

The number of qubits used to represent the output.

operation_counts

Get the operation counts.

Rückgabetyp

Dict[int, Dict[str, int]]

Rückgabe

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.

Rückgabetyp

Any

Rückgabe

Additional result information of the optimization algorithm.

samples

Returns the list of solution samples

Rückgabetyp

List[SolutionSample]

Rückgabe

The list of solution samples.

status

Returns the termination status of the optimization algorithm.

Rückgabetyp

OptimizationResultStatus

Rückgabe

The termination status of the algorithm.

threshold

Getter of the threshold of Grover algorithm.

Rückgabetyp

float

Rückgabe

The threshold of Grover algorithm.

variable_names

Returns the list of variable names of the optimization problem.

Rückgabetyp

List[str]

Rückgabe

The list of variable names of the optimization problem.

variables

Returns the list of variables of the optimization problem.

Rückgabetyp

List[Variable]

Rückgabe

The list of variables.

variables_dict

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

Rückgabetyp

Dict[str, float]

Rückgabe

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.

Rückgabetyp

Optional[ndarray]

Rückgabe

The optimal value found in the optimization.