OGRePy: An Object-Oriented General Relativity Package for Python

๐Ÿ“… 2024-09-05
๐Ÿ›๏ธ arXiv.org
๐Ÿ“ˆ Citations: 2
โœจ Influential: 0
๐Ÿ“„ PDF

career value

181K/year
๐Ÿค– AI Summary
The current Python ecosystem lacks a modern, open-source symbolic tensor library tailored for general relativity, making it difficult to uniformly model tensors, metrics, and coordinate systems while automatically handling index raising/lowering, covariant differentiation, and coordinate transformations. Method: We introduce the first native object-oriented Python framework for tensor calculus, built atop SymPy, which tightly integrates coordinate systems, index configurations, and tensor algebra to enable fully automated symbolic derivation of covariant derivatives, curvature tensors, and geodesic equations. Contribution/Results: We propose an โ€œobject-oriented tensor modeling paradigmโ€ ensuring representational consistency throughout computations; leverage optimized algorithms from OGRe to support complete tensor operation chains. The library rigorously preserves mathematical correctness while substantially lowering the barrier to analytical research in curved spacetimes, and has been successfully applied to diverse problems in general relativity.

Technology Category

Application Category

๐Ÿ“ Abstract
We present OGRePy, the official Python port of the popular Mathematica tensor calculus package OGRe (Object-Oriented General Relativity) - a powerful, yet user-friendly, tool for advanced tensor calculations in mathematics and physics, especially suitable for general relativity. The Python port uses the same robust and performance-oriented algorithms as the original package, and retains its core design principles. However, its truly object-oriented interface, enabled by Python, is more intuitive and flexible than the original Mathematica implementation. It utilizes SymPy for symbolic computations and Jupyter as a notebook interface. OGRePy allows calculating arbitrary tensor formulas using any combination of addition, multiplication by scalar, trace, contraction, partial derivative, covariant derivative, and permutation of indices. Transformations of the tensor components between different index configurations and/or coordinate systems are performed seamlessly behind the scenes as needed, eliminating user error due to combining incompatible representations, and guaranteeing consistent results. In addition, the package provides facilities for easily calculating various curvature tensors and geodesic equations in multiple representations. This paper presents the main features of the package in great detail, including many examples of its use in the context of general relativity research.
Problem

Research questions and friction points this paper is trying to address.

Performs symbolic tensor calculations for general relativity
Automates tensor operations and coordinate transformations
Provides a user-friendly Python alternative to Mathematica's OGRe
Innovation

Methods, ideas, or system contributions that make the work stand out.

Object-oriented Python package for tensor calculations
Automates tensor operations with SymPy integration
Enhances research and teaching in general relativity