Skip to content

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

PageOperatorMathematical object
Hamiltonian liftLift 
Lie derivative & bracketad  and
Poisson bracketPoisson
Partial time derivative∂ₜ
The @Lie macro@Lie    and    
Limitations & configurationconstraints, AD backend

Mathematical setting

We work on a state space   and its cotangent bundle with canonical coordinates   .

  • A vector field is a map   .

  • A Hamiltonian is a scalar map   ,  .

The operators may additionally depend on time and on a variable parameter (a decision variable, e.g. a free final time or a design parameter). Which of these extra arguments appear is encoded by the trait system below.

Installation and access

CTLie exports its operators directly: a single using CTLie brings Lift, ad, Poisson, ∂ₜ and @Lie into scope:

julia
using CTLie   # Lift, ad, Poisson, ∂ₜ, @Lie

Automatic 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:

julia
import DifferentiationInterface   # activates the AD backend extension

See Limitations & configuration for how to select another backend.

Notation summary

MathematicsJulia
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 ∂ₜ(·)