Grassmann Distances

The Grassmannian (or Riemannian) distance assigns a nonnegative value to measure distance between a pair of subspaces \(\mathbf{X}_0, \mathbf{X}_1 \in \mathbb{R}^{n \times p}\) on the Grassmann manifold \(\mathcal{G}(p, n)\). Formally, a Grassmann distance measures the length of the geodesic path connecting the two points on \(\mathcal{G}(p, n)\) where all distances are a function of the principal angles between subspaces. UQpy introduces various Grassmann distances derived from the principal angles [63].

\[0 \leq \theta_1 \leq \theta_2 \leq \ldots \leq \theta_p \leq \pi/2,\]

Practically, the principal angles can be calculated from the singular value decomposition (SVD) of \(\mathbf{X}_0^T\mathbf{X}_1\), as

\[\mathbf{X}_0^T\mathbf{X}_1 = \mathbf{U}\cos(\Theta)\mathbf{V}'\]

where \(\cos(\Theta)=\text{diag}(\cos\theta_1, \ldots,\cos\theta_p)\). This definition of distance can be extended to cases where \(\mathbf{X}_0\) and \(\mathbf{X}_1\) have different number of columns \(p\). More information can be found in [64].

GrassmannianDistance Class

The abstract UQpy.utilities.distances.baseclass.GrassmannianDistance class is the base class for all Grassmannian distances in UQpy. It provides a blueprint for classes in the grassmannian_distances module and allows the user to define a set of methods that must be created within any child classes built from this abstract class.

class GrassmannianDistance[source]
calculate_distance_matrix(points, p_dim)[source]

Given a list of points that belong on a Grassmann Manifold, assemble the distance matrix between all points.

Parameters:

The GrassmannianDistance class is imported using the following command:

>>> from UQpy.utilities.distances.baseclass.GrassmannianDistance import GrassmannianDistance

List of Available Distances

All the distances classes below are subclasses of the GrassmannianDistance class. New distances can be written as subclasses having a compute_distance() method.

Asimov Distance

The Asimov distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_A(\mathbf{X}_0,\mathbf{X}_1) = \cos^{-1}||\mathbf{X}_0^T\mathbf{X}_1||_2 = \max(\Theta)\]

The AsimovDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.AsimovDistance import AsimovDistance

One can use the following command to instantiate the AsimovDistance class.

class AsimovDistance[source]

A class to calculate the Asimov distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Asimov distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

AsimovDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Binet-Cauchy Distance

The Binet-Cauchy distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{BC}(\mathbf{X}_0,\mathbf{X}_1) = \left[1-(\det\mathbf{X}_0^T\mathbf{X}_1)^2\right]^{1/2} = \left[1-\prod_{l}\cos^2(\Theta_l)\right]^{1/2}\]

The BinetCauchyDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.BinetCauchyDistance import BinetCauchyDistance

One can use the following command to instantiate the BinetCauchyDistance class.

class BinetCauchyDistance[source]

A class to calculate the Binet-Cauchy distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Binet-Cauchy distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

BinetCauchyDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Fubini-Study Distance

The Fubini-Study distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{FS}(\mathbf{X}_0,\mathbf{X}_1) = \cos^{-1}\left(\prod_{l}\cos(\Theta_l)\right)\]

The FubiniStudyDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.FubiniStudyDistance import FubiniStudyDistance

One can use the following command to instantiate the FubiniStudyDistance class.

class FubiniStudyDistance[source]

A class to calculate the Fubini-Study distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Fubini-Study distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

FubiniStudyDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Geodesic Distance

The Geodesic (or Arc-length) distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{G}(\mathbf{X}_0,\mathbf{X}_1) = ||\boldsymbol\Theta ||_2 = \left(\sum \Theta^2_l\right)^{1/2}\]

The GeodesicDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.GeodesicDistance import GeodesicDistance

One can use the following command to instantiate the class GeodesicDistance

class GeodesicDistance[source]

A class to calculate the Geodesic distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Geodesic distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

GeodesicDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Martin Distance

The Martin distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{M}(\mathbf{X}_0,\mathbf{X}_1) = \left[\log\prod_{l}1/\cos^2(\Theta_l)\right]^{1/2}\]

The MartinDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.MartinDistance import MartinDistance

One can use the following command to instantiate the MartinDistance class.

class MartinDistance[source]

A class to calculate the Martin distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Martin distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

MartinDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Procrustes Distance

The Procrustes distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{P}(\mathbf{X}_0,\mathbf{X}_1) = ||\mathbf{X}_0\mathbf{U}-\mathbf{X}_1\mathbf{V} ||_F = 2\left[\sum_{l}\sin^2(\Theta_l/2)\right]^{1/2}\]

The ProcrustesDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.ProcrustesDistance import ProcrustesDistance

One can use the following command to instantiate the ProcrustesDistance class.

class ProcrustesDistance[source]

A class to calculate the Procrustes distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Procrustes distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

ProcrustesDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Projection Distance

The Projection distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{Pr}(\mathbf{X}_0,\mathbf{X}_1) = ||\mathbf{X}_0\mathbf{X}_0^T-\mathbf{X}_1\mathbf{X}_1^T ||_2 = \left(\sum_{l} \sin^2(\Theta_l)\right)^{1/2}\]

The ProjectionDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.ProjectionDistance import ProjectionDistance

One can use the following command to instantiate the ProjectionDistance class.

class ProjectionDistance[source]

A class to calculate the Projection distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Projection distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

ProjectionDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points

Spectral Distance

The Spectral distance between two subspaces defined by the orthonormal matrices, \(\mathbf{X}_0\) and \(\mathbf{X}_1\), is given by:

\[d_{S}(\mathbf{X}_0,\mathbf{X}_1) = ||\mathbf{X}_0\mathbf{U}-\mathbf{X}_1\mathbf{V} ||_2 = 2\sin( \max(\Theta_l)/2)\]

The SpectralDistance class is imported using the following command:

>>> from UQpy.utilities.distances.grassmannian_distances.SpectralDistance import SpectralDistance

One can use the following command to instantiate the SpectralDistance class.

class SpectralDistance[source]

A class to calculate the Spectral distance between two Grassmann points.

compute_distance(xi, xj)[source]

Compute the Spectral distance between two points on the Grassmann manifold.

Parameters:
  • xi (GrassmannPoint) – Orthonormal matrix representing the first point.

  • xj (GrassmannPoint) – Orthonormal matrix representing the second point.

Return type:

float

SpectralDistance.distance_matrix: ndarray

Distance matrix defining the pairwise distances between the points