---
title: Vector-Valued Distance on SPD
url: https://www.emergentmind.com/topics/vector-valued-distance-on-rss
type: topic
---

# Vector-Valued Distance on SPD

The vector-valued distance (VVD) on the manifold of symmetric positive definite matrices, denoted SPDₙ, provides a complete Riemannian invariant that encodes the full relative position of two points in the space. Unlike scalar Riemannian distances, the VVD delivers a higher-fidelity geometrical descriptor that supports both theoretical analysis and practical applications in manifold learning, geometric representation, and information geometry.

## 1. Geometric Structure of SPDₙ

SPDₙ is the set
\[
SPDₙ = \{ P \in \mathbb{R}^{n \times n} \mid P^\top = P,\;\;x^\top P x > 0 \;\forall\,x\neq0 \}
\]
comprising all real, symmetric, positive definite $n \times n$ matrices. As a manifold, SPDₙ is smooth and of dimension $n(n+1)/2$, with tangent space at $P$ identified as $T_PSPDₙ \cong Sₙ$, where $Sₙ$ is the vector space of real symmetric matrices.

The manifold possesses a rich structure as a Riemannian symmetric space. The general linear group $GL(n)$ acts transitively by congruence:
\[
\Phi_M(P) = M P M^\top, \quad M \in GL(n),
\]
preserving the Riemannian structure by isometries. This action partitions into “translations” by $M \in SPDₙ$ (no fixed point), “rotations” by $Q \in O(n)$ (fixing the identity matrix $I$), and the involutive “reflection” $P \mapsto P^{-1}$.

The affine-invariant Riemannian metric is given by
\[
\langle U, V \rangle_P = \operatorname{tr}(P^{-1} U P^{-1} V)
\]
for $U, V \in T_PSPDₙ$. Isometries under $GL(n)$ manifest as
\[
\langle D\Phi_M(U), D\Phi_M(V) \rangle_{M \cdot P} = \langle U, V \rangle_P.
\]

## 2. Construction of the Vector-Valued Distance

For $P, Q \in SPDₙ$, the VVD produces a vector in $\mathbb{R}^n$ that characterizes the displacement from $P$ to $Q$. The construction proceeds as follows:

- Compute $M = P^{-1} Q$, which belongs to $SPDₙ$ and is thus diagonalisable.
- Perform an orthogonal eigendecomposition:
  \[
  P^{-1} Q = U \; \mathrm{diag}(\lambda_1, \dots, \lambda_n) \; U^\top
  \]
  where $\lambda_1 \geq \lambda_2 \geq \cdots \geq \lambda_n > 0$, $U \in O(n)$.
- The Riemannian logarithm at the identity coincides with the matrix logarithm:
  \[
  \log(P^{-1} Q) = U \; \mathrm{diag}(\log \lambda_1, \dots, \log \lambda_n) \; U^\top.
  \]
- By definition (Lopez et al. §2.2), the vector-valued distance is
  \[
  \mathbf{d}(P, Q) = (\log \lambda_1, \dots, \log \lambda_n) \in \mathbb{R}^n,
  \]
  with ordering $\lambda_1 \geq \cdots \geq \lambda_n$ ensuring placement in the “positive Weyl chamber.”

Each component $\log\lambda_i$ measures the signed expansion along the $i$-th eigendirection, offering directional decomposition of displacement within the non-Euclidean geometry.

## 3. Properties of the Vector-Valued Distance

The VVD encapsulates several distinguished geometric and algebraic properties:

