Result

class qctrl.dynamic.types.stochastic_optimization.Result(*, best_cost=None, best_output=None, state=None, metadata=None, errors=None, action=None)

The result of an 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.

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

  • 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.

  • 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.