class Result(*, best_cost=None, best_output=None, state=None, cost_history=None, metadata=None, errors=None, action=None)

The result of a stochastic optimization. It includes the minimized cost \(C(\mathbf v_\mathrm{optimized})\), and the outputs \(\{s_j: F_j(\mathbf v_\mathrm{optimized})\}\) corresponding to the variables that achieve that minimum cost.

  • best_cost (float, optional) – The minimum cost function value \(C(\mathbf v_\mathrm{optimized})\) achieved across all iterations.

  • best_output (dict, optional) – The dictionary giving the value of each requested output node, evaluated at the optimized variables, namely \(\{s_j: F_j(\mathbf v_\mathrm{optimized})\}\). The keys of the dictionary are the names \(\{s_j\}\) of the output nodes. If any of the output nodes depend on random nodes, the random values used to calculate the output might not correspond to the values used to calculate the best cost.

  • state (str, optional) – The encoded optimizer state. You can use this parameter to resume the optimization from the current step.

  • cost_history (qctrl.dynamic.types.stochastic_optimization.CostHistory, optional) – The evolution of the cost function across iterations.

  • metadata (dict, optional) – Metadata associated with the optimization. No guarantees are made about the contents of this metadata dictionary; the contained information is intended purely to help interpret the results of the optimization on a one-off basis.

  • errors (List[qctrl.dynamic.types.Error], optional) – Related validation errors.

  • action (qctrl.dynamic.types.CoreAction, optional) – Metadata about the execution of the function.