Skip to content

Commit 71b8e1c

Browse files
committed
Define Krotov-specific optimization functional
1 parent 3080439 commit 71b8e1c

File tree

2 files changed

+62
-5
lines changed

2 files changed

+62
-5
lines changed

docs/make.jl

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using QuantumControl
22
using QuantumPropagators
33
using Krotov
44
using Documenter
5+
using Documenter.HTMLWriter: KaTeX
56
using DocumenterCitations
67
using DocumenterInterLinks
78
using Pkg
@@ -22,6 +23,17 @@ if endswith(VERSION, "dev")
2223
DEV_OR_STABLE = "dev/"
2324
end
2425

26+
27+
function org_inv(pkgname)
28+
objects_inv =
29+
joinpath(@__DIR__, "..", "..", "$pkgname.jl", "docs", "build", "objects.inv")
30+
if isfile(objects_inv)
31+
return ("https://juliaquantumcontrol.github.io/$pkgname.jl/dev/", objects_inv,)
32+
else
33+
return "https://juliaquantumcontrol.github.io/$pkgname.jl/$DEV_OR_STABLE"
34+
end
35+
end
36+
2537
links = InterLinks(
2638
"Julia" => (
2739
"https://docs.julialang.org/en/v1/",
@@ -32,9 +44,9 @@ links = InterLinks(
3244
"https://github.com/KristofferC/TimerOutputs.jl",
3345
joinpath(@__DIR__, "src", "inventories", "TimerOutputs.toml")
3446
),
35-
"QuantumPropagators" => "https://juliaquantumcontrol.github.io/QuantumPropagators.jl/$DEV_OR_STABLE",
36-
"QuantumControl" => "https://juliaquantumcontrol.github.io/QuantumControl.jl/$DEV_OR_STABLE",
37-
"GRAPE" => "https://juliaquantumcontrol.github.io/GRAPE.jl/$DEV_OR_STABLE",
47+
"QuantumPropagators" => org_inv("QuantumPropagators"),
48+
"QuantumControl" => org_inv("QuantumControl"),
49+
"GRAPE" => org_inv("GRAPE"),
3850
"Examples" => "https://juliaquantumcontrol.github.io/QuantumControlExamples.jl/$DEV_OR_STABLE",
3951
"ComponentArrays" => (
4052
"https://jonniedie.github.io/ComponentArrays.jl/stable/",
@@ -79,7 +91,17 @@ makedocs(;
7991
),
8092
],
8193
size_threshold_ignore=["externals.md"],
82-
mathengine=KaTeX(),
94+
mathengine=KaTeX(
95+
Dict(
96+
:macros => Dict(
97+
"\\Op" => "\\hat{#1}",
98+
"\\ket" => "\\vert#1\\rangle",
99+
"\\bra" => "\\langle#1\\vert",
100+
"\\Im" => "\\operatorname{Im}",
101+
"\\Re" => "\\operatorname{Re}",
102+
),
103+
),
104+
),
83105
footer="[$NAME.jl]($GITHUB) v$VERSION docs powered by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).",
84106
),
85107
pages=PAGES,

src/optimize.jl

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,42 @@ result = optimize(problem; method=Krotov, kwargs...)
2020
```
2121
2222
optimizes the given control [`problem`](@ref QuantumControl.ControlProblem)
23-
using Krotov's method, returning a [`KrotovResult`](@ref).
23+
using Krotov's method, by minimizing the functional
24+
25+
```math
26+
J(\{ϵ_l(t)\}) =
27+
J_T(\{|Ψ_k(T)⟩\})
28+
+ ∑_l \int_{0}^{T} \frac{λ_{a,l}}{S_l(t)} [ϵ_l(t) - ϵ_l^{(0)}(t)]^2 \, dt\,,
29+
```
30+
31+
cf. the [general form of a quantum control functional](@ref "Functional").
32+
The "reference field" ``ϵ_l^{(0)}(t)`` is the guess control for that particular
33+
iteration. The above functional implies a first-order update equation
34+
35+
```math
36+
Δϵ_l(t) = \frac{S_l(t)}{λ_{a,l}} \Im ∑_k \left[
37+
\Big\langle
38+
\chi_k^{(0)}(t)
39+
\Big\vert
40+
\frac{\partial \hat{H}_k}{\partial ϵ_l(t)}
41+
\Big\vert
42+
\Psi_k(t)
43+
\Big\rangle
44+
\right]\,,
45+
```
46+
47+
where ``|\chi^{(0)}_k(t)⟩`` is the state backward-propagated under
48+
``Ĥ_k^{\dagger}(\{ϵ_l^{(0)}(t)\})`` with the boundary condition
49+
``|\chi_k(T)⟩ = \partial J_T / \partial ⟨Ψ_k^{(0)}(T)|`` and ``Ĥ_k`` is
50+
the `generator` of the ``k``'th trajectory.
51+
52+
Note that the particular control-dependent running cost in the above functional
53+
is required to obtain the given Krotov update equation. Other running costs, or
54+
state-dependent running costs are not supported in this implementation of
55+
Krotov's method (even though *some* running costs are mathematically compatible
56+
with Krotov's method).
57+
58+
Returns a [`KrotovResult`](@ref).
2459
2560
Keyword arguments that control the optimization are taken from the keyword
2661
arguments used in the instantiation of `problem`; any of these can be overridden

0 commit comments

Comments
 (0)