Computations and statistics on manifolds with geometric structures.





GitHub Stars



Last Commit

1d ago











.. list-table:: :header-rows: 0

    • Code
    • |PyPI version|\ |Downloads|\ |Zenodo|\
    • Continuous Integration
    • |Build Status|\ |python|\
    • Code coverage (numpy)
    • |Coverage Status np|\
    • Code coverage (autograd, tensorflow, pytorch)
    • |Coverage Status autograd|\ |Coverage Status tf|\ |Coverage Status torch|
    • Documentation
    • |doc|\ |binder|\ |tutorial|\
    • Community
    • |contributions|\ |Slack|\ |Twitter|\

NEWS: The white paper summarizing the findings from our ICLR 2021 challenge of computational differential geometry and topology <> is out. Read it here <>.

Geomstats is an open-source Python package for computations and statistics on manifolds. The package is organized into two main modules: geometry and learning.

The module geometry implements concepts in differential geometry, and the module learning implements statistics and learning algorithms for data on manifolds.

.. raw:: html

<img src="" height="120px" width="120px" align="left">
  • To get an overview of geomstats, see our introductory video <>__.
  • To get started with geomstats, see the examples <> and notebooks <> directories.
  • The documentation of geomstats can be found on the documentation website <>__.
  • To follow the scientific literature on geometric statistics, follow our twitter-bot @geomstats-papers <>__!

If you find geomstats useful, please kindly cite our paper <>__:


  author  = {Nina Miolane and Nicolas Guigui and Alice Le Brigant and Johan Mathe and Benjamin Hou and Yann Thanwerdas and Stefan Heyder and Olivier Peltre and Niklas Koep and Hadi Zaatiti and Hatem Hajri and Yann Cabanes and Thomas Gerald and Paul Chauchat and Christian Shewmake and Daniel Brooks and Bernhard Kainz and Claire Donnat and Susan Holmes and Xavier Pennec},
  title   = {Geomstats:  A Python Package for Riemannian Geometry in Machine Learning},
  journal = {Journal of Machine Learning Research},
  year    = {2020},
  volume  = {21},
  number  = {223},
  pages   = {1-9},
  url     = {}

Install geomstats via pip3

From a terminal (OS X & Linux), you can install geomstats and its requirements with pip3 as follows:


pip3 install geomstats

This method installs the latest version of geomstats that is uploaded on PyPi. Note that geomstats is only available with Python3.

Install geomstats via Git

From a terminal (OS X & Linux), you can install geomstats and its requirements via git as follows:


git clone
pip3 install -r requirements.txt

This method installs the latest GitHub version of geomstats. Developers should install this version, together with the development requirements and the optional requirements to enable tensorflow and pytorch backends:


pip3 install -r dev-requirements.txt -r opt-requirements.txt

To add the requirements.txt into a conda environment, you can use the enviroment.yml file as follows:


conda env create --file environment.yml

Note that this only installs the minimum requirements. To add the optional, development, continuous integration and documentation requirements, refer to the files *-requirements.txt.

Choose the backend

Geomstats can run seamlessly with numpy, tensorflow or pytorch. Note that pytorch and tensorflow requirements are optional, as geomstats can be used with numpy only. By default, the numpy backend is used. The visualizations are only available with this backend.

To get the tensorflow and pytorch versions compatible with geomstats, install the optional requirements <>__:


pip3 install -r opt-requirements.txt

You can choose your backend by setting the environment variable GEOMSTATS_BACKEND to numpy, tensorflow or pytorch, and importing the backend module. From the command line:


export GEOMSTATS_BACKEND=pytorch

and in the Python3 code:


import geomstats.backend as gs

Getting started

To use geomstats for learning algorithms on Riemannian manifolds, you need to follow three steps: - instantiate the manifold of interest,

  • instantiate the learning algorithm of interest, - run the algorithm.

The data should be represented by a gs.array. This structure represents numpy arrays, or tensorflow/pytorch tensors, depending on the choice of backend.

The following code snippet shows the use of tangent Principal Component Analysis on simulated data on the space of 3D rotations.

.. code:: python

from geomstats.geometry.special_orthogonal import SpecialOrthogonal
from geomstats.learning.pca import TangentPCA

so3 = SpecialOrthogonal(n=3, point_type='vector')
metric = so3.bi_invariant_metric

data = so3.random_uniform(n_samples=10)

tpca = TangentPCA(metric=metric, n_components=2)
tpca =
tangent_projected_data = tpca.transform(data)

All geometric computations are performed behind the scenes. The user only needs a high-level understanding of Riemannian geometry. Each algorithm can be used with any of the manifolds and metric implemented in the package.

To see additional examples, go to the examples <> or notebooks <> directories.


See our contributing <>__ guidelines!


This work is supported by:

  • the Inria-Stanford associated team GeomStats <>__,
  • the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement G-Statistics <>__ No. 786854),
  • the French society for applied and industrial mathematics (SMAI <>__),
  • the National Science Foundation (grant NSF DMS RTG 1501767).

.. |Twitter| image:: :target: .. |PyPI version| image:: :target: .. |Build Status| image:: :target: .. |Slack| image:: :target: .. |Coverage Status np| image:: :target: .. |Coverage Status autograd| image:: :target: .. |Coverage Status tf| image:: :target: .. |Coverage Status torch| image:: :target: .. |Zenodo| image:: :target: .. |Downloads| image:: :target: .. |python| image:: :target: .. |tutorial| image:: :target: .. |doc| image:: :target: .. |binder| image:: :target: .. |contributions| image:: :target:

Rate & Review

Great Documentation0
Easy to Use0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Unwelcoming Community0