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+ 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.