- **Isometric Invariance:** For any isometry $\Phi \in GL(n)$ mapping $(P, Q)$ to $(P', Q')$, $P^{-1}Q$ and $(P')^{-1}Q' = \Phi(P)^{-1} \Phi(Q)$ share the spectrum, ensuring $\mathbf d(P, Q) = \mathbf d(P', Q')$. Conversely, equal VVD vectors imply the pairs are isometric.
- **Anti-symmetry (up to permutation):** The displacement reverses sign (up to order reversal): if the eigenvalues of $P^{-1} Q$ are $\{\lambda_1, \ldots, \lambda_n\}$, then those of $Q^{-1}P$ are $\{\frac{1}{\lambda_n}, \ldots, \frac{1}{\lambda_1}\}$, yielding
  \[
  \mathbf d(Q, P) = -\mathbf d(P, Q)
  \]
  after reordering.
- **Triangle (Majorization) Property:** For all $P, Q, R \in SPDₙ$,
  \[
  \mathbf d(P, R) \preceq \mathbf d(P, Q) + \mathbf d(Q, R),
  \]
  with $\preceq$ the majorization order on $\mathbb{R}^n$. This property subsumes the ordinary triangle inequality under any symmetric norm.
- **Complete Invariant:** The VVD provides a complete isometry-invariant between pairs in $SPDₙ$; no geometric information is lost.

## 4. Connection to Scalar Distance and Norms

The classical affine-invariant Riemannian distance emerges as the $\ell_2$-norm of the VVD:
\[
d_{\mathrm{Riem}}(P, Q) = \sqrt{ \sum_{i=1}^n (\log \lambda_i)^2 } = \| \mathbf d(P, Q) \|_2.
\]
More generally, all $\ell_p$-norms of $\mathbf d(P, Q)$, invariant under coordinate permutations, yield Finsler metrics on $SPDₙ$ with the same group of isometries. Examples include:
\begin{align*}
d_{F_1}(P, Q) & = \sum_{i=1}^n |\log \lambda_i|, \\
d_{F_\infty}(P, Q) & = \max_{i} |\log \lambda_i|.
\end{align*}
This structure generalizes the interpretation of distance beyond scalar length to encompass multi-directional geometric information.

## 5. Extension to General Symmetric Spaces

The vector-valued distance admits generalization to all noncompact Riemannian symmetric spaces $G/K$ of rank $r$:
\[
\mathbf d: (G/K) \times (G/K) \to \mathbb{R}^r,
\]
defined by selecting a maximal flat through a reference point, conjugating an argument into it, and reading “log-coordinates.” SPDₙ forms a canonical instance with $r = n$. Analogous constructions apply to Grassmannians, orthogonal groups, and beyond, rooting in the general Lie-theoretic setting of Weyl chambers and Cartan subalgebras (see Helgason (1978); Kapovich–Leeb–Porti (2017)).

## 6. Algorithmic Computation of VVD

The computation of the VVD between $P, Q \in SPDₙ$ proceeds via the following pseudocode:

1. Compute $M \leftarrow P^{-1} Q$ (this may be solved as $P \cdot X = Q$).
2. Perform eigendecomposition:
   \[
   M = U \, \mathrm{diag}(\lambda_1, \ldots, \lambda_n) \, U^\top,\quad \lambda_1 \geq \cdots \geq \lambda_n > 0.
   \]
3. Assemble $v \in \mathbb{R}^n$ by $v_i \leftarrow \log \lambda_i$ for $i = 1, \ldots, n$.
4. Return $v$.

The dominant computational cost arises from the eigendecomposition, which is $\mathcal{O}(n^3)$. Implementation details, proofs, and further algorithmic considerations are discussed in the appendices of Lopez et al. (2021).

## 7. Applications and Visualization

The VVD supports a spectrum of applications in geometric representation learning. In tasks such as knowledge graph completion, item recommendation, and question answering, models utilizing SPDₙ and its VVD-based geometry demonstrate improved performance relative to analogous Euclidean and hyperbolic architectures. The vector-valued structure of the VVD also enables direct visualization of learned embeddings, revealing clear separation between positive and negative samples.

A plausible implication is enhanced interpretability: the decomposition of distances along Weyl chamber directions provides insights into how complex data relationships unfold in high-rank, non-Euclidean spaces.

---

For a rigorous treatment of the geometric and algebraic properties, as well as applications and proof details, see the full development and appendices in "Vector-valued Distance and Gyrocalculus on the Space of Symmetric Positive Definite Matrices" [2110.13475].

Source: https://www.emergentmind.com/topics/vector-valued-distance-on-rss