QuantumGradientGenerators
Documentation for QuantumGradientGenerators.
Overview
Consider a dynamical generator $\hat{H}$ (a Hamiltonian or a Liouvillian) that depends on the control functions $ϵ_1(t), \dots, ϵ_L(t)$, with the control derivatives $\hat{μ}_l = \partial \hat{H} / \partial ϵ_l$. Gradient-based quantum control methods like GRAPE require the derivative $\frac{\partial}{\partial ϵ_l} e^{-i \hat{H} dt} |Ψ⟩$ of a single time step of a piecewise-constant time propagation.
The gradient generator $G = G[\hat{H}]$ is a block operator with $\hat{H}$ on the diagonal and the $\hat{μ}_l$ in the last block column, see GradGenerator. It acts on gradient vectors
\[Ψ = \begin{pmatrix} |Ψ^\prime_1⟩ \\ \vdots \\ |Ψ^\prime_L⟩ \\ |Ψ⟩ \end{pmatrix}\,,\]
see GradVector, that contain the gradient states $|Ψ^\prime_l⟩$ in addition to the state $|Ψ⟩$. The gradient vector $Ψ$ is written without a ket, to distinguish it from the state $|Ψ⟩$. Propagating a gradient vector with zero gradient states under $G$ for a single time step yields the derivatives of the propagated state with respect to all controls,
\[e^{-i G dt} \begin{pmatrix} 0 \\ \vdots \\ 0 \\ |Ψ⟩ \end{pmatrix} = \begin{pmatrix} \frac{\partial}{\partial ϵ_1} e^{-i \hat{H} dt} |Ψ⟩ \\ \vdots \\ \frac{\partial}{\partial ϵ_L} e^{-i \hat{H} dt} |Ψ⟩ \\ e^{-i \hat{H} dt} |Ψ⟩ \end{pmatrix}\,.\]
Any of the methods in QuantumPropagators can evaluate this propagation. See the Background for a proof, the interpretation of gradient vectors as dual numbers in forward-mode automatic differentiation, and the generalization to time-dependent generators and to parameterized pulses. For a backward propagation, as in GRAPE, construct the gradient generator $G[\hat{H}^\dagger]$ from the adjoint generator $\hat{H}^\dagger$. Its last block column then contains $\hat{μ}^\dagger_l$.
In the code, a gradient generator G holds $\hat{H}$ in G.H and $\hat{μ}_l$ in G.derivs[l], and a gradient vector Ψ holds $|Ψ⟩$ in Ψ.state and $|Ψ^\prime_l⟩$ in Ψ.grad_states[l]. A time-dependent GradGenerator evaluates to a static GradgenOperator for specific values of the controls.
Instead of the controls, the derivatives may be with respect to the control parameters $u_1, \dots, u_M$ that the controls depend on, e.g., the coefficients of a CRAB expansion or the amplitude of an analytic pulse. Then, $\hat{μ}_n = \partial \hat{H} / \partial u_n$, and propagating a gradient vector over the entire time interval yields the derivatives of the final state with respect to all parameters at once, as in GOAT [1]. The gradient generator for the parameters u = get_parameters(H) is GradGenerator(H; wrt = u). See the how-to guide.
Since the gradient states couple only to the state, a gradient generator with many derivatives can be split into smaller ones for groups of the derivatives, and the gradient vectors of the groups can be propagated in parallel, see Splitting and Parallelization.
Contents
History
See the Releases on Github.