openfermioncirq.optimization.OptimizationResult

class openfermioncirq.optimization.OptimizationResult(optimal_value: float, optimal_parameters: numpy.ndarray, num_evaluations: Optional[int] = None, cost_spent: Optional[float] = None, function_values: Optional[List[Tuple[float, Optional[float], Optional[numpy.ndarray]]]] = None, wait_times: Optional[List[float]] = None, time: Optional[int] = None, seed: Optional[int] = None, status: Optional[int] = None, message: Optional[str] = None)[source]

A result from optimizing a black-box objective function.

optimal_value

The best value of the objective function found by the optimizer.

optimal_parameters

The inputs to the objective function which yield the optimal value.

num_evaluations

The number of times the objective function was evaluated in the course of the optimization.

cost_spent

For objective functions with a cost model, the total cost spent on function evaluations.

function_values

A list of tuples storing function values of evaluated points. The tuples contain three objects. The first is a function value, the second is the cost that was used for the evaluation (or None if there was no cost), and the third is the point that was evaluated (or None if the black box was initialized with save_x_vals set to False).

wait_times

A list of floats. The i-th float float represents the time elapsed between the i-th and (i+1)-th times that the black box was queried. Time is recorded using time.time().

time

The time, in seconds, it took to obtain the result.

seed

A random number generator seed used to produce the result.

status

A status flag set by the optimizer.

message

A message returned by the optimizer.

__init__(optimal_value: float, optimal_parameters: numpy.ndarray, num_evaluations: Optional[int] = None, cost_spent: Optional[float] = None, function_values: Optional[List[Tuple[float, Optional[float], Optional[numpy.ndarray]]]] = None, wait_times: Optional[List[float]] = None, time: Optional[int] = None, seed: Optional[int] = None, status: Optional[int] = None, message: Optional[str] = None) → None[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(optimal_value, optimal_parameters, …) Initialize self.