GroverOptimizationResult#

class GroverOptimizationResult(x, fval, variables, operation_counts, n_input_qubits, n_output_qubits, intermediate_fval, threshold, status, samples=None, raw_samples=None)[source]#

Bases: OptimizationResult

A result object for Grover Optimization methods.

Constructs a result object with the specific Grover properties.

প্যারামিটার:
  • x (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 minimization qubo solution, that is expected to be consistent to fval.

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

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

  • samples (List[SolutionSample] | None) -- the x values, the objective function value of the original problem, the probability, and the status of sampling.

  • raw_samples (List[SolutionSample] | None) -- the x values of the QUBO, the objective function value of the minimization QUBO, and the probability of sampling.

Attributes

fval#

Returns the objective function value.

রিটার্নস:

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

intermediate_fval#

Getter of the intermediate fval

রিটার্নস:

The intermediate value of fval before interpret.

n_input_qubits#

Getter of n_input_qubits

রিটার্নস:

The number of qubits used to represent the input.

n_output_qubits#

Getter of n_output_qubits

রিটার্নস:

The number of qubits used to represent the output.

operation_counts#

Get the operation counts.

রিটার্নস:

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.

রিটার্নস:

Additional result information of the optimization algorithm.

raw_samples#

Returns the list of raw solution samples of GroverOptimizer.

রিটার্নস:

The list of raw solution samples of GroverOptimizer.

samples#

Returns the list of solution samples

রিটার্নস:

The list of solution samples.

status#

Returns the termination status of the optimization algorithm.

রিটার্নস:

The termination status of the algorithm.

threshold#

Getter of the threshold of Grover algorithm.

রিটার্নস:

The threshold of Grover algorithm.

variable_names#

Returns the list of variable names of the optimization problem.

রিটার্নস:

The list of variable names of the optimization problem.

variables#

Returns the list of variables of the optimization problem.

রিটার্নস:

The list of variables.

variables_dict#

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

রিটার্নস:

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

x#

Returns the variable values found in the optimization or None in case of FAILURE.

রিটার্নস:

The variable values found in the optimization.

Methods

get_correlations()#

Get <Zi x Zj> correlation matrix from the samples.

রিটার্নস:

A correlation matrix.

রিটার্ন টাইপ:

ndarray

prettyprint()#

Returns a pretty printed string of this optimization result.

রিটার্নস:

A pretty printed string representing the result.

রিটার্ন টাইপ:

str