# qiskit.optimization.algorithms.GroverOptimizationResult¶

class GroverOptimizationResult(x, fval, variables, operation_counts, n_input_qubits, n_output_qubits, intermediate_fval, threshold, status)[código fonte]

A result object for Grover Optimization methods.

Constructs a result object with the specific Grover properties.

Parâmetros
• 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.

__init__(x, fval, variables, operation_counts, n_input_qubits, n_output_qubits, intermediate_fval, threshold, status)[código fonte]

Constructs a result object with the specific Grover properties.

Parâmetros
• 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.

Methods

 __init__(x, fval, variables, …) Constructs a result object with the specific Grover properties.

Attributes

 fval Returns the optimal function value. intermediate_fval Getter of the intermediate fval n_input_qubits Getter of n_input_qubits n_output_qubits Getter of n_output_qubits operation_counts Get the operation counts. raw_results Return the original results object from the optimization algorithm. samples Returns the list of solution samples status Returns the termination status of the optimization algorithm. threshold Getter of the threshold of Grover algorithm. variable_names Returns the list of variable names of the optimization problem. variables Returns the list of variables of the optimization problem. variables_dict 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.
property fval

Returns the optimal function value.

Tipo de retorno

float

Retorna

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

property intermediate_fval

Getter of the intermediate fval

Tipo de retorno

float

Retorna

The intermediate value of fval before interpret.

property n_input_qubits

Getter of n_input_qubits

Tipo de retorno

int

Retorna

The number of qubits used to represent the input.

property n_output_qubits

Getter of n_output_qubits

Tipo de retorno

int

Retorna

The number of qubits used to represent the output.

property operation_counts

Get the operation counts.

Tipo de retorno

Dict[int, Dict[str, int]]

Retorna

The counts of each operation performed per iteration.

property raw_results

Return the original results object from the optimization algorithm.

Currently a dump for any leftovers.

Tipo de retorno

Any

Retorna

Additional result information of the optimization algorithm.

property samples

Returns the list of solution samples

Tipo de retorno

List[SolutionSample]

Retorna

The list of solution samples.

property status

Returns the termination status of the optimization algorithm.

Tipo de retorno

OptimizationResultStatus

Retorna

The termination status of the algorithm.

property threshold

Getter of the threshold of Grover algorithm.

Tipo de retorno

float

Retorna

The threshold of Grover algorithm.

property variable_names

Returns the list of variable names of the optimization problem.

Tipo de retorno

List[str]

Retorna

The list of variable names of the optimization problem.

property variables

Returns the list of variables of the optimization problem.

Tipo de retorno

List[Variable]

Retorna

The list of variables.

property variables_dict

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

Tipo de retorno

Dict[str, float]

Retorna

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

property x

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

Tipo de retorno

Optional[ndarray]

Retorna

The optimal value found in the optimization.