spd_learn.functional.schild_ladder#

spd_learn.functional.schild_ladder(v, p, q, n_steps=5)[source]#

Parallel transport via Schild’s ladder approximation.

Schild’s ladder is a numerical scheme for approximating parallel transport along geodesics. It constructs a sequence of geodesic parallelograms to iteratively transport the tangent vector.

The algorithm: 1. Divide the geodesic from P to Q into n_steps segments 2. For each step, construct a parallelogram using midpoints 3. The opposite vertex of the parallelogram gives the transported vector

Parameters:
  • v (torch.Tensor) – Tangent vector at p to be transported, shape (…, n, n).

  • p (torch.Tensor) – Source point on SPD manifold, shape (…, n, n).

  • q (torch.Tensor) – Target point on SPD manifold, shape (…, n, n).

  • n_steps (int, optional) – Number of ladder rungs (iterations). More steps give better accuracy. Default is 5.

Returns:

Approximately transported tangent vector at q, shape (…, n, n).

Return type:

torch.Tensor

Notes

Schild’s ladder converges to the true parallel transport as n_steps -> inf. The approximation error is O(1/n_steps^2) for smooth geodesics.

This method is metric-agnostic and works for any Riemannian metric where geodesics and exponential/logarithmic maps are available [Ehlers et al., 1972], [Lorenzi and Pennec, 2014].

Examples

>>> import torch
>>> from spd_learn.functional import schild_ladder, parallel_transport_airm
>>> n = 3
>>> A = torch.randn(n, n)
>>> p = A @ A.T + torch.eye(n)
>>> B = torch.randn(n, n)
>>> q = B @ B.T + torch.eye(n)
>>> v = torch.randn(n, n)
>>> v = (v + v.T) / 2
>>> # Compare Schild's ladder with closed-form transport
>>> v_schild = schild_ladder(v, p, q, n_steps=10)
>>> v_exact = parallel_transport_airm(v, p, q)

See also

parallel_transport_airm()

Closed-form parallel transport under AIRM.

pole_ladder()

Alternative numerical scheme (more efficient).

airm_geodesic()

Geodesic under AIRM.