CTLie
CTLie is a foundational package of the control-toolbox ecosystem. It provides the differential-geometric operators used in geometric optimal control: the Hamiltonian lift, the Lie derivative and Lie bracket of vector fields, the Poisson bracket of Hamiltonians, and the partial time derivative. All of these are also available through a single convenience macro, @Lie.
This guide is aimed at advanced users and developers. Each operator is presented first with its mathematical definition, then with runnable examples — both on plain Julia Functions and on the typed objects (VectorField, Hamiltonian) — across the various trait combinations (autonomous or not, fixed or not).
Reading order
| Page | Operator | Mathematical object |
|---|---|---|
| Hamiltonian lift | Lift | |
| Lie derivative & bracket | ad | |
| Poisson bracket | Poisson | |
| Partial time derivative | ∂ₜ | |
The @Lie macro | @Lie | |
| Limitations & configuration | — | constraints, AD backend |
Mathematical setting
We work on a state space
A vector field is a map
.A Hamiltonian is a scalar map
, .
The operators may additionally depend on time
Installation and access
CTLie exports its operators directly: a single using CTLie brings Lift, ad, Poisson, ∂ₜ and @Lie into scope:
using CTLie # Lift, ad, Poisson, ∂ₜ, @LieAutomatic differentiation is provided by a pluggable backend. The default relies on DifferentiationInterface.jl, which must be loaded for ad, Poisson and ∂ₜ to compute gradients and derivatives:
import DifferentiationInterface # activates the AD backend extensionSee Limitations & configuration for how to select another backend.
Notation summary
| Mathematics | Julia |
|---|---|
| Hamiltonian lift | Lift(X) |
| Lie derivative | ad(X, f) |
| Lie bracket | ad(X, Y), @Lie [X, Y] |
| Poisson bracket | Poisson(H, G), @Lie {H, G} |
| Partial time derivative | ∂ₜ(·) |