symplectic
The geodesic equation is usually solved in the classic Lagrangian form, however it also admits a Hamiltonian. This hamiltonian is non-separable, meaning that standard methods for integration are not feasible. Recently, an approach for integration of non-separable Hamiltonians has been developed, doubling the phase-space and evolving states in parallel.123 Riemax provides an implementation of this approach for defining dynamics of geodesics upto arbitrary orders of integration.
Additional documentation required.
This documentation requires further explanation of the method for integration of non-separable Hamiltonians. This page will be updated in future iterations of the documentation to make the process as clear as possible.
riemax.manifold.symplectic
riemax.manifold.symplectic.SymplecticGeodesicState
Bases: typing.NamedTuple
PyTree for Symplectic Geodesic State.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
q |
position on the geodesic |
required | |
p |
conjugate momenta on the co-tangent space |
required |
Source code in src/riemax/manifold/symplectic.py
from_lagrangian(state: TangentSpace[jax.Array], metric: MetricFn) -> SymplecticGeodesicState
classmethod
Build Hamiltonian symplectic state from given Lagrangian state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
riemax.manifold.types.TangentSpace[jax.Array]
|
Geodesic state in Lagrangian coordinates. |
required |
metric |
riemax.manifold.types.MetricFn
|
Function used to evaluate the metric. |
required |
Returns:
Type | Description |
---|---|
riemax.manifold.symplectic.SymplecticGeodesicState
|
Symplectic state in Hamiltonian coordinates. |
Source code in src/riemax/manifold/symplectic.py
to_lagrangian(metric: MetricFn) -> TangentSpace[jax.Array]
Convert intrinstic Hamiltonian coordinates to Lagrangian coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metric |
riemax.manifold.types.MetricFn
|
Function used to evaluate the metric. |
required |
Returns:
Type | Description |
---|---|
riemax.manifold.types.TangentSpace[jax.Array]
|
Geodesic state in Lagrangian coordinates. |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.PhaseDoubledSymplecticGeodesicState
Bases: typing.NamedTuple
PyTree for the phase-doubled Symplectic Geodesic State
Parameters:
Name | Type | Description | Default |
---|---|---|---|
q |
position on the geodesic |
required | |
p |
conjugate momenta on the co-tangent space |
required | |
x |
phase-doubled position on the geodesic |
required | |
y |
phase-doubled conjugate momenta on the co-tangent space |
required |
Source code in src/riemax/manifold/symplectic.py
from_symplectic(state: SymplecticGeodesicState) -> PhaseDoubledSymplecticGeodesicState
classmethod
Build phase-doubled symplectic state from given symplectic state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
riemax.manifold.symplectic.SymplecticGeodesicState
|
Symplectic state in a single phase-space. |
required |
Returns:
Type | Description |
---|---|
riemax.manifold.symplectic.PhaseDoubledSymplecticGeodesicState
|
Phase-doubled symplectic state, replicating state in new phase-space. |
Source code in src/riemax/manifold/symplectic.py
to_symplectic() -> SymplecticGeodesicState
Transform phase-doubled symplectic state to a single-phase symplectic state.
Returns:
Type | Description |
---|---|
riemax.manifold.symplectic.SymplecticGeodesicState
|
Single-phase symplectic state -- removing phase-doubling. |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.SymplecticParams
Bases: typing.NamedTuple
Contained for parameters of symplectic integration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metric |
function defining the metric tensor on the manifold |
required | |
dt |
time-step used for the integration |
required | |
omega |
strength of the constraint between the phase-split copies |
required | |
n_steps |
number of steps to integrate for |
required |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.hamiltonian(q: jax.Array, conjugate_momenta: jax.Array, metric: MetricFn) -> jax.Array
Computes the Hamiltonian of the state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
q |
jax.Array
|
position on the geodesic |
required |
conjugate_momenta |
jax.Array
|
conjugate momenta of the geodesic path |
required |
metric |
riemax.manifold.types.MetricFn
|
function defining the metric tensor on the manifold |
required |
Returns:
Type | Description |
---|---|
jax.Array
|
hamiltonian of the geodesic |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.second_order_dynamics(state: PhaseDoubledSymplecticGeodesicState, dt: float, omega: float, metric: MetricFn) -> PhaseDoubledSymplecticGeodesicState
Conduct time-step using second-order dynamics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
riemax.manifold.symplectic.PhaseDoubledSymplecticGeodesicState
|
current state of the symplectic integrator |
required |
dt |
float
|
time-step used for the integration |
required |
omega |
float
|
strength of the constraint between the phase-split copies |
required |
metric |
riemax.manifold.types.MetricFn
|
function defining the metric tensor on the manifold |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
riemax.manifold.symplectic.PhaseDoubledSymplecticGeodesicState
|
time-stepped, phase-doubled symplectic geodesic state |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.construct_nth_order_dynamics(n: int)
Construct nth order symplectic dynamics.
Recursive definition:
Function works recursively, producing additional phase-maps as required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n |
int
|
order of integration to produce |
required |
Returns:
Type | Description |
---|---|
function to compute nth order dynamics |
Source code in src/riemax/manifold/symplectic.py
riemax.manifold.symplectic.construct_nth_order_symplectic_integrator(n: int) -> PhaseDoubledSymplecticIntegrator
Construct symplectic integrator of the nth order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n |
int
|
order of integration required |
required |
Returns:
Type | Description |
---|---|
riemax.manifold.symplectic.PhaseDoubledSymplecticIntegrator
|
integrator for phase-doubled symplectic state |
Source code in src/riemax/manifold/symplectic.py
-
Christian, Pierre, and Chi-kwan Chan. ‘FANTASY: User-Friendly Symplectic Geodesic Integrator for Arbitrary Metrics with Automatic Differentiation’. The Astrophysical Journal 909, 2021. https://doi.org/10.3847/1538-4357/abdc28 ↩
-
Tao, Molei. ‘Explicit Symplectic Approximation of Nonseparable Hamiltonians: Algorithm and Long Time Performance’. Physical Review E 94, 2016. https://doi.org/10.1103/PhysRevE.94.043303 ↩
-
Yoshida, Haruo. ‘Construction of Higher Order Symplectic Integrators’. Physics Letters A, 1990. https://doi.org/10.1016/0375-9601(90)90092-3 ↩