Result: OGRePy: An Object-Oriented General Relativity Package for Python

Title:
OGRePy: An Object-Oriented General Relativity Package for Python
Authors:
Source:
Journal of Open Research Software, 13: 9 (2025)
Publication Year:
2024
Collection:
General Relativity and Quantum Cosmology
Document Type:
Report Working Paper
DOI:
10.5334/jors.558
Accession Number:
edsarx.2409.03803
Database:
arXiv

Further Information

OGRePy is a modern, open-source Python package designed to perform symbolic tensor calculations, with a particular focus on applications in general relativity. Built on an object-oriented architecture, OGRePy encapsulates tensors, metrics, and coordinate systems as self-contained objects, automatically handling raising and lowering of indices, coordinate transformations, contractions, partial or covariant derivatives, and all tensor operations. By leveraging the capabilities of SymPy and Jupyter Notebook, OGRePy provides a robust, user-friendly environment that facilitates both research and teaching in general relativity and differential geometry. This Python package reproduces the functionality of the popular Mathematica package OGRe, while greatly improving upon it by making use of Python's native object-oriented syntax. In this paper, we describe OGRePy's design and implementation, and discuss its potential for reuse across research and education in mathematics and physics.
4 pages, final version published in JORS. NOTE: The software has been updated since this publication. Full and up-to-date documentation and source code for the latest version are available at https://github.com/bshoshany/OGRePy