English

OGRe: An Object-Oriented General Relativity Package for Mathematica

Mathematical Software 2025-12-29 v2 Symbolic Computation General Relativity and Quantum Cosmology Differential Geometry

Abstract

We present OGRe, a modern Mathematica package for tensor calculus, designed to be both powerful and user-friendly. The package can be used in a variety of contexts where tensor calculations are needed, in both mathematics and physics, but it is especially suitable for general relativity. By implementing an object-oriented design paradigm, OGRe allows calculating arbitrarily complicated tensor formulas easily, and automatically transforms between index configurations and coordinate systems behind the scenes as needed, eliminating user errors by making it impossible for the user to combine tensors in inconsistent ways. Other features include displaying tensors in various forms, automatic calculation of curvature tensors and geodesic equations, easy importing and exporting of tensors between sessions, optimized algorithms and parallelization for improved performance, and more.

Keywords

Cite

@article{arxiv.2109.04193,
  title  = {OGRe: An Object-Oriented General Relativity Package for Mathematica},
  author = {Barak Shoshany},
  journal= {arXiv preprint arXiv:2109.04193},
  year   = {2025}
}

Comments

4 pages, final version published in JOSS. 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/OGRe

R2 v1 2026-06-24T05:49:17.380Z