kestrelquantum / QuantumCollocation.jl

Quantum Optimal Control with Direct Collocation
MIT License
30 stars 7 forks source link

[Benchmark]: Exponential derivatives improvement #143

Open andgoldschmidt opened 3 months ago

andgoldschmidt commented 3 months ago

Feature Description

Background

Often, we rely on automatic differentiation support of the matrix exponential. We currenly rely on expv from ExponentialAction.jl to accomplish this. This might be appropriate---especially because we usually have Jacobian-vector products---but it would be good to benchmark. In particular, see this issue thread and the following comparison. https://github.com/JuliaDiff/ForwardDiff.jl/issues/174#issuecomment-1203758010 In that thread, there is also a reference to a paper, which---see Thm 2---computes the Jacobian of the matrix exponential using the eigendecomposition. This has some similarity to hermitian_exp(...) in _exponentialintegrators.jl, and might be a practical way to implement the derivative.

Places where we use an exponential integrator include:

See also: https://docs.sciml.ai/ExponentialUtilities/stable/matrix_exponentials/

Suggested checklist

For integrators.jl

For rollouts.jl

Importance

1 (lowest)

What does this feature affect?

Other information

No response