Notebook Status: Validated
Validation Notes: All expressions in this notebook were transcribed twice by hand on separate occasions, and expressions were corrected as needed to ensure consistency with published PN expressions. In addition, this tutorial notebook has been confirmed to be self-consistent with its corresponding NRPy+ module, as documented below. Additional validation tests may have been performed, but are as yet, undocumented.
As described in the nonspinning Hamiltonian notebook, the basic physical system assumes two point particles of mass $m_1$ and $m_2$ with corresponding momentum vectors $\mathbf{P}_1$ and $\mathbf{P}_2$, and displacement vectors $\mathbf{X}_1$ and $\mathbf{X}_2$ with respect to the center of mass. Here we also consider the spin vectors of each point mass $\mathbf{S}_1$ and $\mathbf{S}_2$, respectively.
Steinhoff, Hergt, and Schäfer (2008a) and Steinhoff, Hergt, and Schäfer (2008b) adopt the additional notation
\begin{align} \mathbf{r}_{12} &= (\mathbf{X}_1-\mathbf{X}_2)\\ r_{12} = r_{21} &= |\mathbf{r}_{12}|\\ \mathbf{n}_{12} &= \frac{\mathbf{r}_{12}}{r_{12}}, \end{align}and when the numbers in subscripts are flipped, the particles are interchanged.
To reduce the possibility of copying errors, the equation for $H_{\rm SSS, 3PN}$ is taken directly from the arXiv LaTeX source code of Eq 3.12 in Levi and Steinhoff (2015), and only mildly formatted to (1) improve presentation in Jupyter notebooks and (2) to ensure some degree of consistency in notation across different terms in other Hamiltonian notebooks:
\begin{align} H_{\text{SSS(BHB),\ 3PN}}&=\frac{1}{m_1^2r^4}\left\{\frac{3}{2}\left(\mathbf{S}_{1}^2\, \mathbf{S}_{2}\cdot\mathbf{n}\times\mathbf{p}_{1} +\mathbf{S}_{1}\cdot\mathbf{n}\,\mathbf{S}_{2}\cdot\mathbf{S}_{1}\times\mathbf{p}_{1} -5\left(\mathbf{S}_{1}\cdot\mathbf{n}\right)^2\mathbf{S}_{2}\cdot\mathbf{n}\times\mathbf{p}_{1}\right.\right.\\ &\qquad\qquad\quad +\mathbf{n}\cdot\mathbf{S}_{1}\times\mathbf{S}_{2}\left(\mathbf{S}_{1}\cdot\mathbf{p}_{1} -5\mathbf{S}_{1}\cdot\mathbf{n}\,\mathbf{p}_{1}\cdot\mathbf{n}\right)\\ &\qquad\quad -\frac{3m_1}{2m_2}\left[\mathbf{S}_{1}^2\, \mathbf{S}_{2}\cdot\mathbf{n}\times\mathbf{p}_2+2\mathbf{S}_{1}\cdot\mathbf{n}\, \mathbf{S}_{2}\cdot\mathbf{S}_{1}\times\mathbf{p}_{2} -5\left(\mathbf{S}_{1}\cdot\mathbf{n}\right)^2\mathbf{S}_{2}\cdot\mathbf{n}\times\mathbf{p}_{2}\right)\bigg]\\ &\qquad\qquad \left.-\mathbf{S}_{1}\times\mathbf{n}\cdot\left(\mathbf{p}_{2} -\frac{m_2}{4m_1}\mathbf{p}_{1}\right)\left(\mathbf{S}_{1}^2 -5\left(\mathbf{S}_{1}\cdot\mathbf{n}\right)^2\right)\right\}\\ &\quad+ 1\longleftrightarrow2. \end{align}# Step 0: Add NRPy's directory to the path
# https://stackoverflow.com/questions/16780014/import-file-from-parent-directory
import indexedexpNRPyPN as ixp # NRPy+: Symbolic indexed expression (e.g., tensors, vectors, etc.) support
from NRPyPN_shortcuts import div,dot,cross # NRPyPN: shortcuts for e.g., vector operations
# Step 1: 3PN spin-spin-spin term, from Eq. 3.12 of
# Levi and Steinhoff (2015):
# https://arxiv.org/abs/1410.2601
def f_H_SSS_3PN(m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, r12):
def f_H_SSS_3PN_pt(m1,m2, nU, S1U,S2U, p1U,p2U, r):
p2_minus_m2_over_4m1_p1 = ixp.zerorank1()
for i in range(3):
p2_minus_m2_over_4m1_p1[i] = p2U[i] - m2/(4*m1)*p1U[i]
H_SSS_3PN_pt = (+div(3,2)*(+dot(S1U,S1U)*dot(S2U,cross(nU,p1U))
+dot(S1U,nU)*dot(S2U,cross(S1U,p1U))
-5*dot(S1U,nU)**2*dot(S2U,cross(nU,p1U))
+dot(nU,cross(S1U,S2U))*(+dot(S1U,p1U)
-5*dot(S1U,nU)*dot(p1U,nU)))
-3*m1/(2*m2)*( +dot(S1U,S1U) *dot(S2U,cross(nU,p2U))
+2*dot(S1U,nU) *dot(S2U,cross(S1U,p2U))
-5*dot(S1U,nU)**2*dot(S2U,cross(nU,p2U)))
-dot(cross(S1U,nU),p2_minus_m2_over_4m1_p1)*(dot(S1U,S1U) - 5*dot(S1U,nU)**2))/(m1**2*r**4)
return H_SSS_3PN_pt
global H_SSS_3PN
H_SSS_3PN = (+f_H_SSS_3PN_pt(m1,m2, n12U, S1U,S2U, p1U,p2U, r12)
+f_H_SSS_3PN_pt(m2,m1, n21U, S2U,S1U, p2U,p1U, r12))
# Second version, for validation purposes only.
def f_H_SSS_3PNv2(m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, q):
def SHS2015_HSSS_3PNv2_pt(m1,m2, nU, S1U,S2U, p1U,p2U, q):
p2_minus_m2_over_4m1_p1 = ixp.zerorank1()
for i in range(3):
p2_minus_m2_over_4m1_p1[i] = p2U[i] - m2/(4*m1)*p1U[i]
H = ( div(3,2)*(+ dot(S1U,S1U)*dot(S2U,cross(nU,p1U)) # line 1
+ dot(S1U,nU)*dot(S2U,cross(S1U,p1U)) # line 1
-5*dot(S1U,nU)**2*dot(S2U,cross(nU,p1U)) # line 1
+dot(nU,cross(S1U,S2U))*(dot(S1U,p1U)-5*dot(S1U,nU)*dot(p1U,nU))) # line 2
-div(3,2)*m1/m2*(+ dot(S1U,S1U)*dot(S2U,cross(nU,p2U)) # line 3
+2*dot(S1U,nU)*dot(S2U,cross(S1U,p2U)) # line 3
-5*dot(S1U,nU)**2*dot(S2U,cross(nU,p2U))) # line 3
-dot(cross(S1U,nU), p2_minus_m2_over_4m1_p1)*(dot(S1U,S1U) - 5*dot(S1U,nU)**2 ))/(m1**2*q**4)
return H
global H_SSS_3PNv2
H_SSS_3PNv2 = (+SHS2015_HSSS_3PNv2_pt(m1,m2, n12U, S1U,S2U, p1U,p2U, q)
+SHS2015_HSSS_3PNv2_pt(m2,m1, n21U, S2U,S1U, p2U,p1U, q))
As a code validation check, we verify agreement between
import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends
from NRPyPN_shortcuts import m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, q # NRPyPN: import needed input variables
f_H_SSS_3PN(m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, q)
def error(varname):
print("ERROR: When comparing Python module & notebook, "+varname+" was found not to match.")
sys.exit(1)
# Validation against second transcription of the expressions:
f_H_SSS_3PNv2(m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, q)
if sp.simplify(H_SSS_3PN - H_SSS_3PNv2) != 0: error("H_SSS_3PNv2")
# Validation against corresponding Python module:
import PN_Hamiltonian_SSS as HSSS
HSSS.f_H_SSS_3PN(m1,m2, n12U,n21U, S1U,S2U, p1U,p2U, q)
if sp.simplify(H_SSS_3PN - HSSS.H_SSS_3PN) != 0: error("H_SSS_3PN")
print("ALL TESTS PASS")
ALL TESTS PASS
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 PN-Hamiltonian-SSS.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("PN-Hamiltonian-SSS")
Created PN-Hamiltonian-SSS.tex, and compiled LaTeX file to PDF file PN- Hamiltonian-SSS.pdf