RecursiveMinimumEigenOptimizationResult

class RecursiveMinimumEigenOptimizationResult(x, fval, variables, status, replacements, history)[source]

Bases: OptimizationResult

Recursive Eigen Optimizer Result.

Constructs an instance of the result class.

Parameters:
  • x (list[float] | np.ndarray) – the optimal value found in the optimization.

  • fval (float) – the optimal function value.

  • variables (list[Variable]) – the list of variables of the optimization problem.

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

  • replacements (dict[str, tuple[str, int]]) – a dictionary of substituted variables. Key is a variable being substituted, value is a tuple of substituting variable and a weight, either 1 or -1.

  • history (tuple[list[MinimumEigenOptimizationResult], OptimizationResult]) – a tuple containing intermediate results. The first element is a list of MinimumEigenOptimizerResult obtained by invoking MinimumEigenOptimizer iteratively, the second element is an instance of OptimizationResult obtained at the last step via min_num_vars_optimizer.

Attributes

fval

Returns the objective function value.

Returns:

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

history

Returns intermediate results. The first element is a list of MinimumEigenOptimizerResult obtained by invoking MinimumEigenOptimizer iteratively, the second element is an instance of OptimizationResult obtained at the last step via min_num_vars_optimizer.

raw_results

Return the original results object from the optimization algorithm.

Currently a dump for any leftovers.

Returns:

Additional result information of the optimization algorithm.

replacements

Returns a dictionary of substituted variables. Key is a variable being substituted, value is a tuple of substituting variable and a weight, either 1 or -1.

samples

Returns the list of solution samples

Returns:

The list of solution samples.

status

Returns the termination status of the optimization algorithm.

Returns:

The termination status of the algorithm.

variable_names

Returns the list of variable names of the optimization problem.

Returns:

The list of variable names of the optimization problem.

variables

Returns the list of variables of the optimization problem.

Returns:

The list of variables.

variables_dict

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

Returns:

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.

Returns:

The variable values found in the optimization.

Methods

get_correlations()

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

Returns:

A correlation matrix.

Return type:

ndarray

prettyprint()

Returns a pretty printed string of this optimization result.

Returns:

A pretty printed string representing the result.

Return type:

str