Skip to main content

A Python package for general relativity calculations.

Project description

Welcome to aurel’s documentation!

Documentation GitHub Python 3.11+ License: GPL v3 PyPI Test build Coverage Email

Aurel is an open source Python package for numerical relativity analysis. Designed with ease of use in mind, it will automatically calculate relativistic terms.

Key Features

  • Comprehensive tensor calculations:
  • Dynamic computation and intelligent caching: Aurel automatically calculates only what's needed and caches results, significantly improving performance for complex calculations
  • Clear user feedback: Progress bars and informative messages guide you through computations
  • Time evolution support: Tools for analyzing data across multiple time steps (documentation, example)
  • Flexible data input: Works seamlessly with numerical simulation data, analytical solutions, or custom numpy arrays
  • Einstein Toolkit integration: Native support for reading Carpet HDF5 outputs from Einstein Toolkit simulations (documentation, example)
  • Advanced finite difference schemes: Multiple discretization schemes for 3D spatial grids
  • Built-in analytical solutions: Pre-implemented spacetimes for testing and validation (examples)

Installation

Requirements:

Install aurel using pip (all other dependencies will be installed automatically):

pip install aurel

To get the latest development version:

pip install git+https://github.com/robynlm/aurel.git@development

Getting started

Start your Python session on a jupyter notebook or in a Python script and import the aurel.AurelCore class:

   
   import aurel
   
   # Define your grid parameters
   param = {
       'Nx': 64, 'Ny': 64, 'Nz': 64,
       'xmin': -1.0, 'ymin': -1.0, 'zmin': -1.0,
       'dx': 0.03125, 'dy': 0.03125, 'dz': 0.03125,
   }
   
   # Initialize the finite difference class
   fd = aurel.FiniteDifference(param)
   
   # Initialize the AurelCore class
   rel = aurel.AurelCore(fd)

At this point you need to provide the spacetime metric, extrinsic curvature and matter fields (see assumed quantities), where these would otherwise be assumed to correspond to Minkowski vacuum. These are passed as numpy arrays to aurel in the following way:

# Define the xx component of the spacetime metric
rel.data['gxx'] = np.ones((param['Nx'], param['Ny'], param['Nz']))

and so on for the other components and required quantities. In this example $g_{xx} = 1$, but you can pass any numpy array; it can be of numerical relativity simulation data, or an array generated from an analytical expression. Take care to run rel.freeze_data() so that your input data is conserved during the cache cleanup.

With everything defined, you can call any entity listed in the descriptions list. Just call it as:

rel["name_of_the_entity"]

Aurel will automatically do its best to calculate any relativistic term you ask for.

For a more in depth example, see the example notebook for applications. Additionally, a symbolic counterpart that works in a very similar way is also available via the aurel.AurelCoreSymbolic class, see the symbolic example notebook for details.

Calculations over time

If you want calculations over multiple moments in coordinate time, you can use the aurel.over_time function. First, create a dictionary containing the spacetime and matter fields over time:

# Define the spacetime metric gxx over time
data = {
    'gxx': [np.ones((param['Nx'], param['Ny'], param['Nz'])),
            np.ones((param['Nx'], param['Ny'], param['Nz']))],
    ...
}

That is a data dictionary with keys the names of the quantities, and values a list of numpy arrays, one for each time step. Calculations will be performed for each of these time steps as:

data = aurel.over_time(
   data, fd, 
   vars=['name_of_the_entity', ..., {'custom_quantity': custom_quantity}], 
   estimates=['name_of_estimate', ..., {'custom_estimate': custom_estimate}],
   **kwargs)

where vars is a list of entities to calculate at each time step (available terms are in the descriptions list, but you can also pass custom functions to calculate your own quantities). Likewise estimates is a list of estimates to calculate at each time step (available functions are in the estimates list, but you can also pass custom functions to calculate your own estimates). See the time evolution example for more details.

Citation

If you use aurel in your work, please cite:

Munoz, R. L. (2025). Aurel: A Python package for automatic relativistic calculations. GitHub. https://github.com/robynlm/aurel
@misc{aurel2025,
  title     = {Aurel: A Python package for automatic relativistic calculations},
  author    = {Munoz, Robyn L.},
  publisher = {GitHub},
  year      = {2025},
  url       = {https://github.com/robynlm/aurel}
}

This code is not published yet, so to add to citation count please also include:

Munoz, R. L., & Bruni, M. (2023). EBWeyl: a Code to Invariantly Characterize Numerical Spacetimes. Classical and Quantum Gravity, 40(13), 135010. https://doi.org/10.1088/1361-6382/acd6cf
@article{R.L.Munoz_M.Bruni_2023,
  title     = {EBWeyl: a Code to Invariantly Characterize Numerical Spacetimes},
  author    = {Munoz, Robyn L. and Bruni, Marco},
  journal   = {Classical and Quantum Gravity},
  volume    = {40},
  number    = {13},
  pages     = {135010},
  year      = {2023},
  month     = {jun},
  doi       = {10.1088/1361-6382/acd6cf},
  archivePrefix = {arXiv},
  eprint    = {2211.08133},
  primaryClass = {gr-qc}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aurel-0.9.3.tar.gz (108.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aurel-0.9.3-py3-none-any.whl (88.9 kB view details)

Uploaded Python 3

File details

Details for the file aurel-0.9.3.tar.gz.

File metadata

  • Download URL: aurel-0.9.3.tar.gz
  • Upload date:
  • Size: 108.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for aurel-0.9.3.tar.gz
Algorithm Hash digest
SHA256 578d5d2b4c78435c2aca3f436df1a308bf0a00260ef88f1b5949070d5c5c54a9
MD5 d181a226d4a14468152de96fa2e5c79b
BLAKE2b-256 1343ccfaf7f35418d9b831b203f4f4ebcdc44a7e430c952abef1857169257980

See more details on using hashes here.

File details

Details for the file aurel-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: aurel-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 88.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for aurel-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9466782c00cc5b1c8ec3677db66f8bebddd82b5bd8c2758e9eca0a8845ab00a3
MD5 e709d72d4755b156b9b27b5c1c9492a7
BLAKE2b-256 c01a4ecfb338264b044cbce407a16203f2eb3028e6e04e188cae2e00407752cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page