TwoPunctures
).¶Post-Newtonian theory results in some of the longest and most complex mathematical expressions ever derived by humanity.
These expressions form the core of most gravitational wave data analysis codes, but generally, the expressions are written in a format that is either inaccessible by others (i.e., closed-source) or written directly in e.g., C code and thus incompatible with symbolic algebra packages like Wolfram Mathematica or the Python-based SymPy.
Once in a symbolic algebra package, these expressions could be manipulated, extended, and output as more optimized C codes (e.g., using SymPy/NRPy+, thus speeding up gravitational wave data analysis).
This repository aims to provide a trusted source for validated Post-Newtonian expressions useful for gravitational wave astronomy, using the open-source SymPy computer algebra system so that expressions can be output into Wolfram Mathematica or highly optimized C codes using the SymPy-based NRPy+.
*If you are unfamiliar with using Jupyter Notebooks, first review the official Jupyter Notebook Basics Guide.*
The Post-Newtonian Hamiltonian $H$ can be written as a sum of contributions: \begin{array} \ H = H_{\rm Orb, NS} + H_{\rm SO} + H_{\rm SS} + H_{\rm SSS}, \end{array} where
Click on any term below to open a notebook implementing that Hamiltonian component.
Assumptions:
The following code cell assumes the black holes are
Note that other initial coordinate configurations are possible; just permute the coordinates consistently with a right-handed coordinate system. For example,
Instructions: Set the 8 parameters for the binary black hole system in the code cell below, which make the above assumptions. Then after setting the parameters press Shift+Enter. The tangential and radial components of the orbital momentum vector will be computed and output.
If using TwoPunctures
: If you plan to use these parameters with TwoPunctures, you will need to set
TwoPunctures::give_bare_mass = no
TwoPunctures::target_m_minus =
$q/(1+q)$TwoPunctures::target_m_plus =
$1/(1+q)$TwoPunctures::par_P_plus[0] = -|P_r|
(from code cell output below)TwoPunctures::par_P_plus[1] = +|P_t|
(from code cell output below)TwoPunctures::par_P_minus[0] = +|P_r|
(from code cell output below)TwoPunctures::par_P_minus[1] = -|P_t|
(from code cell output below)TwoPunctures::par_S_plus[0] = nchi1x*TwoPunctures::target_m_plus*TwoPunctures::target_m_plus
(from input into code cell below)TwoPunctures::par_S_plus[1] = nchi1y*TwoPunctures::target_m_plus*TwoPunctures::target_m_plus
(from input into code cell below)TwoPunctures::par_S_plus[2] = nchi1z*TwoPunctures::target_m_plus*TwoPunctures::target_m_plus
(from input into code cell below)TwoPunctures::par_S_minus[]
#### INPUT PARAMETERS:
qmassratio = 1.75 # m2/m1; by convention must be >= 1
nr = 10.8 # Orbital separation
# Dimensionless spin parameters of each black hole, assuming
# the black holes are initially orbiting on the xy-plane
# and situated on the x-axis, with the center-of-mass at
# x=y=z=0. Black hole 1 is at x>0; and black hole 2 at x<0.
nchi1x = +0. # chi_{1x}, x-component of dimensionless spin for black hole 1 (instantaneously at x>0)
nchi1y = +0. # chi_{1y}, y-component of dimensionless spin for black hole 1 (instantaneously at x>0)
nchi1z = +0.6 # chi_{1z}, z-component of dimensionless spin for black hole 1 (instantaneously at x>0)
nchi2x = +0. # chi_{2x}, x-component of dimensionless spin for black hole 2 (instantaneously at x<0)
nchi2y = +0. # chi_{2y}, y-component of dimensionless spin for black hole 2 (instantaneously at x<0)
nchi2z = +0.6 # chi_{2z}, z-component of dimensionless spin for black hole 2 (instantaneously at x<0)
##########################################################
#### DON'T TOUCH; see output after running this cell. ####
from NRPyPN_shortcuts import eval__P_t__and__P_r
# Compute nPt, the tangential component of orbital momentum vector (output = numerical), as well as
# nPr, the radial component of orbital momentum vector (output = numerical)
nPt, nPr = eval__P_t__and__P_r(qmassratio, nr,
nchi1x, nchi1y, nchi1z,
nchi2x, nchi2y, nchi2z)
print("If the black holes are situated on the x-axis, and orbiting instantaneously in the")
print(" xy-plane, then one could have P_y=+|P_t| and P_x=-|P_r| for the x>0 black hole,")
print(" and P_y=-|P_t| and P_x=+|P_r| for the x<0 black hole. Other configurations are")
print(" possible provided one permutes the coordinates consistently with a right-handed")
print(" coordinate system.")
print("|P_t| = ",nPt)
print("|P_r| = ",nPr)
If the black holes are situated on the x-axis, and orbiting instantaneously in the xy-plane, then one could have P_y=+|P_t| and P_x=-|P_r| for the x>0 black hole, and P_y=-|P_t| and P_x=+|P_r| for the x<0 black hole. Other configurations are possible provided one permutes the coordinates consistently with a right-handed coordinate system. |P_t| = 0.0813467633310249 |P_r| = 0.000553891860334773
The following code cell converts this Jupyter notebook into a proper, clickable $\LaTeX$-formatted PDF file. After the cell is successfully run, the generated PDF may be found in the root NRPy+ tutorial directory, with filename NRPyPN.pdf (Note that clicking on this link may not work; you may need to open the PDF file through another means.)
import os,sys # Standard Python modules for multiplatform OS-level functions
import cmdline_helperNRPyPN as cmd # NRPy+: Multi-platform Python command-line interface
cmd.output_Jupyter_notebook_to_LaTeXed_PDF("NRPyNP")