Krotov Package
Index
$\gdef\tgt{\text{tgt}}$ $\gdef\tr{\operatorname{tr}}$ $\gdef\Re{\operatorname{Re}}$ $\gdef\Im{\operatorname{Im}}$
Krotov.KrotovResultKrotov.PulseParametrizationKrotov.LogisticParametrizationKrotov.LogisticSqParametrizationKrotov.NoParametrizationKrotov.SquareParametrizationKrotov.TanhParametrizationKrotov.TanhSqParametrizationKrotov.optimize_krotovKrotov.print_table
Krotov
Public
LogisticParametrizationLogisticSqParametrizationSquareParametrizationTanhParametrizationTanhSqParametrization
Krotov.LogisticParametrization — FunctionParametrization with a Logistic function that enforces ϵmin < ϵ(t) < ϵmax.
Krotov.LogisticSqParametrization — FunctionParametrization with a Logistic-Square function that enforces 0 ≤ ϵ(t) < ϵ_max.
Krotov.SquareParametrization — FunctionParametrization ϵ(t) = u²(t), enforcing pulse values ≥ 0.
Krotov.TanhParametrization — FunctionParametrization with a tanh function that enforces ϵmin < ϵ(t) < ϵmax.
Krotov.TanhSqParametrization — FunctionParametrization with a tanh² function that enforces $0 ≤ ϵ(t) < ϵ_max$.
Private
Krotov.PulseParametrization — TypeSpecification 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_krotov — FunctionOptimize a control problem using Krotov's method.
result = optimize_krotov(problem)optimizes the given control problem, returning a KrotovResult.
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 functionJ_T(ϕ, objectives)that evaluates the final time functional from a listϕof forward-propagated states andproblem.objectives.
Recommended problem keyword arguments
pulse_options: A dictionary that maps every control (as obtained bygetcontrolsfrom theproblem.objectives) to the following dict::lambda_a: The value for inverse Krotov step width λₐ:update_shape: A functiont -> S(t)for the "update shape" that scaled the Krotov pulse update.
If
pulse_optionsis 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 functionchi!(χ, ϕ, objectives)what receives a listϕof the forward propagated states and must set $|χₖ⟩ = -∂J_T/∂⟨ϕₖ|$. If not given, it will be automatically determined fromJ_Tviamake_chiwith 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 numberiter_stop=5000: the maximum iteration numberprop_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 asupdate_hook, in order to write information about the current iteration to the screen or to a file. The defaultinfo_hookprints a table with convergence information to the screen. Runs afterupdate_hook. Theinfo_hookfunction may return a tuple, which is stored in the list ofrecordsinside theKrotovResultobject.check_convergence: a function to check whether convergence has been reached. Receives aKrotovResultobjectresult, and should setresult.convergedtotrueandresult.messageto 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 toupdate_hookandinfo_hook.verbose=false: Iftrue, 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_methodkeyword argument - a
prop_methodkeyword argument - a property
fw_prop_methodof the objective - a property
prop_methodof 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.KrotovResult — TypeResult object returned by optimize_krotov.
Krotov.NoParametrization — FunctionParametrization where $ϵ(t) ≡ u(t)$.
Krotov.print_table — FunctionPrint optimization progress as a table.
This functions serves as the default info_hook for an optimization with Krotov's method.