Krotov Package

Index

$\gdef\tgt{\text{tgt}}$ $\gdef\tr{\operatorname{tr}}$ $\gdef\Re{\operatorname{Re}}$ $\gdef\Im{\operatorname{Im}}$

Krotov

Public

Private

Krotov.PulseParametrizationType

Specification for a "time-local" pulse parametrization.

The parametrization is given as a collection of three functions:

  • $ϵ(u(t))$
  • $u(ϵ(t))$
  • $∂ϵ/∂u$ as a function of $u(t)$.
Krotov.optimize_krotovFunction

Optimize a control problem using Krotov's method.

result = optimize_krotov(problem)

optimizes the given control problem, returning a KrotovResult.

Note

It is recommended to call optimize with method=:krotov instead of calling optimize_krotov directly.

Keyword arguments that control the optimization are taken from the keyword arguments used in the instantiation of problem.

Required problem keyword arguments

  • J_T: A function J_T(ϕ, objectives) that evaluates the final time functional from a list ϕ of forward-propagated states and problem.objectives.

Recommended problem keyword arguments

  • pulse_options: A dictionary that maps every control (as obtained by getcontrols from the problem.objectives) to the following dict:

    • :lambda_a: The value for inverse Krotov step width λₐ
    • :update_shape: A function t -> S(t) for the "update shape" that scaled the Krotov pulse update.

    If pulse_options is not given, $λₐ = 1$ and $S(t) ≡ 1$ are used for all controls.

Optional problem keyword arguments

The following keyword arguments are supported (with default values):

  • chi: A function chi!(χ, ϕ, objectives) what receives a list ϕ of the forward propagated states and must set $|χₖ⟩ = -∂J_T/∂⟨ϕₖ|$. If not given, it will be automatically determined from J_T via make_chi with the default parameters.
  • sigma=nothing: Function that calculate the second-order contribution. If not given, the first-order Krotov method is used.
  • iter_start=0: the initial iteration number
  • iter_stop=5000: the maximum iteration number
  • prop_method/fw_prop_method/bw_prop_method: The propagation method to use for each objective, see below.
  • update_hook: A function that receives the Krotov workspace, the iteration number, the list of updated pulses and the list of guess pulses as positional arguments. The function may mutate any of its arguments. This may be used e.g. to apply a spectral filter to the updated pulses, or to update propagation workspaces inside the Krotov workspace.
  • info_hook: A function that receives the same argumens as update_hook, in order to write information about the current iteration to the screen or to a file. The default info_hook prints a table with convergence information to the screen. Runs after update_hook. The info_hook function may return a tuple, which is stored in the list of records inside the KrotovResult object.
  • check_convergence: a function to check whether convergence has been reached. Receives a KrotovResult object result, and should set result.converged to true and result.message to an appropriate string in case of convergence. Multiple convergence checks can be performed by chaining functions with . The convergence check is performed after any calls to update_hook and info_hook.
  • verbose=false: If true, print information during initialization

The propagation method for the forward propagation of each objective is determined by the first available item of the following:

  • a fw_prop_method keyword argument
  • a prop_method keyword argument
  • a property fw_prop_method of the objective
  • a property prop_method of the objective
  • the value :auto

The propagation method for the backword propagation is determined similarly, but with bw_prop_method instead of fw_prop_method.

Krotov.print_tableFunction

Print optimization progress as a table.

This functions serves as the default info_hook for an optimization with Krotov's method.