1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// ~/cartan/cartan-core/src/transport.rs
//! Parallel transport and vector transport traits.
//!
//! Parallel transport moves a tangent vector along a curve while preserving
//! the Riemannian connection: a tangent vector at p is moved to a tangent
//! vector at q along the geodesic, without changing its length or angle
//! relative to the geodesic.
//!
//! ## ParallelTransport vs VectorTransport
//!
//! - `ParallelTransport`: geodesically exact. Solves the ODE
//! D/dt V(t) = 0 along gamma. Expensive: typically O(n^3) per step
//! for matrix manifolds.
//!
//! - `VectorTransport`: approximation satisfying only the isometry condition
//! approximately. Cheaper alternatives: Schild's ladder, pole ladder,
//! differentiated retraction.
//!
//! The blanket impl `impl<M: ParallelTransport> VectorTransport for M` means
//! that any manifold with exact parallel transport automatically satisfies
//! the VectorTransport interface. Algorithms that only need approximate
//! transport (most conjugate gradient methods) can use VectorTransport
//! without requiring the more expensive exact version.
//!
//! ## References
//!
//! - do Carmo. "Riemannian Geometry." Chapter 4 (parallel transport).
//! - Absil, Mahony, Sepulchre. "Optimization Algorithms on Matrix Manifolds."
//! Chapter 8 (vector transport).
//! - Zhu. "A Riemannian Conjugate Gradient Method for Optimization on the
//! Stiefel Manifold." Optimization, 2017.
use crate::;
/// Exact geodesic parallel transport.
///
/// Parallel transport of a tangent vector u at p along the geodesic to q
/// gives a tangent vector at q that has the same length (||P_p^q u||_q = ||u||_p)
/// and preserves inner products with all other parallelly transported vectors.
///
/// This is the most expensive transport operation. It is needed for:
/// - Conjugate gradient with exact beta computation
/// - Hessian approximations on curved manifolds
/// - Geodesic deviation (Jacobi fields)
///
/// # Supertraiting Manifold
///
/// ParallelTransport requires Self: Manifold to ensure that implementing
/// types have the full geometric structure (exp, log, inner).
/// Approximate vector transport (cheaper than exact parallel transport).
///
/// A vector transport on a manifold M is a smooth map
/// T: TM x_M TM -> TM
/// satisfying:
/// 1. T_{p,0}(u) = u (trivial transport by zero vector)
/// 2. T_{p,v}(u) in T_{R_p(v)} M (lands in the right tangent space)
/// 3. <T_{p,v}(u), T_{p,v}(w)>_{R_p(v)} = <u, w>_p (isometry, approx OK)
///
/// Cheaper alternatives to exact parallel transport include:
/// - Differentiated retraction: T_{p,v}(u) = d/ds R_p(v + s*u)|_{s=0}
/// - Pole ladder: two successive Schild's ladder steps
/// - Schild's ladder: O(n^2) vs O(n^3) for matrix exponential transport
///
/// Most first-order Riemannian conjugate gradient convergence proofs only
/// require approximate isometry (condition 3 up to constants), so VectorTransport
/// is sufficient for CG implementations.
///
/// # Blanket impl
///
/// Any type implementing `ParallelTransport` automatically implements
/// `VectorTransport` via the blanket impl below. This means manifolds
/// with exact PT don't need to implement VT separately.
/// Blanket implementation: exact parallel transport implies vector transport.
///
/// Any manifold implementing `ParallelTransport` automatically satisfies
/// `VectorTransport` by computing q = exp(p, direction) and calling transport.
/// This avoids code duplication for manifolds with exact PT.
///
/// The blanket impl uses exp() (from the Manifold supertrait) to compute q,
/// then delegates to the exact transport. Manifolds that need to use their
/// retraction instead of exp for the destination point can override VectorTransport
/// directly rather than relying on this blanket impl.