Skip to content

Commit dfe3f77

Browse files
committed
docs: clarify GRAPE usage for ExponentialUtilities
1 parent 30910cb commit dfe3f77

1 file changed

Lines changed: 47 additions & 3 deletions

File tree

docs/src/methods.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ As discussed in the [Overview](@ref overview_approaches), time propagation can b
1515
We consider this especially in the piecewise-constant case (`pwc=true` in [`propagate`](@ref)/[`init_prop`](@ref)), which is required for the traditional optimization methods [GRAPE](https://juliaquantumcontrol.github.io/GRAPE.jl/stable/) and [Krotov](https://juliaquantumcontrol.github.io/Krotov.jl/stable/). In these propagations, the time-dependent generator ``\op{H}(t)`` is [evaluated](@ref QuantumPropagators.Controls.evaluate) to a constant operator ``\op{H}`` on each interval of the time grid. The analytical solution to the Schrödinger or Liouville equation is well known, and propagation step simply has to evaluate the application of the time evolution operator ``\op{U} = \exp[-i \op{H} dt]`` to the state ``|Ψ⟩``. The following methods are built in to `QuantumPropagators`:
1616

1717
* [`ExpProp`](@ref method_expprop) – constructs ``\op{U}`` explicitly and then applies it to ``|Ψ⟩``
18-
* [`ExponentialUtilities`](@ref method_exponentialutilities) – applies ``\exp(\op{H} dt) |Ψ⟩`` using Krylov methods without explicitly forming ``\op{U}``
18+
* [`ExponentialUtilities`](@ref method_exponentialutilities) – applies ``\op{U} |Ψ⟩`` using Krylov methods without explicitly forming ``\op{U}``
1919
* [`Cheby`](@ref method_cheby) — expansion of ``\op{U} |Ψ⟩`` into Chebychev polynomials, valid if ``\op{H}`` has real eigenvalues
2020
* [`Newton`](@ref method_newton) – expansion of ``\op{U} |Ψ⟩`` into Newton polynomials, valid if ``\op{H}`` has complex eigenvalues (non-Hermitian Hamiltonian, Liouvillian)
2121

@@ -78,15 +78,59 @@ using ExponentialUtilities
7878
and then passed as `method=ExponentialUtilities` (or `method=:expv`) to
7979
[`propagate`](@ref) or [`init_prop`](@ref):
8080

81-
```@docs
82-
init_prop(state, generator, tlist, method::Val{:ExponentialUtilities}; kwargs...)
81+
```julia
82+
init_prop(
83+
state,
84+
generator,
85+
tlist,
86+
method::Val{:ExponentialUtilities};
87+
kwargs...
88+
)
8389
```
8490

8591
This method evaluates ``\exp(-i \op{H} dt) |Ψ⟩`` via a Krylov expv algorithm
8692
without explicitly forming the matrix exponential. It is therefore often a
8793
good fit for larger systems or matrix-free operators where direct matrix
8894
exponentiation is too costly.
8995

96+
Example initialization:
97+
98+
```julia
99+
using ExponentialUtilities
100+
101+
expv_propagator = init_prop(
102+
state,
103+
generator,
104+
tlist;
105+
method=ExponentialUtilities, # or :expv
106+
inplace=QuantumPropagators.Interfaces.supports_inplace(state),
107+
backward=false,
108+
verbose=false,
109+
parameters=nothing,
110+
expv_kwargs=(; ishermitian=false), # set for non-Hermitian generators
111+
convert_state=typeof(state),
112+
convert_operator=Matrix{ComplexF64},
113+
)
114+
```
115+
116+
**Method-specific keyword arguments**
117+
118+
* `expv_kwargs`: NamedTuple of keyword arguments forwarded to
119+
`ExponentialUtilities.expv`. Use this to set `ishermitian=false` for
120+
non-Hermitian generators (e.g., Liouvillians).
121+
* `convert_state`: Type to which to temporarily convert the state before
122+
calling `expv`.
123+
* `convert_operator`: Type to which to convert the operator before calling
124+
`expv`.
125+
126+
**GRAPE note**
127+
128+
* When using `method=:expv` with GRAPE, set `gradient_method=:taylor`.
129+
The default `:gradgen` path uses `GradVector`/`GradgenOperator`, which is
130+
not currently supported by the ExponentialUtilities Krylov backend.
131+
* For non-Hermitian generators (e.g., Liouvillians), pass
132+
`prop_expv_kwargs=(; ishermitian=false)` to avoid Hermitian-only paths.
133+
90134
**Advantages**
91135

92136
* Avoids explicit construction of ``\op{U}``

0 commit comments

Comments
 (0)