circle_bundles.T2FlatMetric

class circle_bundles.T2FlatMetric(name='T2_flat', base_name='T^2', base_name_latex='\\mathbb{T}^2')[source]

Bases: object

Flat metric on the 2-torus \(\mathbb{T}^2\).

Points are represented as angle pairs (θ₁, θ₂) in radians, interpreted modulo in each coordinate. The distance is computed using the product of circular distances in each factor:

\[d(x,y) = \sqrt{ d_{S^1}(x_1,y_1)^2 + d_{S^1}(x_2,y_2)^2 }.\]

This metric is appropriate when: - your base space is a genuine torus (no quotient identifications), and - coordinates are stored explicitly as angles.

Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

name

Metric identifier (default "T2_flat").

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

  • Input angles may lie outside [0, 2π); wrapping is handled implicitly.

  • This metric is frequently used as the upstairs metric before taking Z₂ quotients (e.g. Klein bottle, diagonal quotients).

__init__(name='T2_flat', base_name='T^2', base_name_latex='\\mathbb{T}^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 flat torus distances between angle-coordinate samples.

Attributes

base_name

base_name_latex

name

pairwise(X, Y=None)[source]

Compute flat torus distances between angle-coordinate samples.

Parameters:
  • X (ndarray) – Array of shape (n, 2) containing angles in radians.

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

Returns:

Distance matrix of shape (n, m).

Return type:

D

Raises:

ValueError – If X or Y does not have shape (*, 2).