spd_learn.functional.parallel_transport_lem#
- spd_learn.functional.parallel_transport_lem(v, p, q)[source]#
Parallel transport of tangent vector under the Log-Euclidean metric.
Transports a tangent vector \(V \in T_P \mathcal{M}\) from the tangent space at \(P\) to the tangent space at \(Q\) using the Log-Euclidean metric [Thanwerdas and Pennec, 2023].
Transport Formula
\[\Gamma_{P \rightarrow Q}^{LEM}(V) = D\exp(\log Q)\bigl[D\log(P)[V]\bigr]\]where \(D\log(P)\) is the Frechet derivative of the matrix logarithm at \(P\) and \(D\exp(\log Q)\) is the Frechet derivative of the matrix exponential at \(\log Q\). The intermediate step maps the ambient tangent vector into the flat log-space, where transport is trivial, then maps back to the ambient tangent space at \(Q\). This is delegated to
pyriemann.geometry.tangentspace.transport_logeuclid().- Parameters:
v (torch.Tensor) – Tangent vector at p, shape (…, n, n). Must be symmetric.
p (torch.Tensor) – Source point on SPD manifold, shape (…, n, n).
q (torch.Tensor) – Target point on SPD manifold, shape (…, n, n).
- Returns:
Transported tangent vector at q, shape (…, n, n).
- Return type:
Examples
>>> import torch >>> from spd_learn.functional import parallel_transport_lem >>> n = 3 >>> A = torch.randn(n, n, dtype=torch.float64) >>> p = A @ A.T + torch.eye(n, dtype=torch.float64) >>> B = torch.randn(n, n, dtype=torch.float64) >>> q = B @ B.T + torch.eye(n, dtype=torch.float64) >>> v = torch.randn(n, n, dtype=torch.float64) >>> v = (v + v.T) / 2 >>> v_transported = parallel_transport_lem(v, p, q) >>> # Self-transport should be identity >>> v_self = parallel_transport_lem(v, p, p) >>> torch.allclose(v, v_self, atol=1e-6) True
Notes
While the Log-Euclidean metric makes the SPD manifold globally flat (zero curvature), so that parallel transport is trivial in the log space, it is non-trivial when expressed in the ambient SPD space for tangent vectors represented as symmetric matrices. The Frechet derivatives handle the coordinate change between these representations.
See also
parallel_transport_airm()Parallel transport under AIRM.
frechet_derivative_log()Frechet derivative of log.
frechet_derivative_exp()Frechet derivative of exp.
log_euclidean_distance()Distance under Log-Euclidean metric.