# 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.

Paramètres
• 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.

Type renvoyé

float

Renvoie

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

intermediate_fval

Getter of the intermediate fval

Type renvoyé

float

Renvoie

The intermediate value of fval before interpret.

n_input_qubits

Getter of n_input_qubits

Type renvoyé

int

Renvoie

The number of qubits used to represent the input.

n_output_qubits

Getter of n_output_qubits

Type renvoyé

int

Renvoie

The number of qubits used to represent the output.

operation_counts

Get the operation counts.

Type renvoyé

Dict[int, Dict[str, int]]

Renvoie

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.

Type renvoyé

Any

Renvoie

Additional result information of the optimization algorithm.

samples

Returns the list of solution samples

Type renvoyé

List[SolutionSample]

Renvoie

The list of solution samples.

status

Returns the termination status of the optimization algorithm.

Type renvoyé

OptimizationResultStatus

Renvoie

The termination status of the algorithm.

threshold

Getter of the threshold of Grover algorithm.

Type renvoyé

float

Renvoie

The threshold of Grover algorithm.

variable_names

Returns the list of variable names of the optimization problem.

Type renvoyé

List[str]

Renvoie

The list of variable names of the optimization problem.

variables

Returns the list of variables of the optimization problem.

Type renvoyé

List[Variable]

Renvoie

The list of variables.

variables_dict

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

Type renvoyé

Dict[str, float]

Renvoie

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.

Type renvoyé

Optional[ndarray]

Renvoie

The optimal value found in the optimization.