circle_bundles.RP2UnitVectorMetric

class circle_bundles.RP2UnitVectorMetric(name='RP2_unitvec', base_name='RP^2', base_name_latex='\\mathbb{RP}^2')[source]

Bases: object

Metric on \(\mathbb{RP}^2\) using antipodal unit vectors in \(\mathbb{R}^3\).

Points in \(\mathbb{RP}^2\) can be represented by unit vectors p S^2 R^3 with the antipodal identification p ~ -p.

This implementation uses the chordal quotient distance induced from Euclidean distance in \(\mathbb{R}^3\):

\[d([p],[q]) = \min(\|p - q\|,\; \|p + q\|).\]

This is a common practical choice for embedding-based computations and is fast to compute in batch.

Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

name

Metric identifier (default "RP2_unitvec").

Type:

str

base_name

Short name of the base space for plots/UI.

Type:

str

base_name_latex

LaTeX symbol used in summaries and tables.

Type:

str

Notes

  • This is a chordal metric, not the intrinsic geodesic metric on \(\mathbb{RP}^2\). For most cover-building and neighborhood computations, chordal behavior is appropriate.

  • If you need the intrinsic projective geodesic distance, you’d implement a different class (e.g. based on arccos(|<p,q>|)).

__init__(name='RP2_unitvec', base_name='RP^2', base_name_latex='\\mathbb{RP}^2')
Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

Return type:

None

Methods

__init__([name, base_name, base_name_latex])

pairwise(X[, Y])

Compute chordal quotient distances on \(\mathbb{RP}^2\).

Attributes

base_name

base_name_latex

name

pairwise(X, Y=None)[source]

Compute chordal quotient distances on \(\mathbb{RP}^2\).

Parameters:
  • X (ndarray) – Array of shape (n, 3) representing vectors in \(\mathbb{R}^3\). Rows are ideally unit vectors on \(S^2\).

  • Y (ndarray | None) – Optional array of shape (m, 3). If omitted, uses X.

Returns:

Distance matrix of shape (n, m).

Return type:

D