QuantumGradientGenerators API
Index
QuantumGradientGenerators.GradGeneratorQuantumGradientGenerators.GradVectorQuantumGradientGenerators.GradgenOperatorQuantumGradientGenerators.resetgradvec!
Reference
QuantumGradientGenerators.GradGenerator — Type
Time-dependent gradient generator.
G_of_t = GradGenerator(H)for a time-dependent dynamical generator H (a Hamiltonian or Liouvillian $\hat{H}(t)$) that depends on the controls $ϵ_1(t), \dots, ϵ_L(t)$, constructs the gradient generator $G[\hat{H}](t)$. It contains H in G_of_t.H, the control derivatives $\hat{μ}_l(t) = \partial \hat{H}/\partial ϵ_l(t)$ in G_of_t.control_derivs, and the controls in G_of_t.controls.
For a dynamical generator $\hat{H}(t) = \hat{H}_0 + \sum_l ϵ_l(t) \hat{H}_l$, with $\hat{μ}_l = \hat{H}_l$, the gradient generator encodes the block matrix
\[G[\hat{H}] = \begin{pmatrix} \hat{H} & 0 & \dots & 0 & \hat{μ}_1 \\ 0 & \hat{H} & \dots & 0 & \hat{μ}_2 \\ \vdots & & \ddots & & \vdots \\ 0 & 0 & \dots & \hat{H} & \hat{μ}_L \\ 0 & 0 & \dots & 0 & \hat{H} \end{pmatrix}\,.\]
The control derivatives $\hat{μ}_l$ may be time-dependent, to account for non-linear controls.
Plugging in values for the controls with evaluate results in a static GradgenOperator.
QuantumGradientGenerators.GradVector — Type
Gradient vector for the dynamic gradient.
Ψ = GradVector(state, num_controls)creates a gradient vector $Ψ$ for $L$ = num_controls controls. It corresponds to the block column vector
\[Ψ = \begin{pmatrix} |Ψ^\prime_1⟩ \\ \vdots \\ |Ψ^\prime_L⟩ \\ |Ψ⟩ \end{pmatrix}\,,\]
with the state $|Ψ⟩$ in Ψ.state and the gradient states $|Ψ^\prime_l⟩$ in Ψ.grad_states[l]. Note that the gradient vector $Ψ$ is written without a ket, to distinguish it from the state $|Ψ⟩$. Upon initialization, $|Ψ⟩$ is a copy of state, and the gradient states are zero.
With a matching gradient generator $G = G[\hat{H}]$, see GradGenerator, we have
\[G Ψ = \begin{pmatrix} \hat{H} |Ψ^\prime_1⟩ + \hat{μ}_1 |Ψ⟩ \\ \vdots \\ \hat{H} |Ψ^\prime_L⟩ + \hat{μ}_L |Ψ⟩ \\ \hat{H} |Ψ⟩ \end{pmatrix}\]
and
\[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}\,.\]
QuantumGradientGenerators.GradgenOperator — Type
Static gradient generator.
using QuantumPropagators.Controls: evaluate
G = evaluate(G_of_t::GradGenerator, args...; vals_dict)
G = GradgenOperator(H, control_derivs)is the gradient generator $G[\hat{H}]$ for specific values of all controls, obtained by evaluating a time-dependent GradGenerator, or directly from a static dynamical generator H ($\hat{H}$) and a vector control_derivs of static control derivatives $\hat{μ}_l$. These are available as G.H and G.control_derivs.
The resulting object can be multiplied directly with a gradient vector GradVector, e.g., in the process of evaluating a piecewise-constant time propagation.
Since $G$ is block upper-triangular with $\hat{H}$ in all diagonal blocks, its eigenvalues are those of $\hat{H}$. Accordingly, eigvals, tr, det, and specrange (and thus the spectral range used by the Chebychev propagator) are evaluated from G.H, see the Properties of the gradient generator.
QuantumGradientGenerators.resetgradvec! — Method
Reset the given gradient vector for a new gradient evaluation.
resetgradvec!(Ψ::GradVector)zeroes out the gradient states Ψ.grad_states but leaves Ψ.state unaffected. This is possible whether or not Ψ supports in-place operations (QuantumPropagators.Interfaces.supports_inplace)
resetgradvec!(Ψ::GradVector, state)additionally sets Ψ.state to state, which requires that Ψ.state supports in-place operations.
Returns Ψ.