Back to directory

NRPy+, SENRv2, and the NRPy+ Jupyter Tutorial

A Jupyter-based tutorial teaching Python code generation for numerical relativity, using the symbolic-math library SymPy to derive and emit optimized C code for solving Einstein's equations.

NRPy+, SENRv2, and the NRPy+ Jupyter Tutorial

NRPy+ generates C code for numerical relativity simulations by manipulating the underlying tensor equations symbolically in Python with SymPy, rather than hand-writing the discretized equations, and the tutorial walks through how that code-generation approach works step by step in a series of runnable Jupyter notebooks. The repository also includes SENRv2, a simple and efficient numerical relativity code, with a start-to-finish tutorial notebook that constructs a colliding-black-holes simulation.

The tutorial can be explored without installing anything through a hosted Binder notebook, or run locally with Python, Jupyter, SymPy and Matplotlib installed; a helper script and a documented nbconvert command let a notebook that builds an Einstein Toolkit thorn be executed from the command line instead of interactively.

It is licensed under BSD-2-Clause.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.