Distance Metrics
There exist several coordinate representations for the two-dimensional hyperbolic space. In this package we focus on the two most common ones, the Poincaré disk coordinates and the Weierstraß (or hyperboloid) coordinates. More details can be found in the release publication.
For both coordinate systems suitable distance functions are available in hypertiling:
- hypertiling.distance.disk_distance(z1, z2)
Compute distance between two points given in terms of their Poincare disk coordinates.
- Parameters:
z1 (complex) – The first point in Poincare disk coordinates.
z2 (complex) – The second point in Poincare disk coordinates.
- Returns:
The distance between z1 and z2.
- Return type:
float
- hypertiling.distance.lorentzian_distance(a, b)
Compute the inner product between a and b, respecting the Minkowskian signature.
- Parameters:
a (np.array(3) or np.array((N,3))) – The first input array.
b (np.array(3)) – The second input array.
- Returns:
If both a and b are 1-D arrays, a scalar is returned. If a is a 2-D array of shape (N,3) an array of length N is returned.
- Return type:
np.array or scalar
- hypertiling.distance.weierstrass_distance(a, b)
Compute distance between two points given in the Weierstraß (also called hyperboloid) coordinate representation (t,x,y).
- Parameters:
a (np.array) – The first point in hyperboloid coordinate representation.
b (np.array) – The second point in hyperboloid coordinate representation.
- Returns:
The distance between a and b.
- Return type:
float