ScipyOptimizerGradient#
- class ScipyOptimizerGradient(measure_and_gradient_func, optimization_map)[source]#
Bases:
ScipyOptimizerThe Scipy Optimizer gradient model.
Minimize the outcome of a measurement with the Scipy optimization package by providing gradient values.
- __init__(measure_and_gradient_func, optimization_map)[source]#
- Parameters:
measure_and_gradient_func (Callable[[Array], tuple[Float, Array]]) – Function implementing measurement of observables to be minimized, returning (value, gradient).
optimization_map (OptimizationMap) – An optimization map containing all parameters that can be optimized.
Methods
__init__(measure_and_gradient_func, ...)optimize(times)Optimize via the Scipy optimizer gradient model.
set_options(opts)Set the options for the system.
update_option(key, val)Update one option for the system.
Attributes
Returns the callback function.
Returns the current logger that is being used by this optimizer, or None if no logger was set yet.
Returns the currently selected optimization method.
Return the optimization map that this optimizer uses.
- property logger: Logger | None#
Returns the current logger that is being used by this optimizer, or None if no logger was set yet.
- property optimization_map: OptimizationMap#
Return the optimization map that this optimizer uses.
Parameters that can be optimized need to be added to this map.
- Returns:
The optimization map that this optimizer uses.
- optimize(times)[source]#
Optimize via the Scipy optimizer gradient model.
Performs the actual optimization.
Note
If input
timesis a float, then the start time of propagation is implicitly assumed to be zero. For an array of times, the first time point is the start time.- Parameters:
times (Array | float) – Array of times or a float (assumed start time zero).
- Returns:
The result of the optimization.
- Return type: