maps
The riemax.manifold.maps
module allows the user to define the exponential and log maps on a manifold. These are defined using the geodesic dynamics, defined in riemax.manifold.geodesic
.
Types:
type ExponentialMap = tp.Callable[[TangentSpace[jax.Array]], tuple[M[jax.Array], TangentSpace[jax.Array]]]
type LogMap[*Ts] = tp.Callable[[M[jax.Array], M[jax.Array], *Ts], tuple[TangentSpace[jax.Array], bool]]
Exponential Map
Suppose we have a continuous, differentiable manifold, \(M\). Given a point \(p \in M\), and tangent vector \(v \in T_p M\), there exists a unique geodesic \(\gamma_v : [0, 1] \rightarrow M\) satisfying \(\gamma_v(0) = p\), \(\dot{\gamma}_v(0) = v\). The exponential map is defined by \(\exp_p(v) = \gamma_v(1)\), or \(\exp_p : T_p M \rightarrow M\).
Log Map
Given two points \(p, q \in M\), the \(\log\) map provides the tangent-vector which, upon application of the exponential map, transports one point to the other. The log map is the natural inverse of the exponential map, defined as \(\log_p(q) = v\) such that \(\exp_p(\log_p(q)) = q\). This mapping is not unique as there may be many tangent-vectors which connect the two points \(p, q\).
Shooting Solver
Ordinarily, we would consider computing the \(\log\) map a two-point boundary value problem. We can approach this using a shooting method, posing the problem: find \(v \in T_p M\) such that \(\exp_p (v) = q\). We define the residual
and use a root-finding technique, such as Newton-Raphson, to obtain a solution. While this remains a principled approach, it is somewhat reliant on having a good initial guess for the solution.
riemax.manifold.maps
riemax.manifold.maps.exponential_map_factory(integrator: Integrator[TangentSpace[jax.Array]], dt: float, metric: MetricFn, n_steps: int | None = None) -> ExponentialMap
Produce an exponential map, \(\exp: TM \rightarrow M\).
Example:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
integrator |
riemax.numerical.integrators.Integrator[riemax.manifold.types.TangentSpace[jax.Array]]
|
choice of integrator used to propgate dynamics |
required |
dt |
float
|
time-step for the integration |
required |
metric |
riemax.manifold.types.MetricFn
|
function defining the metric tensor on the manifold |
required |
n_steps |
int | None
|
number of steps to integrate for |
None
|
Returns:
Name | Type | Description |
---|---|---|
exp_map |
ExponentialMap
|
function for computing exponential map |
Source code in src/riemax/manifold/maps.py
riemax.manifold.maps.symplectic_exponential_map_factory(integrator: LagrangianSymplecticIntegrator, dt: float, omega: float, metric: MetricFn, n_steps: int | None = None) -> ExponentialMap
Produce an exponential map, \(\exp: TM \rightarrow M\), using symplectic dynamics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
integrator |
riemax.manifold.symplectic.LagrangianSymplecticIntegrator
|
choice of Lagrangian symplectic integrator used to propgate dynamics |
required |
dt |
float
|
time-step 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 |
n_steps |
int | None
|
number of steps to integrate for |
None
|
Returns:
Name | Type | Description |
---|---|---|
exp_map |
ExponentialMap
|
function for computing exponential map |
Source code in src/riemax/manifold/maps.py
riemax.manifold.maps.shooting_log_map_factory(exp_map: ExponentialMap, nr_parameters: NewtonRaphsonParams | None = None) -> LogMap
Produce log map, computed using a shooting method.
Efficacy of Shooting Solvers:
Shooting solvers typically require a good initial guess. If the initial guess for the velocity vector is too far from a true solution, this can tend to fail. We also note that, this does not guarantee obtaining the velocity vector of the globally length-minimising geodesic -- only of a valid geodesic which connects the two points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exp_map |
ExponentialMap
|
function used to compute the exponential map |
required |
nr_parameters |
riemax.numerical.newton_raphson.NewtonRaphsonParams | None
|
parameters used in the Newton-Raphson optimisation |
None
|
Returns:
Name | Type | Description |
---|---|---|
log_map |
LogMap
|
function to compute the log map between \(p, q \in M\) |
Source code in src/riemax/manifold/maps.py
riemax.manifold.maps.minimising_log_map_factory(metric: MetricFn, optimiser: optax.GradientTransformation, num_nodes: int = 20, n_collocation: int = 100, iterations: int = 100, tol: float = 0.0001) -> LogMap
Produce a log-map using an energy-minimising approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metric |
riemax.manifold.types.MetricFn
|
function defining the metric tensor on the manifold |
required |
optimiser |
optax.GradientTransformation
|
optimiser to use to minimise energy of the curve |
required |
num_nodes |
int
|
number of nodes to use to parameterise cubic spline |
20
|
n_collocation |
int
|
number of points at which to evaluate energy along the curve |
100
|
iterations |
int
|
number of iterations to optimise for |
100
|
tol |
float
|
tolerance for measuring convergence |
0.0001
|
Returns:
Name | Type | Description |
---|---|---|
log_map |
LogMap
|
function to compute the log map between \(p, q \in M\) |
Source code in src/riemax/manifold/maps.py
riemax.manifold.maps.scipy_bvp_log_map_factory(metric: MetricFn, n_collocation: int = 100, explicit_jacobian: bool = False, tol: float = 0.0001) -> LogMap
Produce a log-map using scipy solve_bvp approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metric |
riemax.manifold.types.MetricFn
|
function defining the metric tensor on the manifold |
required |
n_collocation |
int
|
number of points at which to evaluate energy along the curve |
100
|
explicit_jacobian |
bool
|
whether to use the jacobian compute by jax |
False
|
tol |
float
|
tolerance for measuring convergence |
0.0001
|
Returns:
Name | Type | Description |
---|---|---|
log_map |
LogMap
|
function to compute the log map between \(p, q \in M\) |