ScipyOptimizerGradient#

class ScipyOptimizerGradient(measure_and_gradient_func, optimization_map)[source]#

Bases: ScipyOptimizer

The 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

callback

Returns the callback function.

logger

Returns the current logger that is being used by this optimizer, or None if no logger was set yet.

method

Returns the currently selected optimization method.

optimization_map

Return the optimization map that this optimizer uses.

property callback: Callable | None#

Returns the callback function.

property logger: Logger | None#

Returns the current logger that is being used by this optimizer, or None if no logger was set yet.

property method: str#

Returns the currently selected optimization method.

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 times is 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:

OptimizationResult

set_options(opts)[source]#

Set the options for the system.

update_option(key, val)[source]#

Update one option for the system.