Skip to content

Hamiltonian lift

The Hamiltonian lift of a vector field is the scalar function on the cotangent bundle obtained by pairing the costate with :

This is a purely algebraic operation — it uses no automatic differentiation. The lift is the bridge from the velocity picture (vector fields) to the Hamiltonian picture (scalar functions on phase space), and it is the building block of the Pontryagin maximum principle: the pseudo-Hamiltonian is a sum of lifts of the drift and control vector fields.

When depends on time and/or a variable , the lift carries the same dependence:

The relevant method is Lift.

On plain functions

Given a Julia Function, Lift returns a Function with the matching call signature. The traits are read from the is_autonomous and is_variable keyword arguments (both default to autonomous/fixed).

Autonomous, fixed — X(x)

julia
X = x -> [x[2], -x[1]]
H = Lift(X)
H([1.0, 2.0], [0.5, 1.0])      # p' * X(x) = 0.5*2 + 1.0*(-1)
0.0

Non-autonomous — X(t, x)

julia
Xt = (t, x) -> [t * x[2], -x[1]]
Ht = Lift(Xt; is_autonomous=false)
Ht(2.0, [1.0, 2.0], [0.5, 1.0])   # p' * X(t, x)
1.0

Variable-dependent — X(x, v)

julia
Xv = (x, v) -> [x[2], -v * x[1]]
Hv = Lift(Xv; is_variable=true)
Hv([1.0, 2.0], [0.5, 1.0], 3.0)   # p' * X(x, v)
-2.0

Non-autonomous and variable-dependent — X(t, x, v)

julia
Xtv = (t, x, v) -> [t * x[2], -v * x[1]]
Htv = Lift(Xtv; is_autonomous=false, is_variable=true)
Htv(2.0, [1.0, 2.0], [0.5, 1.0], 3.0)
-1.0

On typed vector fields

When the argument is a typed VectorField, Lift returns a typed Hamiltonian whose traits are inherited from the vector field — no keyword arguments are needed.

julia
Xt = VectorField(x -> [x[2], -x[1]]; is_autonomous=true, is_variable=false)
H  = Lift(Xt)
Hamiltonian: autonomous, fixed (no variable)
  natural call: h(x, p)
  uniform call: h(t, x, p, v)
julia
H([1.0, 2.0], [0.5, 1.0])
0.0

The same works for every trait combination; here a non-autonomous, variable-dependent field:

julia
Xtv = VectorField((t, x, v) -> [t * x[2], -v * x[1]];
                  is_autonomous=false, is_variable=true)
Htv = Lift(Xtv)
Htv(2.0, [1.0, 2.0], [0.5, 1.0], 3.0)
-1.0

Not for Hamiltonian vector fields

Lift accepts a plain VectorField, not a HamiltonianVectorField: the latter already lives on phase space with signature (x, p). Lifting one raises a NotImplemented error — see Limitations & configuration.

See also

  • Lift — full docstring and method list.

  • Poisson bracket — the lift connects Lie brackets of vector fields to Poisson brackets of their lifts (see the correspondence verified there).