ott.geometry.grid.Grid.to_LRCGeometry

ott.geometry.grid.Grid.to_LRCGeometry#

Grid.to_LRCGeometry(rank=0, tol=0.01, rng=None, scale=1.0)[source]#

Converts grid to low-rank geometry.

Conversion is carried out by taking advantage of the fact that the true cost matrix of a grid geometry is a sum of Kronecker products of local cost matrices (for each dimension) with matrices of 1’s (both on left and right sides) of varying dimension. Each of the matrices in that sum can be factorized if each of these cost matrices can be factorized, which we do by forcing a conversion to a low rank geometry object.

The conversion is exact, so rank, tol and rng are ignored.

Parameters:
  • rank (int) – Ignored.

  • tol (float) – Ignored.

  • rng (Optional[Array]) – Ignored.

  • scale (float) – Value used to rescale the factors of the low-rank geometry. Useful when this geometry is used in the linear term of fused GW.

Return type:

LRCGeometry

Returns:

LRCGeometry object.