{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "# The Spinning Effective One-Body Hamiltonian\n", "\n", "## Author: Tyler Knowles\n", "### Formatting improvements courtesy Brandon Clark\n", "\n", "## This module documents the reduced spinning effective one-body Hamiltonian as numerically implemented in LALSuite's SEOBNRv3 gravitational waveform approximant. Through a canonical transformation, $H_{\\text{real}}$ translates to $H_{\\text{eff}}$ representing a test particle's trajectory in a deformed Kerr background. The notebook presents Python code for $H_{\\text{real}}$ computation, utilizing inputs such as black hole masses, the Euler-Mascheroni constant, a tortoise coordinate, and twelve dynamic variables.\n", "\n", "**Notebook Status:** Validated \n", "\n", "**Validation Notes:** This module has been validated against the LALSuite [SEOBNRv3/SEOBNRv3_opt code]( https://git.ligo.org/lscsoft/lalsuite.) that was reviewed and approved for LIGO parameter estimation by the LIGO Scientific Collaboration. That is, the value $H_{\\rm real}$ output from this notebook agrees to roundoff error with the value of $H_{\\rm real}$ computed by the LALSuite function XLALSimIMRSpinPrecEOBHamiltonian().\n", "\n", "### NRPy+ Source Code for this module: [SEOBNR_v3_Hamiltonian.py](../edit/SEOBNR/SEOBNR_v3_Hamiltonian.py)\n", "\n", "\n", "\n", "## Introduction\n", "$$\\label{intro}$$\n", "\n", "### The Physical System of Interest\n", "\n", "Consider two black holes with masses $m_{1}$, $m_{2}$ and spins ${\\bf S}_{1}$, ${\\bf S}_{2}$ in a binary system. The spinning effective one-body (\"SEOB\") Hamiltonian $H_{\\rm real}$ (defined in [this cell](#hreal)) describes the dynamics of this system; we will define $H_{\\rm real}$ as in [Barausse and Buonanno (2010)](https://arxiv.org/abs/0912.3517) Section VE. There, $H_{\\rm real}$ is canonically transformed and mapped to an effective Hamiltonian $H_{\\rm eff}$ (defined in [this cell](#heff)) describing the motion of a test particle of mass $\\mu$ (defined in [this cell](#mu)) and spin ${\\bf S}^{*}$ (defined in [this cell](#sstar)) moving in a deformed Kerr background. Here we seek to break up $H_{\\rm real}$ and document the terms in such a way that the resulting Python code can be used to numerically evaluate $H_{\\rm real}$.\n", "\n", "We write $H_{\\rm real}$ in terms of Cartesian quasi-isotropic coordinates $x$, $y$, and $z$ (see [Barausse and Buonanno (2010)](https://arxiv.org/abs/0912.3517) Section III). The spatial coordinates $r$, $\\theta$, and $\\phi$ referenced throughout are [Boyer-Lindquist coordinates](https://en.wikipedia.org/wiki/Boyer%E2%80%93Lindquist_coordinates) (see [Barausse and Buonanno (2010)](https://arxiv.org/abs/0912.3517) Section IV).\n", "\n", "Please note that throughout this notebook we adopt the following conventions:\n", "\n", "1. $c = 1$ where $c$ is the speed of light in a vacuum,\n", "1. spacial tensor indices are denoted by lowercase Latin letters,\n", "1. repeated indices indicate Einstein summation notation, and\n", "1. we normalize $M=1$ in all terms except for $\\eta$ and $\\mu$ for agreement with LALSuite. Nonetheless, $M$ appears in other text cells for comparison with the cited literature.\n", "\n", "Running this notebook to completion will generate a file called Hreal_on_bottom.py. This file contains the Python function compute_Hreal(), which takes as input m1, m2 (each in solar masses), the value of the [Euler-Mascheroni constant](https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant), a tortoise coordinate, and values for all twelve dynamic variables (3 components of the separation vector, three components of the momentum vector, and three spin components of each compact object). Note that the spin components should be dimensionless.\n", "\n", "### Citations\n", "Throughout this module, we will refer to\n", "* [Barausse and Buonanno (2010)](https://arxiv.org/abs/0912.3517) as BB2010,\n", "* [Barausse and Buonanno (2011)](https://arxiv.org/abs/1107.2904) as BB2011,\n", "* [Steinhoff, Hinderer, Buonanno, et al (2016)](https://arxiv.org/abs/1608.01907) as SH2016,\n", "* [Pan, Buonanno, Buchman, et. al. 2010](https://arxiv.org/abs/0912.3466v2) as P2010,\n", "* [Taracchini, Buonanno, Pan, et al (2014)](https://arxiv.org/abs/1311.2544) as T2014,\n", "* [Taracchini, Pan, Buonanno, et al (2012)](https://arxiv.org/abs/1202.0790) as T2012, and\n", "* [Damour, Jaranowski, and Schaefer (2000)](https://arxiv.org/abs/gr-qc/0005034) as D2000." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Table of Contents\n", "$$\\label{toc}$$\n", "\n", "This notebook is organized as follows:\n", "\n", "1. [Step 0](#outputcreation): Creating the output directory for SEOBNR\n", "1. [Step 1](#hreal): The Real Hamiltonian $H_{\\rm real}$\n", "1. [Step 2](#heff): The Effective Hamiltonian $H_{\\rm eff}$\n", "1. [Step 3](#heff_terms): Terms of $H_{\\rm eff}$ \n", " 1. [Step 3.a](#hs): Leading Order Spin Effects $H_{\\rm S}$ \n", " 1. [Step 3.b](#hns): The Nonspinning Hamiltonian $H_{\\rm NS}$ \n", " 1. [Step 3.c](#hd): The Quadrupole Deformation $H_{\\rm D}$\n", "1. [Step 4](#hso): The Spin-Orbit Term $H_{\\rm SO}$ \n", " 1. [Step 4.a](#hsoterm1): $H_{\\rm SO}$ Term 1 \n", " 1. [Step 4.b](#hsoterm2coeff): $H_{\\rm SO}$ Term 2 Coefficient \n", " 1. [Step 4.c](#hsoterm2): $H_{\\rm SO}$ Term 2 \n", " 1. [Step 4.c.i](#hsoterm2a): $H_{\\rm SO}$ Term 2a \n", " 1. [Step 4.c.ii](#hsoterm2b): $H_{\\rm SO}$ Term 2b \n", " 1. [Step 4.c.iii](#hsoterm2c): $H_{\\rm SO}$ Term 2c\n", "1. [Step 5](#hss): The Spin-Spin Term $H_{\\rm SS}$ \n", " 1. [Step 5.a](#hssterm1): $H_{\\rm SS}$ Term 1 \n", " 1. [Step 5.b](#hssterm2coeff): $H_{\\rm SS}$ Term 2 coefficient \n", " 1. [Step 5.c](#hssterm2): $H_{\\rm SS}$ Term 2 \n", " 1. [Step 5.d](#hssterm3coeff): $H_{\\rm SS}$ Term 3 coefficient \n", " 1. [Step 5.e](#hssterm3): $H_{\\rm SS}$ Term 3\n", "1. [Step 6](#hnsterms): The $H_{\\rm NS}$ Terms \n", " 1. [Step 6.a](#betapsum): $\\beta p$ Sum \n", " 1. [Step 6.b](#alpha): $\\alpha$ \n", " 1. [Step 6.c](#hnsradicand): $H_{\\rm NS}$ Radicand \n", " 1. [Step 6.c.i](#gammappsum): $\\gamma p$ Sum \n", " 1. [Step 6.c.ii](#q4): ${\\cal Q}_{4}$\n", "1. [Step 7](#hdterms): The $H_{\\rm D}$ Terms \n", " 1. [Step 7.a](#hdcoeff): $H_{\\rm D}$ Coefficient \n", " 1. [Step 7.b](#hdsum): $H_{\\rm D}$ Sum \n", " 1. [Step 7.b.i](#hdsumterm1): $H_{\\rm D}$ Sum Term 1 \n", " 1. [Step 7.b.ii](#hdsumterm2): $H_{\\rm D}$ Sum Term 2\n", "1. [Step 8](#dotproducts): Common Dot Products\n", " 1. [Step 8.a](#sdotxi): ${\\bf S} \\cdot \\boldsymbol{\\xi}$ \n", " 1. [Step 8.b](#sdotv): ${\\bf S} \\cdot {\\bf v}$ \n", " 1. [Step 8.c](#sdotn): ${\\bf S} \\cdot {\\bf n}$ \n", " 1. [Step 8.d](#sdotskerrhat): ${\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr}$ \n", " 1. [Step 8.e](#sstardotn): ${\\bf S}^{*} \\cdot {\\bf n}$\n", "1. [Step 9](#hreal_spin_combos): $H_{\\rm real}$ Spin Combination ${\\bf S}^{*}$ \n", " 1. [Step 9a](#sstar): ${\\bf S}^{*}$ \n", " 1. [Step 9b](#deltasigmastar): $\\Delta_{\\sigma^{*}}$ \n", " 1. [Step 9c](#sigmastarcoeff): $\\sigma^{*}$ Coefficient \n", " 1. [Step 9c i](#sigmastarcoeffterm1): $\\sigma^{*}$ Coefficient Term 1 \n", " 1. [Step 9c ii](#sigmastarcoeffterm2): $\\sigma^{*}$ Coefficient Term 2 \n", " 1. [Step 9d](#sigmacoeff): $\\sigma$ Coefficient \n", " 1. [Step 9d i](#sigmacoeffterm1): $\\sigma$ Coefficient Term 1 \n", " 1. [Step 9d ii](#sigmacoeffterm2): $\\sigma$ Coefficient Term 2 \n", " 1. [Step 9d iii](#sigmacoeffterm3): $\\sigma$ Coefficient Term 3\n", "1. [Step 10](#metpotderivs): Derivatives of the Metric Potential \n", " 1. [Step 10.a](#omegar): $\\omega_{r}$ \n", " 1. [Step 10.b](#nur): $\\nu_{r}$ \n", " 1. [Step 10.c](#mur): $\\mu_{r}$ \n", " 1. [Step 10.d](#omegacostheta): $\\omega_{\\cos\\theta}$ \n", " 1. [Step 10.e](#nucostheta): $\\nu_{\\cos\\theta}$ \n", " 1. [Step 10.f](#mucostheta): $\\mu_{\\cos\\theta}$ \n", " 1. [Step 10.g](#lambdatprm): $\\Lambda_{t}^{\\prime}$ \n", " 1. [Step 10.h](#omegatildeprm): $\\tilde{\\omega}_{\\rm fd}^{\\prime}$\n", "1. [Step 11](#metpots): The Deformed and Rescaled Metric Potentials \n", " 1. [Step 11.a](#omega): $\\omega$ \n", " 1. [Step 11.b](#exp2nu): $e^{2 \\nu}$ \n", " 1. [Step 11.c](#btilde): $\\tilde{B}$ \n", " 1. [Step 11.d](#brtilde): $\\tilde{B}_{r}$ \n", " 1. [Step 11.e](#exp2mu): $e^{2 \\tilde{\\mu}}$ \n", " 1. [Step 11.f](#jtilde): $\\tilde{J}$ \n", " 1. [Step 11.g](#q): $Q$ \n", " 1. [Step 11.g.i](#drsipn2): $\\frac{ \\Delta_{r} }{ \\Sigma } \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right)^{2}$ \n", " 1. [Step 11.g.ii](#qcoeff1): Q Coefficient 1 \n", " 1. [Step 11.g.iii](#qcoeff2): Q Coefficient 2\n", "1. [Step 12](#tort): Tortoise terms \n", " 1. [Step 12.a](#pphi): $p_{\\phi}$ \n", " 1. [Step 12.b](#pdotvr): $\\hat{\\bf p} \\cdot {\\bf v} r$ \n", " 1. [Step 12.c](#pdotn): $\\hat{\\bf p} \\cdot {\\bf n}$ \n", " 1. [Step 12.d](#pdotxir): $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ \n", " 1. [Step 12.e](#hatp): $\\hat{\\bf p}$ \n", " 1. [Step 12.f](#prt): prT \n", " 1. [Step 12.g](#csi2): csi2 \n", " 1. [Step 12.h](#csi1): csi1 \n", " 1. [Step 12.i](#csi): csi\n", "1. [Step 13](#metric): Metric Terms \n", " 1. [Step 13.a](#lambdat): $\\Lambda_{t}$ \n", " 1. [Step 13.b](#deltar): $\\Delta_{r}$ \n", " 1. [Step 13.c](#deltat): $\\Delta_{t}$ \n", " 1. [Step 13.d](#deltatprm): $\\Delta_{t}^{\\prime}$ \n", " 1. [Step 13.e](#deltau): $\\Delta_{u}$ \n", " 1. [Step 13.e.i](#deltaubar): $\\bar{\\Delta}_{u}$ \n", " 1. [Step 13.e.ii](#deltaucalib): $\\Delta_{u}$ Calibration Term \n", " 1. [Step 13.e.iii](#calib_coeffs): Calibration Coefficients \n", " 1. [Step 13.e.iv](#k): $K$ \n", " 1. [Step 13.f](#omegatilde): $\\tilde{\\omega}_{\\rm fd}$ \n", " 1. [Step 13.g](#dinv): $D^{-1}$\n", "1. [Step 14](#coord): Terms Dependent on Coordinates \n", " 1. [Step 14.a](#usigma): $\\Sigma$ \n", " 1. [Step 14.b](#w2): $\\varpi^{2}$ \n", " 1. [Step 14.d](#sin2theta): $\\sin^{2}\\theta$ \n", " 1. [Step 14.e](#costheta): $\\cos\\theta$\n", "1. [Step 15](#vectors): Important Vectors \n", " 1. [Step 15.a](#v): ${\\bf v}$ \n", " 1. [Step 15.b](#xi): $\\boldsymbol{\\xi}$ \n", " 1. [Step 15.c](#e3): ${\\bf e}_{3}$ \n", " 1. [Step 15.d](#n): ${\\bf n}$\n", "1. [Step 16](#spin_combos): Spin Combinations $\\boldsymbol{\\sigma}$, $\\boldsymbol{\\sigma}^{*}$, and ${\\bf S}_{\\rm Kerr}$ \n", " 1. [Step 16.a](#a): $a$ \n", " 1. [Step 16.b](#skerrhat): $\\hat{\\bf S}_{\\rm Kerr}$ \n", " 1. [Step 16.c](#skerrmag): $\\left\\lvert {\\bf S}_{\\rm Kerr} \\right\\rvert$ \n", " 1. [Step 16.d](#skerr): ${\\bf S}_{\\rm Kerr}$ \n", " 1. [Step 16.e](#sigma): $\\boldsymbol{\\sigma}$ \n", " 1. [Step 16.f](#sigmastar): $\\boldsymbol{\\sigma}^{*}$\n", "1. [Step 17](#fundquant): Fundamental Quantities \n", " 1. [Step 17.a](#u): $u$ \n", " 1. [Step 17.b](#r): $r$ \n", " 1. [Step 17.c](#eta): $\\eta$ \n", " 1. [Step 17.d](#mu): $\\mu$ \n", " 1. [Step 17.e](#m): $M$\n", "1. [Step 18](#validation): Validation\n", "1. [Step 19](#latex_pdf_output): Output this notebook to $\\LaTeX$-formatted PDF file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 0: Creating the output directory for SEOBNR \\[Back to [top](#toc)\\]\n", "$$\\label{outputcreation}$$\n", "\n", "First we create the output directory for SEOBNR (if it does not already exist):" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.579608Z", "iopub.status.busy": "2021-03-07T17:24:21.578386Z", "iopub.status.idle": "2021-03-07T17:24:21.583810Z", "shell.execute_reply": "2021-03-07T17:24:21.584415Z" } }, "outputs": [], "source": [ "import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n", "\n", "# Create C code output directory:\n", "Ccodesdir = \"SEOBNR\"\n", "# Then create an output directory in case it does not exist\n", "cmd.mkdir(Ccodesdir)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 1: The real Hamiltonian $H_{\\textrm{real}}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hreal}$$\n", "\n", "The SEOB Hamiltonian $H_{\\rm real}$ is given by [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.69):\n", "\n", "\\begin{equation*}\n", " H_{\\rm real} = M \\sqrt{ 1 + 2 \\eta \\left( \\frac{ H_{\\rm eff} }{ \\mu } - 1 \\right) }.\n", "\\end{equation*}\n", "\n", "Here $H_{\\rm eff}$ (defined in [this cell](#heff)) is an *effective* Hamiltonian (see [this cell](#intro)) and $M$ (defined in [this cell](#m)), $\\mu$ (defined in [this cell](#mu)), and $\\eta$ (defined in [this cell](#eta)) are constants determined by $m_{1}$ and $m_{2}$." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.591554Z", "iopub.status.busy": "2021-03-07T17:24:21.590549Z", "iopub.status.idle": "2021-03-07T17:24:21.594443Z", "shell.execute_reply": "2021-03-07T17:24:21.594987Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Overwriting SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "Hreal = sp.sqrt(1 + 2*eta*(Heff - 1))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 2: The Effective Hamiltonian $H_{\\rm eff}$ \\[Back to [top](#toc)\\]\n", "$$\\label{heff}$$\n", "\n", "The effective Hamiltonian $H_{\\rm eff}$ is given by [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.70):\n", "\n", "\\begin{equation*}\n", " H_{\\rm eff} = H_{\\rm S} + \\underbrace{ \\beta^{i} p_{i} + \\alpha \\sqrt{ \\mu^{2} + \\gamma^{ij} p_{i} p_{j} + {\\cal Q}_{4} } }_{ H_{\\rm NS} } - \\underbrace{ \\frac{ \\mu }{ 2 M r^{3} } \\left( \\delta^{ij} - 3 n^{i} n^{j} \\right) S^{*}_{i} S^{*}_{j} }_{ H_{\\rm D} }.\n", "\\end{equation*}\n", "\n", "Here $H_{\\rm S}$ (considered further in [this cell](#hs)) denotes leading order effects of spin-spin and spin-orbit coupling, $H_{\\rm NS}$ (considered further in [this cell](#hns)) is the Hamiltonian for a nonspinning test particle, and $H_{\\rm D}$ (considered further in [this cell](#hd)) describes quadrupole deformation of the coupling of the particle's spin with itself to leading order. [T2014](https://arxiv.org/abs/1311.2544) adds to $H_{\\rm eff}$ a 3PN spin-spin term given by\n", "\n", "\\begin{equation*}\n", " \\frac{d_{\\rm SS} \\eta }{ r^{4} } \\left( {\\bf S}_{1}^{2} + {\\bf S}_{2}^{2} \\right)\n", "\\end{equation*}\n", "\n", "where $d_{\\rm SS}$ is an adjustable parameter determined by fitting to numerical relativity results. We take $u \\equiv \\frac{1}{r}$ (as described in [this cell](#u)) and define $\\eta$ in [this cell](#eta)." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.600220Z", "iopub.status.busy": "2021-03-07T17:24:21.599468Z", "iopub.status.idle": "2021-03-07T17:24:21.602481Z", "shell.execute_reply": "2021-03-07T17:24:21.602975Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Heff = Hs + Hns - Hd + dSS*eta*u*u*u*u*(S1x*S1x + S1y*S1y + S1z*S1z + S2x*S2x + S2y*S2y + S2z*S2z)\n", "dSS = 8.127 - 154.2*eta + 830.8*eta*eta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 3: Terms of $H_{\\rm eff}$ \\[Back to [top](#toc)\\]\n", "$$\\label{heff_terms}$$\n", "\n", "In this step, we break down each of the terms $H_{\\rm S}$ (defined in [this cell](#hs)), $H_{\\rm NS}$ (defined in [this cell](#hns)), and $H_{\\rm D}$ (defined in [this cell](#hd)) in $H_{\\rm eff}$ (defined in [this cell](#heff))." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.a: Leading Order Spin Effects $H_{\\rm S}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hs}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.17),\n", "\n", "\\begin{equation*}\n", " H_{\\rm S} = H_{\\rm SO} + H_{\\rm SS}\n", "\\end{equation*}\n", "\n", "where $H_{\\rm SO}$ (defined in [this cell](#hso)) includes spin-orbit terms and $H_{\\rm SS}$ (defined in [this cell](#hss)) includes spin-spin terms." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.608214Z", "iopub.status.busy": "2021-03-07T17:24:21.607363Z", "iopub.status.idle": "2021-03-07T17:24:21.610910Z", "shell.execute_reply": "2021-03-07T17:24:21.610350Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hs = Hso + Hss" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.b: The Nonspinning Hamiltonian $H_{\\rm NS}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hns}$$\n", "\n", "We defined $H_{\\rm NS}$ in [this cell](#heff) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm NS} = \\underbrace{ \\beta^{i} p_{i} }_{ \\beta\\ p\\ \\rm sum } + \\alpha \\sqrt{ \\smash[b]{ \\underbrace{ \\mu^{2} + \\gamma^{ij} p_{i} p_{j} + {\\cal Q}_{4} }_{ H_{\\rm NS}\\ \\rm radicand } } }.\n", "\\end{equation*}\n", "\n", "We compute $\\beta\\ p$ sum in [this cell](#betapsum), $\\alpha$ in [this cell](#alpha), and $H_{\\rm NS}$ radicand in [this cell](#hnsradicand)." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.615984Z", "iopub.status.busy": "2021-03-07T17:24:21.615147Z", "iopub.status.idle": "2021-03-07T17:24:21.618866Z", "shell.execute_reply": "2021-03-07T17:24:21.618219Z" }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hns = betapsum + alpha*sp.sqrt(Hnsradicand)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.c: The Quadrupole Deformation $H_{\\rm D}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hd}$$\n", "\n", "We defined $H_{\\rm D}$ in [this cell](#heff) as:\n", "\n", "\\begin{equation*}\n", " H_{\\rm D} = \\underbrace{ \\frac{ \\mu }{ 2 M r^{3} } }_{H_{\\rm D}\\ {\\rm coefficient}} \\underbrace{ \\left( \\delta^{ij} - 3 n^{i} n^{j} \\right) S^{*}_{i} S^{*}_{j} }_{H_{\\rm D}\\ {\\rm sum}}\n", "\\end{equation*}\n", "\n", "We compute $H_{\\rm D}$ coefficient in [this cell](#hdcoeff) and $H_{\\rm D}$ sum in [this cell](#hdsum)." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.624355Z", "iopub.status.busy": "2021-03-07T17:24:21.623383Z", "iopub.status.idle": "2021-03-07T17:24:21.627810Z", "shell.execute_reply": "2021-03-07T17:24:21.626989Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hd = Hdcoeff*Hdsum" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 4: The Spin-Orbit Term $H_{\\rm SO}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hso}$$\n", "\n", "We will write [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.18) as:\n", "\n", "\\begin{align*}\n", " H_{\\rm SO} = H_{\\rm SO}\\ {\\rm Term\\ 1} + H_{\\rm SO}\\ {\\rm Term\\ 2\\ coefficient} * H_{\\rm SO}\\ {\\rm Term\\ 2}.\n", "\\end{align*}\n", "\n", "We define and consider $H_{\\rm SO}$ Term 1 in [this cell](#hsoterm1), $H_{\\rm SO}$ Term 2 coefficient in [this cell](#hsoterm2coeff), and $H_{\\rm SO}$ Term 2 in [this cell](#hsoterm2)." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.633428Z", "iopub.status.busy": "2021-03-07T17:24:21.632602Z", "iopub.status.idle": "2021-03-07T17:24:21.635487Z", "shell.execute_reply": "2021-03-07T17:24:21.635980Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hso = HsoTerm1 + HsoTerm2coeff*HsoTerm2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 4.a: $H_{\\rm SO}$ Term 1 \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm1}$$\n", "\n", "Combining our notation $H_{\\rm SO}$ (defined in [this cell](#hso)) with [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.18), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 1} = \\frac{ e^{2 \\nu - \\tilde{\\mu} } \\left( e^{\\tilde{\\mu} + \\nu} - \\tilde{B} \\right) \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( {\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr} \\right) }{ \\tilde{B}^{2} \\sqrt{Q} \\xi^{2} }.\n", "\\end{equation*}\n", "\n", "We will write\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 1} = \\frac{ e^{2 \\nu} \\left( e^{\\tilde{\\mu}} e^{\\nu} - \\tilde{B} \\right) \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( {\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr} \\right) }{ e^{ \\tilde{\\mu} } \\tilde{B}^{2} \\sqrt{Q} \\xi^{2} }.\n", "\\end{equation*}\n", "\n", "We define $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), $\\tilde{B}$ in [this cell](#btilde), $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir), ${\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr}$ in [this cell](#sdotskerrhat), $Q$ in [this cell](#q), and $\\boldsymbol{\\xi}^{2}$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.640642Z", "iopub.status.busy": "2021-03-07T17:24:21.639954Z", "iopub.status.idle": "2021-03-07T17:24:21.643634Z", "shell.execute_reply": "2021-03-07T17:24:21.644293Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm1 = exp2nu*(expmu*expnu - Btilde)*pdotxir*SdotSkerrhat/(expmu*Btilde*Btilde*sp.sqrt(Q)*xisq)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 4.b: $H_{\\rm SO}$ Term 2 Coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm2coeff}$$\n", "\n", "Combining our notation $H_{\\rm SO}$ (defined in [this cell](#hso)) with [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.18), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2\\ coefficient} = \\frac{ e^{\\nu - 2 \\tilde{\\mu}} }{ \\tilde{B}^{2} \\left( \\sqrt{Q} + 1 \\right) \\sqrt{Q} \\xi^{2} }\n", "\\end{equation*}\n", "\n", "which we write in the form\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2\\ coefficient} = \\frac{ e^{\\nu} }{ e^{2 \\tilde{\\mu}} \\tilde{B}^{2} \\left( Q + \\sqrt{Q} \\right) \\xi^{2} }.\n", "\\end{equation*}\n", "\n", "We define and consider $e^{\\nu}$ in [this cell](#exp2nu), $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $\\tilde{B}$ in [this cell](#btilde), $Q$ in [this cell](#q), and $\\xi^{2}$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.650314Z", "iopub.status.busy": "2021-03-07T17:24:21.649450Z", "iopub.status.idle": "2021-03-07T17:24:21.652629Z", "shell.execute_reply": "2021-03-07T17:24:21.653200Z" }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm2coeff = expnu/(exp2mu*Btilde*Btilde*(Q + sp.sqrt(Q))*xisq)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 4.c: $H_{\\rm SO}$ Term 2 \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm2}$$\n", "\n", "Combining our notation $H_{\\rm SO}$ (defined in [this cell](#hso)) with [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.18), we have\n", "\n", "\\begin{align*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2} &= \\underbrace{ \\left( {\\bf S} \\cdot \\boldsymbol{\\xi} \\right) \\tilde{J} \\left[ \\mu_r \\left( \\hat{\\bf p} \\cdot {\\bf v} r \\right) \\left( \\sqrt{Q} + 1 \\right) - \\mu_{\\cos \\theta} \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right) \\xi^{2} -\\sqrt{Q} \\left( \\nu_r \\left( \\hat{\\bf p} \\cdot {\\bf v} r \\right) + \\left( \\mu_{\\cos \\theta} - \\nu_{\\cos \\theta} \\right) \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right) \\xi^{2} \\right) \\right] \\tilde{B}^{2} }_{H_{\\rm SO}\\ {\\rm Term\\ 2a}} \\\\\n", " &\\ \\ \\ \\ \\ + \\underbrace{ e^{\\tilde{\\mu} + \\nu} \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( 2 \\sqrt{Q} + 1 \\right) \\left[ \\tilde{J} \\nu_r \\left( {\\bf S} \\cdot {\\bf v} \\right) - \\nu_{\\cos \\theta} \\left( {\\bf S} \\cdot {\\bf n} \\right) \\xi^{2} \\right] \\tilde{B} }_{H_{\\rm SO}\\ {\\rm Term\\ 2b}} - \\underbrace{ \\tilde{J} \\tilde{B}_{r} e^{\\tilde{\\mu} + \\nu} \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( \\sqrt{Q} + 1 \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right) }_{H_{\\rm SO}\\ {\\rm Term\\ 2c}}\n", "\\end{align*}\n", "\n", "We compute $H_{\\rm SO}$ Term 2a in [this cell](#hsoterm2a), $H_{\\rm SO}$ Term 2b in [this cell](#hsoterm2b), and $H_{\\rm SO}$ Term 2c in [this cell](#hsoterm2c)." ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.658279Z", "iopub.status.busy": "2021-03-07T17:24:21.657544Z", "iopub.status.idle": "2021-03-07T17:24:21.661144Z", "shell.execute_reply": "2021-03-07T17:24:21.660557Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm2 = HsoTerm2a + HsoTerm2b - HsoTerm2c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 4.c.i: $H_{\\rm SO}$ Term 2a \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm2a}$$\n", "\n", "We defined $H_{\\rm S0}$ Term 2a in [this cell](#hsoterm2) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2a} = \\left( {\\bf S} \\cdot \\boldsymbol{\\xi} \\right) \\tilde{J} \\left[ \\mu_r \\left( \\hat{\\bf p} \\cdot {\\bf v} r \\right) \\left( \\sqrt{Q} + 1 \\right) - \\mu_{\\cos \\theta} \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right) \\xi^{2} -\\sqrt{Q} \\left( \\nu_r \\left( \\hat{\\bf p} \\cdot {\\bf v} r \\right) + \\left( \\mu_{\\cos \\theta} - \\nu_{\\cos \\theta} \\right) \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right) \\xi^{2} \\right) \\right] \\tilde{B}^{2}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf S} \\cdot \\boldsymbol{\\xi}$ in [this cell](#sdotxi), $\\tilde{J}$ in [this cell](#jtilde), $\\mu_{r}$ in [this cell](#mur), $\\hat{\\bf p} \\cdot {\\bf v} r$ in [this cell](#pdotvr), $Q$ in [this cell](#q), $\\mu_{\\cos \\theta}$ in [this cell](#mucostheta), $\\hat{\\bf p} \\cdot {\\bf n}$ in [this cell](#pdotn), $\\xi^{2}$ in [this cell](#sin2theta), $\\nu_{r}$ in [this cell](#nur), $\\nu_{\\cos\\theta}$ in [this cell](#nucostheta), and $\\tilde{B}$ in [this cell](#btilde)." ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.666915Z", "iopub.status.busy": "2021-03-07T17:24:21.666114Z", "iopub.status.idle": "2021-03-07T17:24:21.669073Z", "shell.execute_reply": "2021-03-07T17:24:21.669647Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm2a = Sdotxi*Jtilde*(mur*pdotvr*(sp.sqrt(Q) + 1) - mucostheta*pdotn*xisq\n", " - sp.sqrt(Q)*(nur*pdotvr + (mucostheta - nucostheta)*pdotn*xisq))*Btilde*Btilde" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 4.c.ii: $H_{\\rm SO}$ Term 2b \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm2b}$$\n", "\n", "We defined $H_{\\rm S0}$ Term 2b in [this cell](#hsoterm2) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2b} = e^{\\tilde{\\mu} + \\nu} \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( 2 \\sqrt{Q} + 1 \\right) \\left[ \\tilde{J} \\nu_r \\left( {\\bf S} \\cdot {\\bf v} \\right) - \\nu_{\\cos \\theta} \\left( {\\bf S} \\cdot {\\bf n} \\right) \\xi^{2} \\right] \\tilde{B}.\n", "\\end{equation*}\n", "\n", "We define $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), $\\hat{\\bf p} \\cdot \\xi r$ in [this cell](#pdotxir), $Q$ in [this cell](#q), $\\tilde{J}$ in [this cell](#jtilde), $\\nu_{r}$ in [this cell](#nur), ${\\bf S} \\cdot {\\bf v}$ in [this cell](#sdotv), $\\nu_{\\cos\\theta}$ in [this cell](#nucostheta), ${\\bf S} \\cdot {\\bf n}$ in [this cell](#sdotn), $\\xi^{2}$ in [this cell](#sin2theta), and $\\tilde{B}$ in [this cell](#btilde)." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.675545Z", "iopub.status.busy": "2021-03-07T17:24:21.674574Z", "iopub.status.idle": "2021-03-07T17:24:21.678550Z", "shell.execute_reply": "2021-03-07T17:24:21.679238Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm2b = expmu*expnu*pdotxir*(2*sp.sqrt(Q) + 1)*(Jtilde*nur*Sdotv - nucostheta*Sdotn*xisq)*Btilde" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 4.c.iii: $H_{\\rm SO}$ Term 2c \\[Back to [top](#toc)\\]\n", "$$\\label{hsoterm2c}$$\n", "\n", "We defined $H_{\\rm S0}$ Term 2c in [this cell](#hsoterm2) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SO}\\ {\\rm Term\\ 2c} = \\tilde{J} \\tilde{B}_{r} e^{\\tilde{\\mu} + \\nu} \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right) \\left( \\sqrt{Q} + 1 \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right)\n", "\\end{equation*}\n", "\n", "We define $\\tilde{J}$ in [this cell](#jtilde), $\\tilde{B}_{r}$ in [this cell](#brtilde), $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), $\\hat{\\bf p} \\cdot \\xi r$ in [this cell](#pdotxir), $Q$ in [this cell](#q), and ${\\bf S} \\cdot {\\bf v}$ in [this cell](#sdotv)." ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.685561Z", "iopub.status.busy": "2021-03-07T17:24:21.684627Z", "iopub.status.idle": "2021-03-07T17:24:21.688319Z", "shell.execute_reply": "2021-03-07T17:24:21.688997Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HsoTerm2c = Jtilde*Brtilde*expmu*expnu*pdotxir*(sp.sqrt(Q) + 1)*Sdotv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 5: The Spin-Spin Term $H_{\\rm SS}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hss}$$\n", "\n", "We will write [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS} = H_{\\rm SS}\\ {\\rm Term\\ 1} + H_{\\rm SS}\\ {\\rm Term\\ 2\\ coefficient} * H_{\\rm SS}\\ {\\rm Term\\ 2} + H_{\\rm SS}\\ {\\rm Term\\ 3\\ coefficient} * H_{\\rm SS}\\ {\\rm Term\\ 3}.\n", "\\end{equation*}\n", "\n", "We define $H_{\\rm SS}$ Term 1 in [this cell](#hssterm1), $H_{\\rm SS}$ Term 2 coefficient in [this cell](#hssterm2coeff), $H_{\\rm SS}$ Term 2 in [this cell](#hssterm2), $H_{\\rm SS}$ Term 3 coefficient in [this cell](#hssterm3coeff), and $H_{\\rm SS}$ Term 3 in [this cell](#hssterm3)." ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.695307Z", "iopub.status.busy": "2021-03-07T17:24:21.694356Z", "iopub.status.idle": "2021-03-07T17:24:21.698875Z", "shell.execute_reply": "2021-03-07T17:24:21.698102Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hss = HssTerm1 + HssTerm2coeff*HssTerm2 + HssTerm3coeff*HssTerm3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 5.a: $H_{\\rm SS}$ Term 1 \\[Back to [top](#toc)\\]\n", "$$\\label{hssterm1}$$\n", "\n", "Combining [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) with our definition of $H_{\\rm SS}$ Term 1 in [this cell](#hss), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 1} = \\omega \\left( {\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr} \\right).\n", "\\end{equation*}\n", "\n", "We define $\\omega$ in [this cell](#omega) and ${\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr}$ in [this cell](#sdotskerrhat)." ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.704995Z", "iopub.status.busy": "2021-03-07T17:24:21.704046Z", "iopub.status.idle": "2021-03-07T17:24:21.709954Z", "shell.execute_reply": "2021-03-07T17:24:21.709230Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HssTerm1 = omega*SdotSkerrhat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 5.b: $H_{\\rm SS}$ Term 2 Coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{hssterm2coeff}$$\n", "\n", "Combining [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) with ore definition of $H_{\\rm SS}$ Term 2 coefficient in [this cell](#hss), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 2\\ coefficient} = \\frac{ e^{-3 \\tilde{\\mu} -\\nu} \\tilde{J} \\omega_{r} }{ 2 \\tilde{B} \\left( \\sqrt{Q} + 1 \\right) \\sqrt{Q} \\xi^{2} }\n", "\\end{equation*}\n", "\n", "which we write as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 2\\ coefficient} = \\frac{ \\tilde{J} \\omega_{r} }{ 2 e^{2 \\tilde{\\mu}} e^{\\tilde{\\mu}} e^{\\nu} \\tilde{B} \\left( Q + \\sqrt{Q} \\right) \\xi^{2} }.\n", "\\end{equation*}\n", "\n", "We define $\\tilde{J}$ in [this cell](#jtilde), $\\omega_{r}$ in [this cell](#omegar), $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), $\\tilde{B}$ in [this cell](#btilde), $Q$ in [this cell](#q), and $\\xi^{2}$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.716624Z", "iopub.status.busy": "2021-03-07T17:24:21.715630Z", "iopub.status.idle": "2021-03-07T17:24:21.719723Z", "shell.execute_reply": "2021-03-07T17:24:21.720406Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HssTerm2coeff = Jtilde*omegar/(2*exp2mu*expmu*expnu*Btilde*(Q + sp.sqrt(Q))*xisq)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 5.c: $H_{\\rm SS}$ Term 2 \\[Back to [top](#toc)\\]\n", "$$\\label{hssterm2}$$\n", "\n", "Combining [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) with our definition of $H_{\\rm SS}$ Term 2 in [this cell](#hss), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 2} = -e^{\\tilde{\\mu} + \\nu} \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right) \\left( {\\bf \\hat{p}} \\cdot {\\bf \\xi} r \\right) \\left( {\\bf S} \\cdot {\\bf \\xi} \\right)\n", "\\tilde{B} + e^{2 \\left( \\tilde{\\mu} + \\nu \\right)} \\left( {\\bf \\hat{p}} \\cdot {\\bf \\xi} r \\right)^2 \\left( {\\bf S}\n", "\\cdot {\\bf v} \\right) + e^{2 \\tilde{\\mu}} \\left( 1 + \\sqrt{Q} \\right) \\sqrt{Q} \\left( {\\bf S} \\cdot {\\bf v} \\right)\\xi^2 \\tilde{B}^{2} + \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left[ \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right)\n", "\\left( {\\bf S} \\cdot {\\bf n}\\right) - \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right)\\right] \\xi^{2} \\tilde{B}^{2}\n", "\\end{equation*}\n", "\n", "which we write as\n", "\n", "\\begin{align*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 2} &= e^{\\tilde{\\mu}} \\left( {\\bf \\hat{p}} \\cdot {\\bf \\xi} r \\right) \\left[ e^{\\tilde{\\mu}} e^{2 \\nu} \\left( {\\bf \\hat{p}} \\cdot {\\bf \\xi} r \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right) - e^{\\nu} \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right) \\left( {\\bf S} \\cdot {\\bf \\xi} \\right)\n", "\\tilde{B} \\right] \\\\\n", "&\\ \\ \\ \\ \\ + \\xi^2 \\tilde{B}^{2} \\left\\{ e^{2 \\tilde{\\mu}} \\left( \\sqrt{Q} + Q \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right) + \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left[ \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right)\n", "\\left( {\\bf S} \\cdot {\\bf n}\\right) - \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right)\\right] \\right\\}\n", "\\end{align*}\n", "\n", "We define $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir), $e^{\\nu}$ in [this cell](#exp2nu), ${\\bf S} \\cdot {\\bf v}$ in [this cell](#sdotv), $\\hat{\\bf p} \\cdot {\\bf v} r$ in [this cell](#pdotvr), ${\\bf S} \\cdot \\boldsymbol{\\xi}$ in [this cell](#sdotxi), $\\tilde{B}$ in [this cell](#btilde), $Q$ in [this cell](#q), $\\tilde{J}$ in [this cell](#jtilde), $\\hat{\\bf p} \\cdot {\\bf n}$ in [this cell](#pdotn), ${\\bf S} \\cdot {\\bf n}$ in [this cell](#sdotn), and $\\xi^{2}$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.726740Z", "iopub.status.busy": "2021-03-07T17:24:21.725800Z", "iopub.status.idle": "2021-03-07T17:24:21.729453Z", "shell.execute_reply": "2021-03-07T17:24:21.730004Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HssTerm2 = expmu*pdotxir*(expmu*exp2nu*pdotxir*Sdotv - expnu*pdotvr*Sdotxi*Btilde)\n", " + xisq*Btilde*Btilde*(exp2mu*(sp.sqrt(Q) + Q)*Sdotv\n", " + Jtilde*pdotn*(pdotvr*Sdotn - Jtilde*pdotn*Sdotv))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 5.d: $H_{\\rm SS}$ Term 3 Coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{hssterm3coeff}$$\n", "\n", "Combining [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) with our definition of $H_{\\rm SS}$ Term 3 coefficient in [this cell](#hss), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 3\\ coefficient} = \\frac{ e^{-3 \\tilde{\\mu} - \\nu} \\omega_{\\cos\\theta} }{ 2 \\tilde{B} \\left( \\sqrt{Q} + 1 \\right) \\sqrt{Q} }\n", "\\end{equation*}\n", "\n", "which we write as\n", "\n", "\\begin{equation*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 3\\ coefficient} = \\frac{ \\omega_{\\cos\\theta} }{ 2 e^{2 \\tilde{\\mu}} e^{\\tilde{\\mu}} e^{\\nu} \\tilde{B} \\left( Q + \\sqrt{Q} \\right) }.\n", "\\end{equation*}\n", "\n", "We define $\\omega_{\\cos\\theta}$ in [this cell](#omegacostheta), $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), and $\\tilde{B}$ in [this cell](#btilde), $Q$ in [this cell](#q)." ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.735472Z", "iopub.status.busy": "2021-03-07T17:24:21.734724Z", "iopub.status.idle": "2021-03-07T17:24:21.738090Z", "shell.execute_reply": "2021-03-07T17:24:21.737572Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HssTerm3coeff = omegacostheta/(2*exp2mu*expmu*expnu*Btilde*(Q + sp.sqrt(Q)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 5.e: $H_{\\rm SS}$ Term 3 \\[Back to [top](#toc)\\]\n", "$$\\label{hssterm3}$$\n", "\n", "Combining [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.19) with our definition of $H_{\\rm SS}$ Term 3 in [this cell](#hss), we have\n", "\n", "\\begin{align*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 3} &= -e^{2 \\left( \\tilde{\\mu} + \\nu \\right)} \\left( \\hat{\\bf p} \\cdot {\\bf \\xi} r \\right)^{2} \\left( {\\bf S} \\cdot {\\bf n} \\right) + e^{\\tilde{\\mu} +\\nu} \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf \\hat{p}} \\cdot {\\bf \\xi} r \\right) \\left( {\\bf S} \\cdot {\\bf \\xi} \\right) \\tilde{B} \\\\\n", " &\\ \\ \\ \\ \\ + \\left[ \\left( {\\bf S} \\cdot {\\bf n} \\right) \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right)^{2} - \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right) \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r\\right) - e^{2 \\tilde{\\mu}} \\left( 1 + \\sqrt{Q} \\right) \\sqrt{Q} \\left( {\\bf S} \\cdot {\\bf n} \\right) \\xi^{2} \\right] \\tilde{B}^{2}\n", "\\end{align*}\n", "\n", "which we write as\n", "\n", "\\begin{align*}\n", " H_{\\rm SS}\\ {\\rm Term\\ 3} &= e^{\\tilde{\\mu}} e^{\\nu} \\left( \\hat{\\bf p} \\cdot {\\bf \\xi} r \\right) \\left[ \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf S} \\cdot {\\bf \\xi} \\right) \\tilde{B} - e^{\\tilde{\\mu}} e^{\\nu} \\left( \\hat{\\bf p} \\cdot {\\bf \\xi} r \\right) \\left( {\\bf S} \\cdot {\\bf n} \\right) \\right] \\\\\n", " &\\ \\ \\ \\ \\ + \\left\\{ \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right) \\left[ \\left( {\\bf S} \\cdot {\\bf n} \\right) \\left( {\\bf \\hat{p}} \\cdot {\\bf v} r \\right) - \\tilde{J} \\left( {\\bf \\hat{p}} \\cdot {\\bf n} \\right) \\left( {\\bf S} \\cdot {\\bf v} \\right) \\right] - e^{2 \\tilde{\\mu}} \\left( \\sqrt{Q} + Q \\right) \\left( {\\bf S} \\cdot {\\bf n} \\right) \\xi^{2} \\right\\} \\tilde{B}^{2}\n", "\\end{align*}\n", "\n", "We define $e^{\\tilde{\\mu}}$ in [this cell](#exp2mu), $e^{\\nu}$ in [this cell](#exp2nu), $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir), $\\tilde{J}$ in [this cell](#jtilde), $\\hat{\\bf p} \\cdot {\\bf n}$ in [this cell](#pdotn), ${\\bf S} \\cdot \\boldsymbol{\\xi}$ in [this cell](#sdotxi), $\\tilde{B}$ in [this cell](#btilde), ${\\bf S} \\cdot {\\bf n}$ in [this cell](#sdotn), $\\hat{\\bf p} \\cdot {\\bf v} r$ in [this cell](#pdotvr), ${\\bf S} \\cdot {\\bf v}$ in [this cell](#sdotv), $Q$ in [this cell](#q), and $\\xi^{2}$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.743318Z", "iopub.status.busy": "2021-03-07T17:24:21.742541Z", "iopub.status.idle": "2021-03-07T17:24:21.745327Z", "shell.execute_reply": "2021-03-07T17:24:21.745874Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HssTerm3 = expmu*expnu*pdotxir*(Jtilde*pdotn*Sdotxi*Btilde - expmu*expnu*pdotxir*Sdotn)\n", " + (pdotvr*(Sdotn*pdotvr - Jtilde*pdotn*Sdotv) - exp2mu*(sp.sqrt(Q) + Q)*Sdotn*xisq)*Btilde*Btilde" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 6: $H_{\\rm NS}$ Terms \\[Back to [top](#toc)\\]\n", "$$\\label{hnsterms}$$\n", "\n", "We collect here the terms in $H_{\\rm NS}$ (defined in [this cell](#hns))." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 6.a: $\\beta p$ sum \\[Back to [top](#toc)\\]\n", "$$\\label{betapsum}$$\n", "\n", "We defined the term $\\beta p$ sum in [this cell](#hns) as\n", "\n", "\\begin{equation*}\n", " \\beta p\\ {\\rm sum} = \\beta^{i} p_{i}.\n", "\\end{equation*}\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.45), we have\n", "\n", "\\begin{equation*}\n", " \\beta^{i} = \\frac{ g^{ti} }{ g^{tt} },\n", "\\end{equation*}\n", "\n", "but from [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.36) we see that $g^{tr} = g^{t \\theta} = 0$. Thus only $\\beta^{\\phi}$ is nonzero. Combining [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.45), (5.36e), and (5.36a), we find\n", "\n", "\\begin{equation*}\n", " \\beta^{\\phi} = \\frac{ -\\frac{ \\tilde{\\omega}_{\\rm fd} }{ \\Delta_{t} \\Sigma } }{ -\\frac{ \\Lambda_{t} }{ \\Delta_{t} \\Sigma } } = \\frac{ \\tilde{\\omega}_{\\rm fd} }{ \\Lambda_{t} }\n", "\\end{equation*}\n", "\n", "Therefore\n", "\n", "\\begin{equation*}\n", " \\beta^{i} p_{i} = \\frac{ \\tilde{\\omega}_{\\rm fd} }{ \\Lambda_{t} } p_{\\phi}.\n", "\\end{equation*}\n", "\n", "We define $\\tilde{\\omega}_{\\rm fd}$ in [this cell](#omegatilde), $\\Lambda_{t}$ in [this cell](#lambdat), and $p_{\\phi}$ in [this cell](#pphi)." ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.750953Z", "iopub.status.busy": "2021-03-07T17:24:21.750056Z", "iopub.status.idle": "2021-03-07T17:24:21.753523Z", "shell.execute_reply": "2021-03-07T17:24:21.754158Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "betapsum = omegatilde*pphi/Lambdat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 6.b: $\\alpha$ \\[Back to [top](#toc)\\]\n", "$$\\label{alpha}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.44), we have\n", "\\begin{equation*}\n", " \\alpha = \\frac{ 1 }{ \\sqrt{ -g^{tt}} },\n", "\\end{equation*}\n", "\n", "and from [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.36a) we have\n", "\n", "\\begin{equation*}\n", " g^{tt} = -\\frac{ \\Lambda_{t} }{ \\Delta_{t} \\Sigma }.\n", "\\end{equation*}\n", "\n", "Therefore\n", "\n", "\\begin{equation*}\n", " \\alpha = \\sqrt{ \\frac{ \\Delta_{t} \\Sigma }{ \\Lambda_{t} } }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{t}$ in [this cell](#deltat), $\\Sigma$ in [this cell](#usigma), and $\\Lambda_{t}$ in [this cell](#lambdat)." ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.760840Z", "iopub.status.busy": "2021-03-07T17:24:21.759803Z", "iopub.status.idle": "2021-03-07T17:24:21.763327Z", "shell.execute_reply": "2021-03-07T17:24:21.763962Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "alpha = sp.sqrt(Deltat*Sigma/Lambdat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 6.c: $H_{\\rm NS}$ radicand \\[Back to [top](#toc)\\]\n", "$$\\label{hnsradicand}$$\n", "\n", "Recall that we defined $H_{\\rm NS}$ radicand in [this cell](#hns) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm NS}\\ {\\rm radicand} = \\mu^{2} + \\underbrace{\\gamma^{ij} p_{i} p_{j}}_{\\gamma p\\ \\rm sum} + {\\cal Q}_{4}\n", "\\end{equation*}\n", "\n", "We define $\\mu$ in [this cell](#mu), $\\gamma p$ sum in [this cell](#gammappsum), and ${\\cal Q}_{4}$ in [this cell](#q4)." ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.770211Z", "iopub.status.busy": "2021-03-07T17:24:21.769161Z", "iopub.status.idle": "2021-03-07T17:24:21.773973Z", "shell.execute_reply": "2021-03-07T17:24:21.773253Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hnsradicand = 1 + gammappsum + Q4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 6.c.i: $\\gamma^{ij} p_{i} p_{j}$ \\[Back to [top](#toc)\\]\n", "$$\\label{gammappsum}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.46), we have\n", "\n", "\\begin{equation*}\n", " \\gamma^{ij} = g^{ij} - \\frac{ g^{ti} g^{tj} }{ g^{tt} }.\n", "\\end{equation*}\n", "\n", "Combining this result with [BB2010](https://arxiv.org/abs/0912.3517) Equations 5.36, we have\n", "\n", "\\begin{equation*}\n", " \\gamma^{r\\theta} = \\gamma^{r\\phi} = \\gamma^{\\theta r} = \\gamma^{\\theta\\phi} = \\gamma^{\\phi r} = \\gamma^{\\phi\\theta} = 0\n", "\\end{equation*}\n", "\n", "and\n", "\n", "\\begin{align*}\n", " \\gamma^{rr} &= g^{rr} = \\frac{ \\Delta_{r} }{ \\Sigma } \\\\\n", " \\gamma^{\\theta\\theta} &= g^{\\theta\\theta} = \\frac{ 1 }{ \\Sigma } \\\\\n", " \\gamma^{\\phi\\phi} &= \\frac{ \\Sigma }{ \\Lambda_{t} \\sin^{2} \\theta }.\n", "\\end{align*}\n", "\n", "Therefore\n", "\n", "\\begin{align*}\n", " \\gamma^{ij} p_{i} p_{j} &= \\gamma^{rr} p_{r} p_{r} + \\gamma^{\\theta\\theta} p_{\\theta} p_{\\theta} + \\gamma^{\\phi\\phi} p_{\\phi} p_{\\phi} \\\\\n", " &= \\frac{ \\Delta_{r} }{ \\Sigma } p_{r}^{2} + \\frac{ 1 }{ \\Sigma } p_{\\theta}^{2} + \\frac{ \\Sigma }{ \\Lambda_{t} \\sin^{2} \\theta } p_{\\phi}^{2}.\n", "\\end{align*}\n", "\n", "Converting Boyer-Lindquist coordinates to tortoise coordinates (the transformation for which is found in the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2)), we have\n", "\n", "\\begin{align*}\n", " p_{r} &= \\hat{\\bf p} \\cdot {\\bf n} \\\\\n", " p_{\\theta} &= \\hat{\\bf p} \\cdot {\\bf v} \\frac{ r }{ \\sin \\theta } \\\\\n", " p_{\\phi} &= \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r.\n", "\\end{align*}\n", "\n", "Therefore\n", "\n", "\\begin{equation*}\n", " \\gamma^{ij} p_{i} p_{j} = \\frac{ \\Delta_{r} }{ \\Sigma } \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right)^{2} + \\Sigma^{-1} \\left( \\hat{\\bf p} \\cdot {\\bf v} \\frac{ r }{ \\sin \\theta } \\right)^{2} + \\frac{ \\Sigma }{ \\Lambda_{t} \\sin^{2} \\theta } \\left( \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r \\right)^{2}.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{r}$ in [this cell](#deltar), $\\Sigma$ in [this cell](#sigma), $\\hat{\\bf p} \\cdot {\\bf n}$ in [this cell](#pdotn), $\\hat{\\bf p} \\cdot {\\bf v} r$ in [this cell](#pdotvr), $\\sin^{2} \\theta$ in [this cell](#sin2theta), $\\Lambda_{t}$ in [this cell](#lambdat), and $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir)." ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.780545Z", "iopub.status.busy": "2021-03-07T17:24:21.779496Z", "iopub.status.idle": "2021-03-07T17:24:21.783402Z", "shell.execute_reply": "2021-03-07T17:24:21.783958Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "gammappsum = Deltar/Sigma*pdotn*pdotn + 1/Sigma*pdotvr*pdotvr/sin2theta + Sigma/Lambdat/sin2theta*pdotxir*pdotxir" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 6.c.ii: ${\\cal Q}_{4}$ \\[Back to [top](#toc)\\]\n", "$$\\label{q4}$$\n", "\n", "From [T2012](https://arxiv.org/abs/1202.0790) Equation (15),\n", "\n", "\\begin{equation*}\n", " {\\cal Q}_{4} \\propto \\frac{ p_{r^{*}}^{4} }{ r^{2} } \\left( r^{2} + \\chi_{\\rm Kerr}^{2} \\right)^{4}.\n", "\\end{equation*}\n", "\n", "We denote $p_{r^{*}}$ by prT. Converting from tortoise coordinates to physical coordinates(the transformation for which is found in the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2)), we find\n", "\n", "\\begin{equation*}\n", " {\\cal Q}_{4} = \\frac{ prT^{4} }{ r^{2} } z_{3}\n", "\\end{equation*}\n", "\n", "where $z_{3}$ is found in [D2000](https://arxiv.org/abs/gr-qc/0005034) Equation (4.34):\n", "\n", "\\begin{equation*}\n", " z_{3} = 2 \\left( 4 - 3 \\nu \\right) \\nu.\n", "\\end{equation*}\n", "\n", "In the notation of [BB2010](https://arxiv.org/abs/0912.3517), $\\nu = \\eta$ (see discussion after [T2012](https://arxiv.org/abs/1202.0790) Equation (2)). Thus\n", "\n", "\\begin{equation*}\n", " {\\cal Q}_{4} = 2 prT^{4} u^{2} \\left( 4 - 3 \\eta \\right) \\eta.\n", "\\end{equation*}\n", "\n", "We define prT in [this cell](#prt), $u$ in [this cell](#u), and $\\eta$ in [this cell](#eta) below." ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.788784Z", "iopub.status.busy": "2021-03-07T17:24:21.788016Z", "iopub.status.idle": "2021-03-07T17:24:21.791902Z", "shell.execute_reply": "2021-03-07T17:24:21.791239Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Q4 = 2*prT*prT*prT*prT*u*u*(4 - 3*eta)*eta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 7: The $H_{\\rm D}$ Terms \\[Back to [top](#toc)\\]\n", "$$\\label{hdterms}$$\n", "\n", "Recall we defined $H_{\\rm D}$ in [this cell](#hd) as\n", "\n", "\\begin{equation*}\n", " H_{\\rm D} = H_{\\rm D}\\ {\\rm coeffecient} * H_{\\rm D}\\ {\\rm sum}.\n", "\\end{equation*}\n", "\n", "In this step we break down each of $H_{\\rm D}$ coefficient (defined in [this cell](#hdcoeff)) and $H_{\\rm D}$ sum (defined in [this cell](#hdsum))." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 7.a: $H_{\\rm D}$ Coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{hdcoeff}$$\n", "\n", "From our definition of $H_{\\rm D}$ in [this cell](#hd), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm D}\\ {\\rm coefficient} = \\frac{ \\mu }{ 2 M r^{3} },\n", "\\end{equation*}\n", "\n", "and recalling the definition of [$\\eta$](#eta) we'll write\n", "\n", "\\begin{equation*}\n", " H_{\\rm D}\\ {\\rm coefficient} = \\frac{ \\eta }{ 2 r^{3} }.\n", "\\end{equation*}\n", "\n", "We define $\\eta$ in [this cell](#eta) and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.798361Z", "iopub.status.busy": "2021-03-07T17:24:21.797229Z", "iopub.status.idle": "2021-03-07T17:24:21.801152Z", "shell.execute_reply": "2021-03-07T17:24:21.801772Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hdcoeff = sp.Rational(1,2)/(r*r*r)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 7.b: $H_{\\rm D}$ Sum \\[Back to [top](#toc)\\]\n", "$$\\label{hdsum}$$\n", "\n", "From our definition of $H_{\\rm D}$ in [this cell](#hd), we have\n", "\n", "\\begin{align*}\n", " H_{\\rm D}\\ {\\rm sum} &= \\left( \\delta^{ij} - 3 n^{i} n^{j} \\right) S^{*}_{i} S^{*}_{j} \\\\\n", " &= \\underbrace{\\delta^{ij} S^{*}_{i} S^{*}_{j}}_{\\rm Term\\ 1} - \\underbrace{3 n^{i} n^{j} S^{*}_{i} S^{*}_{j}}_{\\rm Term\\ 2}.\n", "\\end{align*}\n", "\n", "We compute $H_{\\rm D}$ Term 1 in [this cell](#hdsumterm1) and $H_{\\rm D}$ Term 2 in [this cell](#hdsumterm2)." ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.808042Z", "iopub.status.busy": "2021-03-07T17:24:21.806884Z", "iopub.status.idle": "2021-03-07T17:24:21.811453Z", "shell.execute_reply": "2021-03-07T17:24:21.810807Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Hdsum = HdsumTerm1 - HdsumTerm2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 7.b.i: $H_{\\rm D}$ Sum Term 1 \\[Back to [top](#toc)\\]\n", "$$\\label{hdsumterm1}$$\n", "\n", "From our definition of $H_{\\rm D}$ sum Term 1 in [this cell](#hdsum), we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm D}\\ {\\rm sum\\ Term\\ 1} = \\delta^{ij} S^{*}_{i} S^{*}_{j}\n", "\\end{equation*}\n", "\n", "where $\\delta^{ij}$ is the Kronecker delta:\n", "\n", "\\begin{equation*}\n", " \\delta_{ij} = \\left\\{ \\begin{array}{cc}\n", " 0, & i \\not= j \\\\\n", " 1, & i = j. \\end{array} \\right.\n", "\\end{equation*}\n", "\n", "Thus we have\n", "\n", "\\begin{equation*}\n", " H_{\\rm D}\\ {\\rm sum\\ Term\\ 1} = S^{*}_{1} S^{*}_{1} + S^{*}_{2} S^{*}_{2} + S^{*}_{3} S^{*}_{3}\n", "\\end{equation*}\n", "\n", "We define ${\\bf S}^{*}$ in [this cell](#hreal_spin_combos)." ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.818091Z", "iopub.status.busy": "2021-03-07T17:24:21.816951Z", "iopub.status.idle": "2021-03-07T17:24:21.820608Z", "shell.execute_reply": "2021-03-07T17:24:21.821315Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HdsumTerm1 = Sstar1*Sstar1 + Sstar2*Sstar2 + Sstar3*Sstar3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 7.b.ii: $H_{\\rm D}$ Sum Term 2 \\[Back to [top](#toc)\\]\n", "$$\\label{hdsumterm2}$$\n", "\n", "From our definition of $H_{\\rm D}$ sum Term 2 in [this cell](#hdsum), we have\n", "\n", "\\begin{align*}\n", " H_{\\rm D}\\ {\\rm sum\\ Term\\ 2} &= 3 n^{i} n^{j} S^{*}_{i} S^{*}_{j} \\\\\n", " &= 3 \\left( {\\bf S}^{*} \\cdot {\\bf n} \\right)^{2} \\\\\n", "\\end{align*}\n", "\n", "\n", "We define ${\\bf S}^{*} \\cdot {\\bf n}$ in [this cell](#sstardotn)." ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.827552Z", "iopub.status.busy": "2021-03-07T17:24:21.826548Z", "iopub.status.idle": "2021-03-07T17:24:21.831299Z", "shell.execute_reply": "2021-03-07T17:24:21.830612Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "HdsumTerm2 = 3*Sstardotn*Sstardotn" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 8: Common Dot Products \\[Back to [top](#toc)\\]\n", "$$\\label{dotproducts}$$\n", "\n", "What follows are definitions of many common dot products." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 8.a: ${\\bf S} \\cdot \\boldsymbol{\\xi}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sdotxi}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " {\\bf S} \\cdot \\boldsymbol{\\xi} = S^{1} \\xi^{1} + S^{2} \\xi^{2} + S^{3} \\xi^{3}\n", "\\end{equation*}\n", "\n", "We define $\\xi$ in [this cell](#xi)." ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.838002Z", "iopub.status.busy": "2021-03-07T17:24:21.836950Z", "iopub.status.idle": "2021-03-07T17:24:21.840641Z", "shell.execute_reply": "2021-03-07T17:24:21.841209Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Sdotxi = S1*xi1 + S2*xi2 + S3*xi3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 8.b: ${\\bf S} \\cdot {\\bf v}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sdotv}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " {\\bf S} \\cdot {\\bf v} = S^{1} v^{1} + S^{2} v^{2} + S^{3} v^{3}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf v}$ in [this cell](#v)." ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.846409Z", "iopub.status.busy": "2021-03-07T17:24:21.845602Z", "iopub.status.idle": "2021-03-07T17:24:21.848603Z", "shell.execute_reply": "2021-03-07T17:24:21.849119Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Sdotv = S1*v1 + S2*v2 + S3*v3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 8.c: ${\\bf S} \\cdot {\\bf n}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sdotn}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " {\\bf S} \\cdot {\\bf n} = S^{1} n^{1} + S^{2} n^{2} + S^{3} n^{3}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 31, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.854478Z", "iopub.status.busy": "2021-03-07T17:24:21.853559Z", "iopub.status.idle": "2021-03-07T17:24:21.857843Z", "shell.execute_reply": "2021-03-07T17:24:21.857182Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Sdotn = S1*n1 + S2*n2 + S3*n3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 8.d: ${\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sdotskerrhat}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " {\\bf S} \\cdot \\hat{\\bf S}_{\\rm Kerr} = S^{1} \\hat{S}_{\\rm Kerr}^{1} + S^{2} \\hat{S}_{\\rm Kerr}^{2} + S^{3} \\hat{S}_{\\rm Kerr}^{3}.\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf S}_{\\rm Kerr}$ in [this cell](#skerrhat)." ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.864303Z", "iopub.status.busy": "2021-03-07T17:24:21.863318Z", "iopub.status.idle": "2021-03-07T17:24:21.867377Z", "shell.execute_reply": "2021-03-07T17:24:21.866744Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "SdotSkerrhat = S1*Skerrhat1 + S2*Skerrhat2 + S3*Skerrhat3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 8.e: ${\\bf S}^{*} \\cdot {\\bf n}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sstardotn}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " {\\bf S}^{*} \\cdot {\\bf n} = {\\bf S}^{*}_{1} n_{1} + {\\bf S}^{*}_{2} n_{2} + {\\bf S}^{*}_{3} n_{3}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf S}^{*}$ in [this cell](#sstar) and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.873203Z", "iopub.status.busy": "2021-03-07T17:24:21.872336Z", "iopub.status.idle": "2021-03-07T17:24:21.875422Z", "shell.execute_reply": "2021-03-07T17:24:21.875927Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Sstardotn = Sstar1*n1 + Sstar2*n2 + Sstar3*n3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 9: $H_{\\rm real}$ Spin Combination ${\\bf S}^{*}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hreal_spin_combos}$$\n", "\n", "We collect here terms defining and containing ${\\bf S}^{*}$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 9.a: ${\\bf S}^{*}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sstar}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.63):\n", "\n", "\\begin{equation*}\n", " {\\bf S}^{*} = \\boldsymbol{\\sigma}^{*} + \\frac{ 1 }{ c^{2} } \\boldsymbol{\\Delta}_{\\sigma^{*}}.\n", "\\end{equation*}\n", "\n", "We define $\\boldsymbol{\\sigma}^{*}$ in [this cell](#sigmastar) and $\\boldsymbol{\\Delta}_{\\sigma^{*}}$ in [this cell](#deltasigmastar).\n", "\n", "Please note: after normalization, ${\\bf S} = {\\bf S}^{*}$. See [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.26)." ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.881044Z", "iopub.status.busy": "2021-03-07T17:24:21.880247Z", "iopub.status.idle": "2021-03-07T17:24:21.883298Z", "shell.execute_reply": "2021-03-07T17:24:21.883792Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "S1 = Sstar1\n", "S2 = Sstar2\n", "S3 = Sstar3\n", "Sstar1 = sigmastar1 + Deltasigmastar1\n", "Sstar2 = sigmastar2 + Deltasigmastar2\n", "Sstar3 = sigmastar3 + Deltasigmastar3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 9.b: $\\boldsymbol{\\Delta}_{\\sigma^{*}}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltasigmastar}$$\n", "\n", "We can write $\\boldsymbol{\\Delta}_{\\sigma^{*}}$ as\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\Delta}_{\\sigma^{*}} = \\boldsymbol{\\sigma}^{*} \\left( \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient} \\right) + \\boldsymbol{\\sigma} \\left( \\boldsymbol{\\sigma}\\ {\\rm coefficient} \\right)\n", "\\end{equation*}\n", "\n", "For further dissection, see $\\boldsymbol{\\sigma}^{*}$ in [this cell](#sigmastar), $\\boldsymbol{\\sigma}^{*}$ coefficient in [this cell](#sigmastarcoeff), $\\boldsymbol{\\sigma}$ in [this cell](#sigma), and $\\boldsymbol{\\sigma}$ coefficient in [this cell](#sigmacoeff)." ] }, { "cell_type": "code", "execution_count": 35, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.889575Z", "iopub.status.busy": "2021-03-07T17:24:21.888643Z", "iopub.status.idle": "2021-03-07T17:24:21.892432Z", "shell.execute_reply": "2021-03-07T17:24:21.893142Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltasigmastar1 = sigmastar1*sigmastarcoeff + sigma1*sigmacoeff\n", "Deltasigmastar2 = sigmastar2*sigmastarcoeff + sigma2*sigmacoeff\n", "Deltasigmastar3 = sigmastar3*sigmastarcoeff + sigma3*sigmacoeff" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 9.c: $\\boldsymbol{\\sigma}^{*}$ coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{sigmastarcoeff}$$\n", "\n", "We will break down $\\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient}$ into two terms:\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient} = \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient\\ Term\\ 1} + \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient\\ Term\\ 2}\n", "\\end{equation*}\n", "\n", "We compute $\\boldsymbol{\\sigma}^{*}$ coefficient Term 1 in [this cell](#sigmastarcoeffterm1) and $\\boldsymbol{\\sigma}^{*}$ coefficient Term 2 in [this cell](#sigmastarcoeffterm2)." ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.900046Z", "iopub.status.busy": "2021-03-07T17:24:21.898858Z", "iopub.status.idle": "2021-03-07T17:24:21.903728Z", "shell.execute_reply": "2021-03-07T17:24:21.902934Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmastarcoeff = sigmastarcoeffTerm1 + sigmastarcoeffTerm2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 9.c.i: $\\boldsymbol{\\sigma}^{*}$ Coefficient Term 1 \\[Back to [top](#toc)\\]\n", "$$\\label{sigmastarcoeffterm1}$$\n", "\n", "We build this term from [BB2011](https://arxiv.org/abs/1107.2904) Equation (51) with $b_{0} = 0$ (see discussion preceeding [T2012](https://arxiv.org/abs/1202.0790) Equation (4)), where what is listed below is the coefficient on $\\boldsymbol{\\sigma}^{*}$:\n", "\n", "\\begin{align*}\n", " \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient\\ Term\\ 1} &= \\frac{7}{6} \\eta \\frac{M}{r} + \\frac{1}{3} \\eta \\left( Q - 1 \\right) - \\frac{5}{2} \\eta \\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\\\\n", " &= \\frac{ \\eta }{ 12 } \\left( 14 \\frac{ M }{ r } + 4 \\left( Q - 1 \\right) - 30 \\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right)\n", "\\end{align*}\n", "\n", "We group together and compute $Q-1$ in [this cell](#q) and $\\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2}$ in [this cell](#drsipn2); we define $r$ in [this cell](#r), $\\eta$ in [this cell](#eta), and $M$ in [this cell](#m) below." ] }, { "cell_type": "code", "execution_count": 37, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.911197Z", "iopub.status.busy": "2021-03-07T17:24:21.910052Z", "iopub.status.idle": "2021-03-07T17:24:21.914444Z", "shell.execute_reply": "2021-03-07T17:24:21.913762Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmastarcoeffTerm1 = eta/12*(14/r + 4*Qminus1 - 30*DrSipn2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 9.c.ii: $\\boldsymbol{\\sigma}^{*}$ Coefficient Term 2 \\[Back to [top](#toc)\\]\n", "$$\\label{sigmastarcoeffterm2}$$\n", "\n", "We build this term from [BB2011](https://arxiv.org/abs/1107.2904) Equation (52) with all $b_{i} = 0$, $i \\in \\left\\{0, 1, 2, 3\\right\\}$ (see discussion preceeding [T2012](https://arxiv.org/abs/1202.0790) Equation (4)), and just the coefficient on $\\boldsymbol{\\sigma}^{*}$. In the LALSuite code this is the variable 'sMultiplier1':\n", "\n", "\\begin{align*}\n", " \\boldsymbol{\\sigma}^{*}\\ {\\rm coefficient\\ Term\\ 2} &= \\frac{1}{36} \\left( 353 \\eta - 27 \\eta^2 \\right) \\left( \\frac{M}{r} \\right)^{2} + \\frac{5}{3} \\left( 3 \\eta^2 \\right) \\frac{ \\Delta_{r}^{2} }{ \\Sigma^{2} } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{4} \\\\\n", " &\\ \\ \\ \\ \\ + \\frac{1}{72} \\left( -23 \\eta -3 \\eta^{2} \\right) \\left( Q - 1 \\right)^{2} + \\frac{1}{36} \\left( -103 \\eta + 60 \\eta^{2} \\right) \\frac{M}{r} \\left( Q - 1 \\right) \\\\\n", " &\\ \\ \\ \\ \\ + \\frac{1}{12} \\left( 16 \\eta - 21 \\eta^{2} \\right) \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\left( Q - 1 \\right) + \\frac{1}{12} \\left( 47 \\eta - 54 \\eta^{2} \\right) \\frac{M}{r} \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\\\\n", " &= \\frac{ \\eta }{ 72 r^{2} } \\left[ \\left( 706 - 54 \\eta \\right) M^{2} + 360 \\eta r^{2} \\frac{ \\Delta_{r}^{2} }{ \\Sigma^{2} } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{4} + r^{2} \\left( -23 - 3 \\eta \\right) \\left( Q - 1 \\right)^{2} + \\left( -206 + 120 \\eta \\right) M r \\left( Q - 1 \\right) \\right. \\\\\n", " &\\ \\ \\ \\ \\ + \\left. \\left( 96 - 126 \\eta \\right) r^{2} \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\left( Q - 1 \\right) + \\left( 282 - 324 \\eta \\right) M r \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right] \\\\\n", " &= \\frac{ \\eta }{ 72 r^{2} } \\left[ 706 + r \\left( -206 M \\left( Q - 1 \\right) + 282 M \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} + r \\left( Q -1 \\right) \\left( 96 \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} - 23 \\left( Q - 1 \\right) \\right) \\right) \\right. \\\\\n", " &\\ \\ \\ \\ \\ + \\left. \\eta \\left( -54 M^{2} + r \\left( 120 M \\left( Q -1 \\right) - 324 M \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right.\\right.\\right. \\\\\n", " &\\ \\ \\ \\ \\ + \\left.\\left.\\left. r \\left( 360 \\frac{ \\Delta_{r}^{2} }{ \\Sigma^{2} } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{4} + \\left( Q - 1 \\right) \\left( -126 \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} - 3 \\left( Q - 1 \\right) \\right) \\right)\\right) \\right) \\right]\n", "\\end{align*}\n", "\n", "We define $r$ in [this cell](#r), $\\eta$ in [this cell](#eta), and $M$ in [this cell](#m); we group together and define $Q - 1$ in [this cell](#q), and $\\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2}$ in [this cell](#drsipn2)." ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.920434Z", "iopub.status.busy": "2021-03-07T17:24:21.919448Z", "iopub.status.idle": "2021-03-07T17:24:21.923754Z", "shell.execute_reply": "2021-03-07T17:24:21.924514Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmastarcoeffTerm2 = eta/(72*r*r)*(706 + r*(-206*Qminus1 + 282*DrSipn2 + r*Qminus1*(96*DrSipn2 - 23*Qminus1))\n", " + eta*(-54 + r*(120*Qminus1 - 324*DrSipn2\n", " + r*(360*DrSipn2*DrSipn2 + Qminus1*(-126*DrSipn2 - 3*Qminus1)))))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 9.d: $\\boldsymbol{\\sigma}$ coefficient \\[Back to [top](#toc)\\]\n", "$$\\label{sigmacoeff}$$\n", "\n", "We will break down $\\boldsymbol{\\sigma}\\ {\\rm coefficient}$ into three terms:\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\sigma}\\ {\\rm coefficient} = \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 1} + \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 2} + \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 3}\n", "\\end{equation*}\n", "\n", "We compute $\\boldsymbol{\\sigma}$ coefficient Term 1 in [this cell](#sigmacoeffterm1), $\\boldsymbol{\\sigma}$ coefficient Term 2 in [this cell](#sigmacoeffterm2), and $\\boldsymbol{\\sigma}$ coefficient Term 3 in [this cell](#sigmacoeffterm3)." ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.931457Z", "iopub.status.busy": "2021-03-07T17:24:21.930472Z", "iopub.status.idle": "2021-03-07T17:24:21.933788Z", "shell.execute_reply": "2021-03-07T17:24:21.934398Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmacoeff = sigmacoeffTerm1 + sigmacoeffTerm2 + sigmacoeffTerm3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 9.d.i: $\\boldsymbol{\\sigma}$ Coefficient Term 1 \\[Back to [top](#toc)\\]\n", "$$\\label{sigmacoeffterm1}$$\n", "\n", "We build this term from [BB2011](https://arxiv.org/abs/1107.2904) Equation (51) with $a_{0} = 0$ (see discussion preceding [T2012](https://arxiv.org/abs/1202.0790) Equation (4)), where what is listed below is the coefficient on $\\boldsymbol{\\sigma}$:\n", "\n", "\\begin{align*}\n", " \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 1} &= -\\frac{2}{3} \\eta \\frac{ M }{ r } + \\frac{1}{4} \\eta \\left( Q - 1 \\right) - 3 \\eta \\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\\\\n", " &= \\frac{ \\eta }{ 12 } \\left( -8 \\frac{ M }{ r } + 3 \\left( Q - 1 \\right) - 36 \\smash[b]{\\underbrace{ \\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} }_{\\rm DrSipn2}} \\vphantom{\\underbrace{a}_{b}} \\right)\n", "\\end{align*}\n", "\n", "We define $\\eta$ in [this cell](#eta), $M$ in [this cell](#m), $Q-1$ in [this cell](#q), and $\\frac{ \\Delta_r }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2}$ in [this cell](#drsipn2)." ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.940143Z", "iopub.status.busy": "2021-03-07T17:24:21.939203Z", "iopub.status.idle": "2021-03-07T17:24:21.943413Z", "shell.execute_reply": "2021-03-07T17:24:21.944146Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmacoeffTerm1 = eta/12*(-8/r + 3*Qminus1 - 36*DrSipn2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 9.d.ii: $\\boldsymbol{\\sigma}$ Coefficient Term 2 \\[Back to [top](#toc)\\]\n", "$$\\label{sigmacoeffterm2}$$\n", "\n", "We build this term from [BB2011](https://arxiv.org/abs/1107.2904) Equation (52) with all $a_{i} = 0$, $i \\in \\left\\{0, 1, 2, 3\\right\\}$ (see discussion preceeding [T2012](https://arxiv.org/abs/1202.0790) Equation (4)), and just the coefficient on $\\boldsymbol{\\sigma}$:\n", "\n", "\\begin{align*}\n", " \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 2} &= \\frac{1}{9} \\left( -56 \\eta -21 \\eta^{2} \\right) \\left( \\frac{ M }{ r } \\right)^{2} + \\frac{5}{24} \\left( 27 \\eta^{2} \\right) \\frac{ \\Delta_r^{2} }{ \\Sigma^{2} } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{4} \\\\\n", " &\\ \\ \\ \\ \\ + \\frac{1}{144} \\left(-45 \\eta \\right) \\left( Q - 1 \\right)^{2} + \\frac{1}{36} \\left( -109 \\eta + 51 \\eta^{2} \\right) \\frac{ M }{ r } \\left( Q - 1 \\right) \\\\\n", " &\\ \\ \\ \\ \\ + \\frac{1}{24} \\left( 6 \\eta - 39\\eta^{2} \\right) \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\left( Q - 1 \\right) + \\frac{1}{24} \\left( -16 \\eta - 147 \\eta^{2} \\right) \\frac{ M }{ r } \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\\\\n", " &= \\frac{ \\eta }{ 144 r^{2} } \\left[ -896 M^{2} + r \\left( -436 M \\left( Q - 1 \\right) - 96 M \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right.\\right. \\\\\n", " &\\ \\ \\ \\ \\ \\left.\\left. + r \\left( -45 \\left( Q - 1 \\right)^{2} + 36 \\left( Q - 1 \\right) \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right) \\right) + \\eta \\left( -336 M^{2} + r \\left( 204 M \\left( Q -1 \\right) - 882 M \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right.\\right.\\right. \\\\\n", " &\\ \\ \\ \\ \\ \\left.\\left.\\left. + r \\left( 810 \\frac{ \\Delta_{r}^{2} }{ \\Sigma^{2} } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{4} - 234 \\left( Q - 1 \\right) \\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2} \\right) \\right) \\right) \\right]\n", "\\end{align*}\n", "\n", "We define $\\eta$ in [this cell](#eta), $M$ in [this cell](#M), $Q - 1$ in [this cell](#q), and $\\frac{ \\Delta_{r} }{ \\Sigma } \\left( {\\bf n} \\cdot \\hat{\\bf p} \\right)^{2}$ in [this cell](#drsipn2)." ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.951152Z", "iopub.status.busy": "2021-03-07T17:24:21.950086Z", "iopub.status.idle": "2021-03-07T17:24:21.954786Z", "shell.execute_reply": "2021-03-07T17:24:21.954029Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmacoeffTerm2 = eta/(144*r*r)*(-896 + r*(-436*Qminus1 - 96*DrSipn2 + r*(-45*Qminus1*Qminus1\n", " + 36*Qminus1*DrSipn2)) + eta*(-336 + r*(204*Qminus1 - 882*DrSipn2\n", " + r*(810*DrSipn2*DrSipn2 - 234*Qminus1*DrSipn2))))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 9.d.iii: $\\boldsymbol{\\sigma}$ Coefficient Term 3 \\[Back to [top](#toc)\\]\n", "$$\\label{sigmacoeffterm3}$$\n", "\n", "From Section II of [T2014)](https://arxiv.org/abs/1311.2544),\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\sigma}\\ {\\rm coefficient\\ Term\\ 3} = \\eta dSO u^{3}.\n", "\\end{equation*}\n", "\n", "where $d_{\\rm SO}$ is a fitting parameter. We define $\\eta$ in [this cell](#eta), $u$ in [this cell](#u)." ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.961399Z", "iopub.status.busy": "2021-03-07T17:24:21.960303Z", "iopub.status.idle": "2021-03-07T17:24:21.965069Z", "shell.execute_reply": "2021-03-07T17:24:21.965577Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmacoeffTerm3 = eta*dSO*u*u*u\n", "dSO = -74.71 - 156.*eta + 627.5*eta*eta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 10: Derivatives of the Metric Potential \\[Back to [top](#toc)\\]\n", "$$\\label{metpotderivs}$$\n", "\n", "We collect here terms dependent on derivatives of the metric potential (see [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.47))." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.a: $\\omega_{r}$ \\[Back to [top](#toc)\\]\n", "$$\\label{omegar}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47b) we have\n", "\n", "\\begin{equation*}\n", " \\omega_{r} = \\frac{ \\Lambda_{t} \\tilde{\\omega}_{\\rm fd}^{\\prime} - \\Lambda_{t}^{\\prime} \\tilde{\\omega}_{\\rm fd} }{ \\Lambda_{t}^{2} }.\n", "\\end{equation*}\n", "\n", "We define $\\Lambda_{t}$ in [this cell](#lambdat), $\\tilde{\\omega}_{\\rm fd}^{\\prime}$ in [this cell](#omegatildeprm), $\\Lambda_{t}^{\\prime}$ in [this cell](#lambdatprm), and $\\tilde{\\omega}_{\\rm fd}$ in [this cell](#omegatilde)." ] }, { "cell_type": "code", "execution_count": 43, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.970350Z", "iopub.status.busy": "2021-03-07T17:24:21.969737Z", "iopub.status.idle": "2021-03-07T17:24:21.974870Z", "shell.execute_reply": "2021-03-07T17:24:21.974297Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "omegar = (Lambdat*omegatildeprm - Lambdatprm*omegatilde)/(Lambdat*Lambdat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.b: $\\nu_{r}$ \\[Back to [top](#toc)\\]\n", "$$\\label{nur}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47c) we have\n", "\n", "\\begin{equation*}\n", " \\nu_{r} = \\frac{ r }{ \\Sigma } + \\frac{ \\varpi^{2} \\left( \\varpi^{2} \\Delta^{\\prime}_{t} - 4 r \\Delta_{t} \\right) }{ 2 \\Lambda_{t} \\Delta_{t} }.\n", "\\end{equation*}\n", "\n", "We define $r$ in [this cell](#r), $\\Sigma$ in [this cell](#usigma), $\\varpi^{2}$ in [this cell](#w2), $\\Delta_{t}^{\\prime}$ in [this cell](#deltatprm), $\\Delta_{t}$ in [this cell](#deltat), and $\\Lambda_{t}$ in [this cell](#lambdat)." ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.980847Z", "iopub.status.busy": "2021-03-07T17:24:21.979787Z", "iopub.status.idle": "2021-03-07T17:24:21.983322Z", "shell.execute_reply": "2021-03-07T17:24:21.983926Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "nur = r/Sigma + w2*(w2*Deltatprm - 4*r*Deltat)/(2*Lambdat*Deltat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.c: $\\mu_{r}$ \\[Back to [top](#toc)\\]\n", "$$\\label{mur}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47d) we have\n", "\n", "\\begin{equation*}\n", " \\mu_{r} = \\frac{ r }{ \\Sigma } - \\frac{ 1 }{ \\sqrt{ \\Delta_{r} } }.\n", "\\end{equation*}\n", "\n", "We define $r$ in [this cell](#r), $\\Sigma$ in [this cell](#usigma), and $\\Delta_{r}$ in [this cell](#deltar)." ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.990421Z", "iopub.status.busy": "2021-03-07T17:24:21.989376Z", "iopub.status.idle": "2021-03-07T17:24:21.992510Z", "shell.execute_reply": "2021-03-07T17:24:21.993062Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "mur = r/Sigma - 1/sp.sqrt(Deltar)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.d: $\\omega_{\\cos\\theta}$ \\[Back to [top](#toc)\\]\n", "$$\\label{omegacostheta}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47f), we have\n", "\n", "\\begin{equation*}\n", " \\omega_{\\cos\\theta} = -\\frac{ 2 a^{2} \\cos\\theta \\Delta_{t} \\tilde{\\omega}_{\\rm fd} }{ \\Lambda_{t}^{2} }.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $\\cos\\theta$ in [this cell](#costheta), $\\Delta_{t}$ in [this cell](#deltat), $\\tilde{\\omega}_{\\rm fd}$ in [this cell](#omegatilde), and $\\Lambda_{t}$ in [this cell](#lambdat)." ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:21.998325Z", "iopub.status.busy": "2021-03-07T17:24:21.997491Z", "iopub.status.idle": "2021-03-07T17:24:22.000255Z", "shell.execute_reply": "2021-03-07T17:24:22.000739Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "omegacostheta = -2*a*a*costheta*Deltat*omegatilde/(Lambdat*Lambdat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.e: $\\nu_{\\cos\\theta}$ \\[Back to [top](#toc)\\]\n", "$$\\label{nucostheta}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47g) we have\n", "\n", "\\begin{equation*}\n", " \\nu_{\\cos\\theta} = \\frac{ a^{2} \\varpi^{2} \\cos\\theta \\left( \\varpi^{2} - \\Delta_{t} \\right) }{ \\Lambda_{t} \\Sigma }.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $\\varpi^{2}$ in [this cell](#w2), $\\cos\\theta$ in [this cell](#costheta), $\\Delta_{t}$ in [this cell](#deltat), $\\Lambda_{t}$ in [this cell](#lambdat), and $\\Sigma$ in [this cell](#usigma)." ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.007880Z", "iopub.status.busy": "2021-03-07T17:24:22.007082Z", "iopub.status.idle": "2021-03-07T17:24:22.010531Z", "shell.execute_reply": "2021-03-07T17:24:22.010003Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "nucostheta = a*a*w2*costheta*(w2 - Deltat)/(Lambdat*Sigma)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.f: $\\mu_{\\cos \\theta}$ \\[Back to [top](#toc)\\]\n", "$$\\label{mucostheta}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47h) we have\n", "\n", "\\begin{equation*}\n", " \\mu_{\\cos \\theta} = \\frac{ a^{2} \\cos \\theta }{ \\Sigma }.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $\\cos \\theta$ in [this cell](#costheta), and $\\Sigma$ in [this cell](#usigma) below." ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.015621Z", "iopub.status.busy": "2021-03-07T17:24:22.014827Z", "iopub.status.idle": "2021-03-07T17:24:22.018256Z", "shell.execute_reply": "2021-03-07T17:24:22.018845Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "mucostheta = a*a*costheta/Sigma" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.g: $\\Lambda_{t}^{\\prime}$ \\[Back to [top](#toc)\\]\n", "$$\\label{lambdatprm}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.47), we know that the prime notation indicates a derivative with respect to $r$. Using the definiton of $\\Lambda_{t}$ in [this cell](#lambdat), we have\n", "\n", "\\begin{equation*}\n", " \\Lambda_{t}^{\\prime} = 4 \\left( a^{2} + r^{2} \\right) r - a^{2} \\Delta_{t}^{\\prime} \\sin^{2} \\theta.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $r$ in [this cell](#r), $\\Delta_{u}$ in [this cell](#deltau), and $\\sin^{2}\\theta$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.025383Z", "iopub.status.busy": "2021-03-07T17:24:22.024328Z", "iopub.status.idle": "2021-03-07T17:24:22.028759Z", "shell.execute_reply": "2021-03-07T17:24:22.028086Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Lambdatprm = 4*(a*a + r*r)*r - 2*a*a*Deltatprm*sin2theta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 10.h: $\\tilde{\\omega}_{\\rm fd}^{\\prime}$ \\[Back to [top](#toc)\\]\n", "$$\\label{omegatildeprm}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47), we know that the prime notation indicates a derivative with respect to $r$. Using the definiton of $\\tilde{\\omega}_{\\rm fd}$ in [this cell](#omegatilde), we have\n", "\n", "\\begin{equation*}\n", " \\tilde{\\omega}_{\\rm fd}^{\\prime} = 2 a M.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a) and $M$ in [this cell](#m)." ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.034410Z", "iopub.status.busy": "2021-03-07T17:24:22.033590Z", "iopub.status.idle": "2021-03-07T17:24:22.036742Z", "shell.execute_reply": "2021-03-07T17:24:22.037256Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "omegatildeprm = 2*a" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 11: The Deformed and Rescaled Metric Potentials \\[Back to [top](#toc)\\]\n", "$$\\label{metpots}$$\n", "\n", "We collect here terms of the deformed and scaled metric potentils. See [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.30)--(5.34) and (5.48)--(5.52)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.a: $\\omega$ \\[Back to [top](#toc)\\]\n", "$$\\label{omega}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.31) we have\n", "\n", "\\begin{equation*}\n", " \\omega = \\frac{ \\tilde{\\omega}_{\\rm fd} }{ \\Lambda_{t} }.\n", "\\end{equation*}\n", "\n", "We define $\\tilde{\\omega}_{\\rm fd}$ in [this cell](#omegatilde) and $\\Lambda_{t}$ in [this cell](#lambdat)." ] }, { "cell_type": "code", "execution_count": 51, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.042681Z", "iopub.status.busy": "2021-03-07T17:24:22.041903Z", "iopub.status.idle": "2021-03-07T17:24:22.045304Z", "shell.execute_reply": "2021-03-07T17:24:22.045986Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "omega = omegatilde/Lambdat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.b: $e^{2\\nu}$ and $e^{\\nu}$ \\[Back to [top](#toc)\\]\n", "$$\\label{exp2nu}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.32), we have\n", "\n", "\\begin{equation*}\n", " e^{2 \\nu} = \\frac{ \\Delta_{t} \\Sigma }{ \\Lambda_t }.\n", "\\end{equation*}\n", "\n", "It follows that\n", "\n", "\\begin{equation*}\n", " e^{\\nu} = \\sqrt{ \\frac{ \\Delta_{t} \\Sigma }{ \\Lambda_t } }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{t}$ in [this cell](#deltat), $\\Sigma$ in [this cell](#usigma), and $\\Lambda_{t}$ in [this cell](#lambdat)." ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.051597Z", "iopub.status.busy": "2021-03-07T17:24:22.050823Z", "iopub.status.idle": "2021-03-07T17:24:22.053685Z", "shell.execute_reply": "2021-03-07T17:24:22.054183Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "expnu = sp.sqrt(exp2nu)\n", "exp2nu = Deltat*Sigma/Lambdat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.c: $\\tilde{B}$ \\[Back to [top](#toc)\\]\n", "$$\\label{btilde}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.48), we have\n", "\n", "\\begin{equation*}\n", " \\tilde{B} = \\sqrt{ \\Delta_{t} }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{t}$ in [this cell](#deltat)." ] }, { "cell_type": "code", "execution_count": 53, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.059402Z", "iopub.status.busy": "2021-03-07T17:24:22.058727Z", "iopub.status.idle": "2021-03-07T17:24:22.061473Z", "shell.execute_reply": "2021-03-07T17:24:22.061973Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Btilde = sp.sqrt(Deltat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.d: $\\tilde{B}_{r}$ \\[Back to [top](#toc)\\]\n", "$$\\label{brtilde}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.49), we have\n", "\n", "\\begin{equation*}\n", " \\tilde{B}_{r} = \\frac{ \\sqrt{ \\Delta_{r} } \\Delta_{t}^{\\prime} - 2 \\Delta_{t} }{ 2 \\sqrt{ \\Delta_{r} \\Delta_{t} } }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{r}$ in [this cell](#deltar), $\\Delta_{t}^{\\prime}$ in [this cell](#deltatprm), and $\\Delta_{t}$ in [this cell](#deltat)." ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.067000Z", "iopub.status.busy": "2021-03-07T17:24:22.066230Z", "iopub.status.idle": "2021-03-07T17:24:22.069862Z", "shell.execute_reply": "2021-03-07T17:24:22.069328Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Brtilde = (sp.sqrt(Deltar)*Deltatprm - 2*Deltat)/(2*sp.sqrt(Deltar*Deltat))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.e: $e^{2\\tilde{\\mu}}$ and $e^{\\tilde{\\mu}}$ \\[Back to [top](#toc)\\]\n", "$$\\label{exp2mu}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.50), we have\n", "\n", "\\begin{equation*}\n", " e^{2 \\tilde{\\mu}} = \\Sigma.\n", "\\end{equation*}\n", "\n", "It follows that\n", "\n", "\\begin{equation*}\n", " e^{\\tilde{\\mu}} = \\sqrt{ \\Sigma }.\n", "\\end{equation*}\n", "\n", "\n", "We define $\\Sigma$ in [this cell](#usigma)." ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.075444Z", "iopub.status.busy": "2021-03-07T17:24:22.074539Z", "iopub.status.idle": "2021-03-07T17:24:22.078828Z", "shell.execute_reply": "2021-03-07T17:24:22.079392Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "expmu = sp.sqrt(exp2mu)\n", "exp2mu = Sigma" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.f: $\\tilde{J}$ \\[Back to [top](#toc)\\]\n", "$$\\label{jtilde}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.51) we have\n", "\n", "\\begin{equation*}\n", " \\tilde{J} = \\sqrt{ \\Delta_{r} }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{r}$ in [this cell](#deltar) below." ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.085271Z", "iopub.status.busy": "2021-03-07T17:24:22.084421Z", "iopub.status.idle": "2021-03-07T17:24:22.087753Z", "shell.execute_reply": "2021-03-07T17:24:22.088365Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Jtilde = sp.sqrt(Deltar)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 11.g: $Q$ \\[Back to [top](#toc)\\]\n", "$$\\label{q}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.52),\n", "\n", "\\begin{equation*}\n", " Q = 1 + \\underbrace{ \\frac{ \\Delta_{r} }{ \\Sigma } \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right)^{2} }_{\\rm DrSipn2} + \\underbrace{ \\frac{ \\Sigma }{ \\Lambda_t \\sin^{2} \\theta } }_{\\rm Q\\ coefficient\\ 1} \\left( \\smash[b]{ \\underbrace{ \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r }_{\\rm pdotxir} } \\right)^{2} + \\underbrace{ \\frac{ 1 }{ \\Sigma \\sin^{2} \\theta } }_{\\rm Q\\ coefficient\\ 2} \\left( \\smash[b]{ \\underbrace{ \\hat{\\bf p} \\cdot {\\bf v} r }_{\\rm pdotvr} } \\right)^{2};\n", "\\end{equation*}\n", "\n", "We group togther and compute $\\frac{ \\Delta_{r} }{ \\Sigma } \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right)^{2}$ in [this cell](#drsipn2), $\\frac{ \\Sigma }{ \\Lambda_t \\sin^{2} \\theta }$ in [this cell](#qcoeff1), $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir), $\\frac{ 1 }{ \\Sigma \\sin^{2} \\theta }$ in [this cell](#qcoeff2), and $\\hat{\\bf p} \\cdot {\\bf v} r$ in [this cell](#pdotvr)." ] }, { "cell_type": "code", "execution_count": 57, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.094831Z", "iopub.status.busy": "2021-03-07T17:24:22.093765Z", "iopub.status.idle": "2021-03-07T17:24:22.097282Z", "shell.execute_reply": "2021-03-07T17:24:22.097910Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Qminus1 = Q - 1\n", "Q = 1 + DrSipn2 + Qcoeff1*pdotxir*pdotxir + Qcoeff2*pdotvr*pdotvr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 11.g.i: $\\frac{ \\Delta_{r} }{ \\Sigma } \\left( \\hat{\\bf p} \\cdot {\\bf n} \\right)^{2}$ \\[Back to [top](#toc)\\]\n", "$$\\label{drsipn2}$$\n", "\n", "We define $\\Delta_{r}$ in [this cell](#deltar), $\\Sigma$ in [this cell](#usigma), and $\\hat{\\bf p} \\cdot {\\bf n}$ in [this cell](#pdotn)." ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.104358Z", "iopub.status.busy": "2021-03-07T17:24:22.103450Z", "iopub.status.idle": "2021-03-07T17:24:22.107110Z", "shell.execute_reply": "2021-03-07T17:24:22.107751Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "DrSipn2 = Deltar*pdotn*pdotn/Sigma" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 11.g.ii: Q Coefficient 1 \\[Back to [top](#toc)\\]\n", "$$\\label{qcoeff1}$$\n", "\n", "We defined $Q$ coefficient 1 in [this cell](#q) as\n", "\n", "\\begin{equation*}\n", " Q\\ {\\rm coefficient\\ 1} = \\frac{ \\Sigma }{ \\Lambda_t \\sin^{2} \\theta }\n", "\\end{equation*}\n", "\n", "We define $\\Sigma$ in [this cell](#usigma), $\\Lambda_{t}$ in [this cell](#lambdat), and $\\sin^{2} \\theta$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.112814Z", "iopub.status.busy": "2021-03-07T17:24:22.112150Z", "iopub.status.idle": "2021-03-07T17:24:22.117357Z", "shell.execute_reply": "2021-03-07T17:24:22.116667Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Qcoeff1 = Sigma/(Lambdat*sin2theta)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 11.g.iii: Q Coefficient 2 \\[Back to [top](#toc)\\]\n", "$$\\label{qcoeff2}$$\n", "\n", "We defined $Q$ coefficient 2 in [this cell](#q) as\n", "\n", "\\begin{equation*}\n", " Q\\ {\\rm coefficient\\ 2} = \\frac{ 1 }{ \\Sigma \\sin^{2} \\theta }\n", "\\end{equation*}\n", "\n", "We define $\\Sigma$ in [this cell](#usigma) and $\\sin^{2} \\theta$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 60, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.122783Z", "iopub.status.busy": "2021-03-07T17:24:22.122016Z", "iopub.status.idle": "2021-03-07T17:24:22.125431Z", "shell.execute_reply": "2021-03-07T17:24:22.124861Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Qcoeff2 = 1/(Sigma*sin2theta)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 12: Tortoise Terms \\[Back to [top](#toc)\\]\n", "$$\\label{tort}$$\n", "\n", "We collect here terms related to the conversion from Boyer-Lindquist coordinates to tortoise coordinates. Details of the conversion are given in the appendix of [P2010](https://arxiv.org/abs/0912.3466v2)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.a: $p_{\\phi}$ \\[Back to [top](#toc)\\]\n", "$$\\label{pphi}$$\n", "\n", "From the discussion preceding [BB2010](https://arxiv.org/abs/0912.3517) Equation (3.41), the phi component of the tortoise momentum $p_{\\phi}$ is given by\n", "\n", "\\begin{equation*}\n", " p_{\\phi} = \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r.\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ in [this cell](#pdotxir)." ] }, { "cell_type": "code", "execution_count": 61, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.130954Z", "iopub.status.busy": "2021-03-07T17:24:22.129931Z", "iopub.status.idle": "2021-03-07T17:24:22.133418Z", "shell.execute_reply": "2021-03-07T17:24:22.134001Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "pphi = pdotxir" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.b: $\\hat{\\bf p} \\cdot {\\bf v} r$ \\[Back to [top](#toc)\\]\n", "$$\\label{pdotvr}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " \\hat{\\bf p} \\cdot {\\bf v} r = \\left( \\hat{p}_{1} v_{1} + \\hat{p}_{2} v_{2} + \\hat{p}_{3} v_{3} \\right) r\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf p}$ in [this cell](#hatp), ${\\bf v}$ in [this cell](#v), and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 62, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.139891Z", "iopub.status.busy": "2021-03-07T17:24:22.138986Z", "iopub.status.idle": "2021-03-07T17:24:22.142429Z", "shell.execute_reply": "2021-03-07T17:24:22.142978Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "pdotvr = (phat1*v1 + phat2*v2 + phat3*v3)*r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.c: $\\hat{\\bf p} \\cdot {\\bf n}$ \\[Back to [top](#toc)\\]\n", "$$\\label{pdotn}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " \\hat{\\bf p} \\cdot {\\bf n} = \\hat{p}_{1} n_{1} + \\hat{p}_{2} n_{2} + \\hat{p}_{3} n_{3}\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf p}$ in [this cell](#hatp) and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.149053Z", "iopub.status.busy": "2021-03-07T17:24:22.148259Z", "iopub.status.idle": "2021-03-07T17:24:22.151174Z", "shell.execute_reply": "2021-03-07T17:24:22.151787Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "pdotn = phat1*n1 + phat2*n2 + phat3*n3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.d: $\\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r$ \\[Back to [top](#toc)\\]\n", "$$\\label{pdotxir}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " \\hat{\\bf p} \\cdot \\boldsymbol{\\xi} r = \\left( \\hat{p}_{1} \\xi_{1} + \\hat{p}_{2} \\xi_{2} + \\hat{p}_{3} \\xi_{3} \\right) r\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf p}$ in [this cell](#hatp), $\\boldsymbol{\\xi}$ in [this cell](#xi), and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 64, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.157013Z", "iopub.status.busy": "2021-03-07T17:24:22.156221Z", "iopub.status.idle": "2021-03-07T17:24:22.159905Z", "shell.execute_reply": "2021-03-07T17:24:22.159311Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "pdotxir = (phat1*xi1 + phat2*xi2 + phat3*xi3)*r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.e: $\\hat{\\bf p}$ \\[Back to [top](#toc)\\]\n", "$$\\label{hatp}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (3.41), we have $\\hat{\\bf p} = {\\bf p}/m$ where $m$ is the mass of a nonspinning test particle and ${\\bf p}$ is *conjugate* momentum. Following Lines 319--321 of LALSimIMRSpinEOBHamiltonianPrec.c, we convert the Boyer-Lindquist momentum ${\\bf p}$ to the tortoise momentum (see the appendix of [P2010](https://arxiv.org/abs/0912.3466v2)) via\n", "\n", "\\begin{align*}\n", " \\hat{\\bf p} = {\\bf p} + {\\rm prT} \\left( 1 - \\frac{1}{\\rm csi1} \\right) {\\bf n}\n", "\\end{align*}\n", "\n", "We define prT in [this cell](#prt), csi1 in [this cell](#csi1), and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 65, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.165189Z", "iopub.status.busy": "2021-03-07T17:24:22.164233Z", "iopub.status.idle": "2021-03-07T17:24:22.168504Z", "shell.execute_reply": "2021-03-07T17:24:22.167851Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "phat1 = p1 + prT*(1 - 1/csi1)*n1\n", "phat2 = p2 + prT*(1 - 1/csi1)*n2\n", "phat3 = p3 + prT*(1 - 1/csi1)*n3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.f: prT \\[Back to [top](#toc)\\]\n", "$$\\label{prt}$$\n", "\n", "The first component of the momentum vector, after conversion to tortoise coordinates (see the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2)), is\n", "\n", "\\begin{align*}\n", " {\\rm prT} = {\\rm csi2}\\left( p_{1} n_{1} + p_{2} n_{2} + p_{3} n_{3} \\right)\n", "\\end{align*}\n", "\n", "We define csi2 in [this cell](#csi2) and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 66, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.174431Z", "iopub.status.busy": "2021-03-07T17:24:22.173462Z", "iopub.status.idle": "2021-03-07T17:24:22.178068Z", "shell.execute_reply": "2021-03-07T17:24:22.177328Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "prT = csi2*(p1*n1 + p2*n2 + p3*n3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.g: csi2 \\[Back to [top](#toc)\\]\n", "$$\\label{csi2}$$\n", "\n", "From the transformation to tortoise coordinates in the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2),\n", "\n", "\\begin{equation*}\n", " {\\rm csi2} = 1 + \\left( \\frac{1}{2} - \\frac{1}{2}{\\rm sign}\\left( \\frac{3}{2} - \\tau \\right) \\right) \\left( {\\rm csi} - 1 \\right)\n", "\\end{equation*}\n", "\n", "We define csi in [this cell](#csi); $\\tau$ is a tortoise coordinate ($\\tau \\in \\left\\{ 0, 1 ,2 \\right\\}$)." ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.184516Z", "iopub.status.busy": "2021-03-07T17:24:22.183512Z", "iopub.status.idle": "2021-03-07T17:24:22.187195Z", "shell.execute_reply": "2021-03-07T17:24:22.186698Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "csi2 = 1 + (sp.Rational(1,2) - sp.Rational(1,2)*sp.sign(sp.Rational(3,2) - tortoise))*(csi - 1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.h: csi1 \\[Back to [top](#toc)\\]\n", "$$\\label{csi1}$$\n", "\n", "From the transformation to tortoise coordinates in the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2),\n", "\n", "\\begin{equation*}\n", " {\\rm csi1} = 1 + \\left( 1 - \\left\\lvert 1 - \\tau \\right\\rvert \\right) \\left( {\\rm csi} - 1 \\right)\n", "\\end{equation*}\n", "\n", "We define csi in [this cell](#csi); $\\tau$ is a tortoise coordinate ($\\tau \\in \\left\\{ 0, 1 ,2 \\right\\}$)." ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.192240Z", "iopub.status.busy": "2021-03-07T17:24:22.191475Z", "iopub.status.idle": "2021-03-07T17:24:22.194607Z", "shell.execute_reply": "2021-03-07T17:24:22.195096Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "csi1 = 1 + (1 - sp.abs(1-tortoise))*(csi - 1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 12.i: csi \\[Back to [top](#toc)\\]\n", "$$\\label{csi}$$\n", "\n", "From the transformation to tortoise coordinates in the Appendix of [P2010](https://arxiv.org/abs/0912.3466v2),\n", "\n", "\\begin{equation*}\n", " {\\rm csi} = \\frac{ \\sqrt{ \\Delta_{t} \\Delta_{r} } }{ \\varpi^{2} }.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{t}$ in [this cell](#deltat), $\\Delta_{r}$ in [this cell](#deltar), and $\\varpi^{2}$ in [this cell](#w2)." ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.200404Z", "iopub.status.busy": "2021-03-07T17:24:22.199596Z", "iopub.status.idle": "2021-03-07T17:24:22.202358Z", "shell.execute_reply": "2021-03-07T17:24:22.202848Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "csi = sp.sqrt(Deltar*Deltat)/w2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 13: Metric Terms \\[Back to [top](#toc)\\]\n", "$$\\label{metric}$$\n", "\n", "We collect here terms used to define the deformed Kerr metric. See [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.38)--(5.40) and (5.71)--(5.75)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.a: $\\Lambda_{t}$ \\[Back to [top](#toc)\\]\n", "$$\\label{lambdat}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.39),\n", "\n", "\\begin{equation*}\n", " \\Lambda_{t} = \\varpi^{4} - a^{2} \\Delta_{t} \\sin^{2} \\theta.\n", "\\end{equation*}\n", "\n", "We define $\\varpi^{2}$ in [this cell](#w2), $a$ in [this cell](#a), $\\Delta_{t}$ in [this cell](#deltat), and $\\sin^{2}\\theta$ in [this cell](#sin2theta)." ] }, { "cell_type": "code", "execution_count": 70, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.207730Z", "iopub.status.busy": "2021-03-07T17:24:22.207014Z", "iopub.status.idle": "2021-03-07T17:24:22.212149Z", "shell.execute_reply": "2021-03-07T17:24:22.212763Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Lambdat = w2*w2 - a*a*Deltat*sin2theta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.b: $\\Delta_{r}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltar}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.38),\n", "\n", "\\begin{equation*}\n", " \\Delta_{r} = \\Delta_{t} D^{-1}.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{t}$ in [this cell](#deltat) and $D^{-1}$ in [this cell](#dinv)." ] }, { "cell_type": "code", "execution_count": 71, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.218433Z", "iopub.status.busy": "2021-03-07T17:24:22.217611Z", "iopub.status.idle": "2021-03-07T17:24:22.220773Z", "shell.execute_reply": "2021-03-07T17:24:22.221274Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltar = Deltat*Dinv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.c: $\\Delta_{t}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltat}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.71), we have\n", "\n", "\\begin{equation*}\n", " \\Delta_{t} = r^{2} \\Delta_{u}.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{u}$ in [this cell](#deltau) and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 72, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.226220Z", "iopub.status.busy": "2021-03-07T17:24:22.225518Z", "iopub.status.idle": "2021-03-07T17:24:22.228485Z", "shell.execute_reply": "2021-03-07T17:24:22.229074Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltat = r*r*Deltau" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.d: $\\Delta_{t}^{\\prime}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltatprm}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47), we know that the prime notation indicates a derivative with respect to $r$. Using the definition of [$\\Delta_{t}$](#deltat), we have\n", "\n", "\\begin{equation*}\n", " \\Delta_{t}^{\\prime} = 2 r \\Delta_{u} + r^{2} \\Delta_{u}^{\\prime}.\n", "\\end{equation*}\n", "\n", "We define $\\Delta_{u}$ in [this cell](#deltau) and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 73, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.233937Z", "iopub.status.busy": "2021-03-07T17:24:22.233180Z", "iopub.status.idle": "2021-03-07T17:24:22.236245Z", "shell.execute_reply": "2021-03-07T17:24:22.236763Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltatprm = 2*r*Deltau + r*r*Deltauprm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.e: $\\Delta_{u}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltau}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.73), we have\n", "\n", "\\begin{equation*}\n", " \\Delta_u = \\bar{\\Delta}_{u} \\left[ \\smash[b]{\\underbrace{ 1 + \\eta \\Delta_{0} + \\eta \\log \\left( 1 + {\\rm logarg} \\right) }_{\\Delta_{u}\\ {\\rm calibration\\ term}}} \\vphantom{\\underbrace{1}_{n}} \\right]\n", "\\end{equation*}\n", "\n", "We compute $\\bar{\\Delta}_{u}$ in [this cell](#deltaubar) and $\\Delta_{u}$ calibration term and logarg in [this cell](#deltaucalib). From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47), we know that primes denote derivatives with respect to $r$. We have\n", "\n", "\\begin{equation*}\n", " \\Delta_u = \\bar{\\Delta}^{\\prime}_{u} \\left( \\Delta_{u}\\ {\\rm calibration\\ term} \\right) + \\bar{\\Delta}_{u} \\left( \\Delta_{u}\\ {\\rm calibration\\ term} \\right)^{\\prime}\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 74, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.241447Z", "iopub.status.busy": "2021-03-07T17:24:22.240729Z", "iopub.status.idle": "2021-03-07T17:24:22.243832Z", "shell.execute_reply": "2021-03-07T17:24:22.244366Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltauprm = Deltaubarprm*Deltaucalib + Deltaubar*Deltaucalibprm\n", "Deltau = Deltaubar*Deltaucalib" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 13.e.i: $\\bar{\\Delta}_{u}$ \\[Back to [top](#toc)\\]\n", "$$\\label{deltaubar}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.75), we have\n", "\n", "\\begin{equation*}\n", " \\bar{\\Delta}_u = \\frac{ a^{2} u^{2} }{ M^{2} } + \\frac{ 1 }{ \\eta K - 1 } \\left( 2 u + \\frac{ 1 }{ \\eta K - 1 } \\right).\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $u$ in [this cell](#u), $M$ in [this cell](#m), $\\eta$ in [this cell](#eta), and $K$ in [this cell](#k). From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47), we know that primes denote derivatives with respect to $r$. We have\n", "\n", "\\begin{equation*}\n", " \\bar{\\Delta}^{\\prime}_u = \\frac{ -2 a^{2} u^{3} }{ M^{2} } - \\frac{ 2 u^{2} }{ \\eta K - 1 }.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 75, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.249684Z", "iopub.status.busy": "2021-03-07T17:24:22.248900Z", "iopub.status.idle": "2021-03-07T17:24:22.252012Z", "shell.execute_reply": "2021-03-07T17:24:22.252507Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltaubarprm = -2*a*a*u*u*u - 2*u*u/(etaKminus1)\n", "Deltaubar = a*a*u*u + (2*u + 1/etaKminus1)/etaKminus1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 13.e.ii: $\\Delta_{u}$ Calibration Term \\[Back to [top](#toc)\\]\n", "$$\\label{deltaucalib}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.73), we have\n", "\n", "\\begin{align*}\n", " \\Delta_u\\ {\\rm calibration\\ term} &= 1 + \\eta \\Delta_{0} + \\eta \\log \\left( 1 + \\Delta_{1} u + \\Delta_{2} u^{2} + \\Delta_{3} u^{3} + \\Delta_{4} u^{4} \\right) \\\\\n", " &= 1 + \\eta \\left[ \\Delta_{0} + \\log \\left( 1 + \\Delta_{1} u + \\Delta_{2} u^{2} + \\Delta_{3} u^{3} + \\Delta_{4} u^{4} \\right) \\right].\n", "\\end{align*}\n", "\n", "In [T2014](https://arxiv.org/pdf/1311.2544.pdf) Equation (2) an additional term is and is defined in Equation (A2) of [this paper](https://arxiv.org/abs/1608.01907v2). We then have\n", "\n", "\\begin{equation*}\n", " \\Delta_u\\ {\\rm calibration\\ term} = 1 + \\eta \\left[ \\Delta_{0} + \\log \\left( 1 + \\Delta_{1} u + \\Delta_{2} u^{2} + \\Delta_{3} u^{3} + \\Delta_{4} u^{4} + \\Delta_{5} u^{5} \\right) \\right].\n", "\\end{equation*}\n", "\n", "The first term in the brackets of [SH2016](https://arxiv.org/abs/1608.01907) Equation (A2c) is $\\Delta_{5\\ell}$. That brings us to\n", "\n", "\\begin{equation*}\n", " \\Delta_u\\ {\\rm calibration\\ term} = 1 + \\eta \\left[ \\Delta_{0} + \\log \\left( 1 + \\underbrace{ \\Delta_{1} u + \\Delta_{2} u^{2} + \\Delta_{3} u^{3} + \\Delta_{4} u^{4} + \\Delta_{5} u^{5} + \\Delta_{5\\ell} u^{5} \\ln\\left(u\\right) }_{ \\rm logarg } \\right) \\right].\n", "\\end{equation*}\n", "\n", "Note our notation for logarg. We define $u$ in [this cell](#u), $\\eta$ in [this cell](#eta), and the calibration coefficients $\\Delta_{i}$, $i \\in \\left\\{0, 1, 2, 3, 4\\right\\}$, in [this cell](#calib_coeffs).\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.47), we know that primes denote derivatives with respect to $r$. We have\n", "\\begin{equation*}\n", " \\left( \\Delta_u\\ {\\rm calibration\\ term} \\right)^{\\prime} = \\frac{ -\\eta u^{2} \\left( \\Delta_{1} + 2 \\Delta_{2} u + 3 \\Delta_{3} u^{2} + 4 \\Delta_{4} u^{3} + 5 \\Delta_{5} u^{4} + 5 \\Delta_{5\\ell} u^{4} \\ln\\left( u \\right) + \\Delta_{5\\ell} u^{5} u^{-1} \\right) }{ 1 + {\\rm logarg} }.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.257935Z", "iopub.status.busy": "2021-03-07T17:24:22.256877Z", "iopub.status.idle": "2021-03-07T17:24:22.260920Z", "shell.execute_reply": "2021-03-07T17:24:22.261434Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Deltaucalibprm = -eta*u*u*(Delta1 + u*(2*Delta2 + u*(3*Delta3\n", " + u*(4*Delta4 + u*(5*(Delta5 + Delta5l*sp.log(u)))))))/(1 + logarg)\n", "Deltaucalib = 1 + eta*(Delta0 + sp.log(1 + logarg))\n", "logarg = u*(Delta1 + u*(Delta2 + u*(Delta3 + u*(Delta4 + u*(Delta5 + Delta5l*sp.log(u))))))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 13.e.iii: Calibration Coefficients $\\Delta_{i}$, $i \\in \\left\\{0, 1, 2, 3, 4\\right\\}$ \\[Back to [top](#toc)\\]\n", "$$\\label{calib_coeffs}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equations (5.77)--(5.81), we have\n", "\n", "\\begin{align*}\n", " \\Delta_{0} &= K \\left( \\eta K - 2 \\right) \\\\\n", " \\Delta_{1} &= -2 \\left( \\eta K - 1 \\right) \\left( K + \\Delta_{0} \\right) \\\\\n", " \\Delta_{2} &= \\frac{1}{2} \\Delta_{1} \\left( -4 \\eta K + \\Delta_{1} + 4 \\right) - \\frac{ a^{2} }{ M^{2} } \\left( \\eta K - 1 \\right)^{2} \\Delta_{0}\\\\\n", " \\Delta_{3} &= \\frac{1}{3} \\left[ -\\Delta_{1}^{3} + 3 \\left( \\eta K - 1 \\right) \\Delta_{1}^{2} + 3 \\Delta_{2} \\Delta_{1} - 6 \\left( \\eta K - 1 \\right) \\left( -\\eta K + \\Delta_{2} + 1 \\right) - 3 \\frac{ a^{2} }{ M^{2} } \\left( \\eta K - 1 \\right)^{2} \\Delta_{1} \\right] \\\\\n", " &= -\\frac{1}{3}\\Delta_{1}^{3} + \\left( \\eta K - 1 \\right) \\Delta_{1}^{2} + \\Delta_{2} \\Delta_{1} - 2 \\left( \\eta K - 1 \\right) \\left( \\Delta_{2}- \\left( \\eta K - 1 \\right) \\right) - \\frac{ a^{2} }{ M^{2} } \\left( \\eta K - 1 \\right)^{2} \\Delta_{1} \\\\\n", " \\Delta_{4} &= \\frac{1}{12} \\left\\{ 6 \\frac{ a^{2} }{ M^{2} } \\left( \\Delta_{1}^{2} - 2 \\Delta_{2} \\right) \\left( \\eta K - 1 \\right)^{2} + 3 \\Delta_{1}^{4} - 8 \\left( \\eta K - 1 \\right) \\Delta_{1}^{3} - 12 \\Delta_{2} \\Delta_{1}^{2} + 12 \\left[ 2 \\left( \\eta K - 1 \\right) \\Delta_{2} + \\Delta_{3} \\right] \\Delta_{1} \\right.\\\\\n", " &\\left.\\ \\ \\ \\ \\ + 12 \\left( \\frac{94}{3} - \\frac{41}{32} \\pi^{2} \\right) \\left( \\eta K - 1 \\right)^{2} + 6 \\left[ \\Delta_{2}^{2} - 4 \\Delta_{3} \\left( \\eta K - 1 \\right) \\right] \\right\\} \\\\\n", " \\Delta_{5} &= \\left( \\eta K - 1 \\right)^{2} \\left( -\\frac{4237}{60} + \\frac{128}{5}\\gamma + \\frac{2275}{512} \\pi^{2} - \\frac{1}{3} a^{2} \\left\\{ \\Delta_{1}^{3} - 3 \\Delta_{1} \\Delta_{2} + 3 \\Delta_{3} \\right\\} \\right. \\\\\n", " &\\ \\ \\ \\ \\ - \\frac{ \\Delta_{1}^{5} - 5 \\Delta_{1}^{3} \\Delta_{2} + 5 \\Delta_{1} \\Delta_{2}^{2} + 5 \\Delta_{1}^{2} \\Delta_{3} - 5 \\Delta_{2} \\Delta_{3} - 5 \\Delta_{1} \\Delta_{4} }{ 5 \\left( \\eta K - 1 \\right)^{2} } \\\\\n", " &\\left.\\ \\ \\ \\ \\ + \\frac{ \\Delta_{1}^{4} - 4 \\Delta_{1}^{2} \\Delta_{2} + 2 \\Delta_{2}^{2} + 4 \\Delta_{1} \\Delta_{3} - 4 \\Delta_{4} }{ 2\\left( \\eta K - 1 \\right) } + \\frac{256}{5} \\log(2) \\right) \\\\\n", " \\Delta_{5\\ell} &= \\frac{64}{5} \\left( \\eta K - 1 \\right)^{2}.\n", "\\end{align*}\n", "\n", "We define $K$ in [this cell](#k), $\\eta$ in [this cell](#eta), $a$ in [this cell](#a), and $M$ in [this cell](#m). Note that the constant $\\gamma$ is the Euler-Mascheroni, and the value is taken from the [LALSuite documentation](https://lscsoft.docs.ligo.org/lalsuite/lal/group___l_a_l_constants__h.html). In the Python code, we denote $\\gamma$ by EMgamma." ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.267747Z", "iopub.status.busy": "2021-03-07T17:24:22.266734Z", "iopub.status.idle": "2021-03-07T17:24:22.270379Z", "shell.execute_reply": "2021-03-07T17:24:22.271000Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Delta5l = etaKminus1*etaKminus1*sp.Rational(64,5)\n", "Delta5 = etaKminus1*etaKminus1*((sp.Rational(-4237,60) + sp.Rational(128,5)*EMgamma\n", " + sp.Rational(2275,512)*sp.pi*sp.pi - sp.Rational(1,3)*a*a*(Delta1*Delta1*Delta1\n", " - 3*Delta1*Delta2 + 3*Delta3) - (Delta1*Delta1*Delta1*Delta1*Delta1\n", " - 5*Delta1*Delta1*Delta1*Delta2 + 5*Delta1*Delta2*Delta2 + 5*Delta1*Delta1*Delta3\n", " - 5*Delta2*Delta3 - 5*Delta1*Delta4)/(5*etaKminus1*etaKminus1)\n", " + (Delta1*Delta1*Delta1*Delta1 - 4*Delta1*Delta1*Delta2 + 2*Delta2*Delta2\n", " + 4*Delta1*Delta3 - 4*Delta4)/(2*etaKminus1) + sp.Rational(256,5)*sp.log(2)))\n", "Delta4 = sp.Rational(1,12)*(6*a*a*(Delta1*Delta1 - 2*Delta2)*etaKminus1*etaKminus1 + 3*Delta1*Delta1*Delta1*Delta1\n", " - 8*etaKminus1*Delta1*Delta1*Delta1 -12*Delta2*Delta1*Delta1 + 12*(2*etaKminus1*Delta2\n", " + Delta3)*Delta1 + 12*(sp.Rational(94,3)\n", " - sp.Rational(41,32)*sp.pi*sp.pi)*etaKminus1*etaKminus1 + 6*(Delta2*Delta2\n", " - 4*Delta3*etaKminus1))\n", "Delta3 = -sp.Rational(1,3)*Delta1*Delta1*Delta1 + etaKminus1*Delta1*Delta1 + Delta2*Delta1\n", " -2*etaKminus1*(Delta2 - etaKminus1) - a*a*etaKminus1*etaKminus1*Delta1\n", "Delta2 = sp.Rational(1,2)*Delta1*(Delta1 - 4*etaKminus1) - a*a*etaKminus1*etaKminus1*Delta0\n", "Delta1 = -2*etaKminus1*(K + Delta0)\n", "Delta0 = K*(eta*K - 2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 13.e.iv: $K$ \\[Back to [top](#toc)\\]\n", "$$\\label{k}$$\n", "\n", "The calibration constant $K$ is defined in [T2014](https://arxiv.org/pdf/1311.2544.pdf) Section II:\n", "\n", "\\begin{equation*}\n", " K = 1.712 - 1.804 \\eta - 39.77 \\eta^2 + 103.2 \\eta^3.\n", "\\end{equation*}\n", "\n", "The term $\\eta K - 1$ is sufficiently common that we also define it:\n", "\n", "\\begin{equation*}\n", " {\\rm etaKminus1} = \\eta K - 1.\n", "\\end{equation*}\n", "\n", "We define $\\eta$ in [this cell](#eta)." ] }, { "cell_type": "code", "execution_count": 78, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.276670Z", "iopub.status.busy": "2021-03-07T17:24:22.275820Z", "iopub.status.idle": "2021-03-07T17:24:22.279658Z", "shell.execute_reply": "2021-03-07T17:24:22.280351Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "etaKminus1 = eta*K - 1\n", "K = 1.712 - 1.803949138004582*eta - 39.77229225266885*eta*eta + 103.16588921239249*eta*eta*eta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.f: $\\tilde{\\omega}_{\\rm fd}$ \\[Back to [top](#toc)\\]\n", "$$\\label{omegatilde}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.40), we have\n", "\n", "\\begin{equation*}\n", " \\tilde{\\omega}_{\\rm fd} = 2 a M r + \\omega_{1}^{\\rm fd} \\eta \\frac{ a M^{3} }{ r } + \\omega_{2}^{\\rm fd} \\eta \\frac{ M a^{3} }{ r }.\n", "\\end{equation*}\n", "\n", "From discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (6.7), we set $\\omega_{1}^{\\rm fd} = \\omega_{2}^{\\rm fd} = 0$. Thus\n", "\n", "\\begin{equation*}\n", " \\tilde{\\omega}_{\\rm fd} = 2 a M r.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a), $M$ in [this cell](#m), and $r$ in [this cell](#r) below." ] }, { "cell_type": "code", "execution_count": 79, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.287215Z", "iopub.status.busy": "2021-03-07T17:24:22.286254Z", "iopub.status.idle": "2021-03-07T17:24:22.290025Z", "shell.execute_reply": "2021-03-07T17:24:22.290708Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "omegatilde = 2*a*r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 13.g: $D^{-1}$ \\[Back to [top](#toc)\\]\n", "$$\\label{dinv}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.83),\n", "\n", "\\begin{equation*}\n", " D^{-1} = 1 + \\log \\left[ 1 + 6 \\eta u^{2} + 2 \\left( 26 - 3 \\eta \\right) \\eta u^{3} \\right].\n", "\\end{equation*}\n", "\n", "We define $\\eta$ in [this cell](#eta) and $u$ in [this cell](#u)." ] }, { "cell_type": "code", "execution_count": 80, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.297219Z", "iopub.status.busy": "2021-03-07T17:24:22.296289Z", "iopub.status.idle": "2021-03-07T17:24:22.300426Z", "shell.execute_reply": "2021-03-07T17:24:22.301111Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Dinv = 1 + sp.log(1 + 6*eta*u*u + 2*(26 - 3*eta)*eta*u*u*u)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 14: Terms Dependent on Coordinates \\[Back to [top](#toc)\\]\n", "$$\\label{coord}$$\n", "\n", "We collect here terms directly dependent on the coordinates. See [BB2010](https://arxiv.org/abs/0912.3517) Equations (4.5) and (4.6)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 14.a: $\\Sigma$ \\[Back to [top](#toc)\\]\n", "$$\\label{usigma}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.5), we have\n", "\n", "\\begin{equation*}\n", " \\Sigma = r^{2} + a^{2} \\cos^{2} \\theta.\n", "\\end{equation*}\n", "\n", "We define $r$ in [this cell](#r), $a$ in [this cell](#a), and $\\cos \\theta$ in [this cell](#costheta)." ] }, { "cell_type": "code", "execution_count": 81, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.307366Z", "iopub.status.busy": "2021-03-07T17:24:22.306462Z", "iopub.status.idle": "2021-03-07T17:24:22.310246Z", "shell.execute_reply": "2021-03-07T17:24:22.310928Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Sigma = r*r + a*a*costheta*costheta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 14.b: $\\varpi^{2}$ \\[Back to [top](#toc)\\]\n", "$$\\label{w2}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.7),\n", "\n", "\\begin{equation*}\n", " \\varpi^{2} = a^{2} + r^{2}.\n", "\\end{equation*}\n", "\n", "We define $a$ in [this cell](#a) and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 82, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.318088Z", "iopub.status.busy": "2021-03-07T17:24:22.316916Z", "iopub.status.idle": "2021-03-07T17:24:22.320590Z", "shell.execute_reply": "2021-03-07T17:24:22.321249Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "w2 = a*a + r*r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 14.d: $\\sin^{2} \\theta$ \\[Back to [top](#toc)\\]\n", "$$\\label{sin2theta}$$\n", "\n", "Using a common trigonometric identity,\n", "\n", "\\begin{equation*}\n", " \\sin^{2} \\theta = 1 - \\cos^{2} \\theta.\n", "\\end{equation*}\n", "\n", "We define $\\cos \\theta$ in [this cell](#costheta). Note that by construction (from discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.52))\n", "\n", "\\begin{equation*}\n", " \\xi^{2} = \\sin^{2} \\theta.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 83, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.327912Z", "iopub.status.busy": "2021-03-07T17:24:22.326790Z", "iopub.status.idle": "2021-03-07T17:24:22.331368Z", "shell.execute_reply": "2021-03-07T17:24:22.330615Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "xisq = sin2theta\n", "sin2theta = 1 - costheta*costheta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 14.e: $\\cos \\theta$ \\[Back to [top](#toc)\\]\n", "$$\\label{costheta}$$\n", "\n", "From the discussion in [BB2010](https://arxiv.org/abs/0912.3517) after Equation (5.52) (noting that ${\\bf e}_{3} = \\hat{\\bf S}_{\\rm Kerr}$),\n", "\n", "\\begin{equation*}\n", " \\cos \\theta = {\\bf e}_{3} \\cdot {\\bf n} = {\\bf e}_{3}^{1} n^{1} + {\\bf e}_{3}^{2} n^{2} + {\\bf e}_{3}^{3} n^{3}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf e}_{3}$ in [this cell](#e3) and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 84, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.338132Z", "iopub.status.busy": "2021-03-07T17:24:22.336992Z", "iopub.status.idle": "2021-03-07T17:24:22.341693Z", "shell.execute_reply": "2021-03-07T17:24:22.340998Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "costheta = e31*n1 + e32*n2 + e33*n3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 15: Important Vectors \\[Back to [top](#toc)\\]\n", "$$\\label{vectors}$$\n", "\n", "We collect the vectors common for computing $H_{\\rm real}$ (defined in [this cell](#hreal)) below." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 15.a: ${\\bf v}$ \\[Back to [top](#toc)\\]\n", "$$\\label{v}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (3.39), we have\n", "\n", "\\begin{equation*}\n", " {\\bf v} = {\\bf n} \\times \\boldsymbol{\\xi}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf n}$ in [this cell](#n) and $\\boldsymbol{\\xi}$ in [this cell](#xi)." ] }, { "cell_type": "code", "execution_count": 85, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.348303Z", "iopub.status.busy": "2021-03-07T17:24:22.347255Z", "iopub.status.idle": "2021-03-07T17:24:22.350746Z", "shell.execute_reply": "2021-03-07T17:24:22.351376Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "v1 = n2*xi3 - n3*xi2\n", "v2 = n3*xi1 - n1*xi3\n", "v3 = n1*xi2 - n2*xi1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 15.b: $\\boldsymbol{\\xi}$ \\[Back to [top](#toc)\\]\n", "$$\\label{xi}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (3.38), we have\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\xi} = {\\bf e}_{3} \\times {\\bf n}.\n", "\\end{equation*}\n", "\n", "We define ${\\bf e}_{3}$ in [this cell](#e3) and ${\\bf n}$ in [this cell](#n)." ] }, { "cell_type": "code", "execution_count": 86, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.357257Z", "iopub.status.busy": "2021-03-07T17:24:22.356433Z", "iopub.status.idle": "2021-03-07T17:24:22.359189Z", "shell.execute_reply": "2021-03-07T17:24:22.359674Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "xi1 = e32*n3 - e33*n2\n", "xi2 = e31*n3 + e33*n1\n", "xi3 = e31*n2 - e32*n1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 15.c: ${\\bf e}_{3}$ \\[Back to [top](#toc)\\]\n", "$$\\label{e3}$$\n", "\n", "From the discussion in [BB2010](https://arxiv.org/abs/0912.3517) after Equation (5.52),\n", "\n", "\\begin{equation*}\n", " {\\bf e}_{3} = \\hat{\\bf S}_{\\rm Kerr}.\n", "\\end{equation*}\n", "\n", "We define $\\hat{\\bf S}_{\\rm Kerr}$ in [this cell](#skerrhat)." ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.364996Z", "iopub.status.busy": "2021-03-07T17:24:22.364177Z", "iopub.status.idle": "2021-03-07T17:24:22.367641Z", "shell.execute_reply": "2021-03-07T17:24:22.367093Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "e31 = Skerrhat1\n", "e32 = Skerrhat2\n", "e33 = Skerrhat3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 15.d: ${\\bf n}$ \\[Back to [top](#toc)\\]\n", "$$\\label{n}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (3.37), we have\n", "\n", "\\begin{equation*}\n", " {\\bf n} = \\frac{\\bf x }{ r }\n", "\\end{equation*}\n", "\n", "where ${\\bf x} = (x, y, z)$. We define $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 88, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.372651Z", "iopub.status.busy": "2021-03-07T17:24:22.371837Z", "iopub.status.idle": "2021-03-07T17:24:22.375071Z", "shell.execute_reply": "2021-03-07T17:24:22.375619Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "n1 = x/r\n", "n2 = y/r\n", "n3 = z/r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 16: Spin Combinations $\\boldsymbol{\\sigma}$, $\\boldsymbol{\\sigma}^{*}$, and ${\\bf S}_{\\rm Kerr}$ \\[Back to [top](#toc)\\]\n", "$$\\label{spin_combos}$$\n", "\n", "We collect here various combinations of the spins." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.a: $a$ \\[Back to [top](#toc)\\]\n", "$$\\label{a}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.9), we have\n", "\n", "\\begin{equation*}\n", " a = \\frac{ \\left\\lvert {\\bf S}_{\\rm Kerr} \\right\\rvert }{ M }.\n", "\\end{equation*}\n", "\n", "We define $\\left\\lvert{\\bf S}_{\\rm Kerr}\\right\\rvert$ in [this cell](#skerrmag) and $M$ in [this cell](#m)." ] }, { "cell_type": "code", "execution_count": 89, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.380444Z", "iopub.status.busy": "2021-03-07T17:24:22.379767Z", "iopub.status.idle": "2021-03-07T17:24:22.382584Z", "shell.execute_reply": "2021-03-07T17:24:22.383078Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "a = Skerrmag" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.b: $\\hat{\\bf S}_{\\rm Kerr}$ \\[Back to [top](#toc)\\]\n", "$$\\label{skerrhat}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (4.24), we have\n", "\n", "\\begin{equation*}\n", " \\hat{\\bf S}_{\\rm Kerr} = \\frac{ {\\bf S}_{\\rm Kerr} }{ \\left\\lvert {\\bf S}_{\\rm Kerr} \\right\\rvert }.\n", "\\end{equation*}\n", "\n", "We define ${\\bf S}_{\\rm Kerr}$ in [this cell](#skerr)." ] }, { "cell_type": "code", "execution_count": 90, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.387889Z", "iopub.status.busy": "2021-03-07T17:24:22.387204Z", "iopub.status.idle": "2021-03-07T17:24:22.390315Z", "shell.execute_reply": "2021-03-07T17:24:22.390902Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Skerrhat1 = Skerr1/Skerrmag\n", "Skerrhat2 = Skerr2/Skerrmag\n", "Skerrhat3 = Skerr3/Skerrmag" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.c: $\\left\\lvert {\\bf S}_{\\rm Kerr} \\right\\rvert$ \\[Back to [top](#toc)\\]\n", "$$\\label{skerrmag}$$\n", "\n", "We have\n", "\n", "\\begin{equation*}\n", " \\left\\lvert {\\bf S}_{\\rm Kerr} \\right\\rvert = \\sqrt{ {\\bf S}_{\\rm Kerr}^{1} {\\bf S}_{\\rm Kerr}^{1} + {\\bf S}_{\\rm Kerr}^{2} {\\bf S}_{\\rm Kerr}^{2} + {\\bf S}_{\\rm Kerr}^{3} {\\bf S}_{\\rm Kerr}^{3} }.\n", "\\end{equation*}\n", "\n", "We define ${\\bf S}_{\\rm Kerr}$ in [this cell](#skerr)." ] }, { "cell_type": "code", "execution_count": 91, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.397027Z", "iopub.status.busy": "2021-03-07T17:24:22.395989Z", "iopub.status.idle": "2021-03-07T17:24:22.400097Z", "shell.execute_reply": "2021-03-07T17:24:22.399426Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Skerrmag = sp.sqrt(Skerr1*Skerr1 + Skerr2*Skerr2 + Skerr3*Skerr3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.d: ${\\bf S}_{\\rm Kerr}$ \\[Back to [top](#toc)\\]\n", "$$\\label{skerr}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.64):\n", "\n", "\\begin{equation*}\n", " {\\bf S}_{\\rm Kerr} = \\boldsymbol{\\sigma} + \\frac{ 1 }{ c^{2} } \\boldsymbol{\\Delta}_{\\sigma}.\n", "\\end{equation*}\n", "\n", "In [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.67), $\\boldsymbol{\\Delta}_{\\sigma} = 0$. Thus\n", "\n", "\\begin{equation*}\n", " {\\bf S}_{\\rm Kerr} = \\boldsymbol{\\sigma}.\n", "\\end{equation*}\n", "\n", "We define $\\boldsymbol{\\sigma}$ in [this cell](#sigma)." ] }, { "cell_type": "code", "execution_count": 92, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.406495Z", "iopub.status.busy": "2021-03-07T17:24:22.405443Z", "iopub.status.idle": "2021-03-07T17:24:22.409561Z", "shell.execute_reply": "2021-03-07T17:24:22.410247Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "Skerr1 = sigma1\n", "Skerr2 = sigma2\n", "Skerr3 = sigma3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.e: $\\boldsymbol{\\sigma}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sigma}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.2):\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\sigma} = {\\bf S}_{1} + {\\bf S}_{2}.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 93, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.417044Z", "iopub.status.busy": "2021-03-07T17:24:22.416005Z", "iopub.status.idle": "2021-03-07T17:24:22.420189Z", "shell.execute_reply": "2021-03-07T17:24:22.420982Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigma1 = S1x + S2x\n", "sigma2 = S1y + S2y\n", "sigma3 = S1z + S2z" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 16.f: $\\boldsymbol{\\sigma}^{*}$ \\[Back to [top](#toc)\\]\n", "$$\\label{sigmastar}$$\n", "\n", "From [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.3):\n", "\n", "\\begin{equation*}\n", " \\boldsymbol{\\sigma}^{*} = \\frac{ m_{2} }{ m_{1} } {\\bf S}_{1} + \\frac{ m_{1} }{ m_{2} }{\\bf S}_{2}.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 94, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.427881Z", "iopub.status.busy": "2021-03-07T17:24:22.426997Z", "iopub.status.idle": "2021-03-07T17:24:22.431184Z", "shell.execute_reply": "2021-03-07T17:24:22.430513Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "sigmastar1 = m2/m1*S1x + m1/m2*S2x\n", "sigmastar2 = m2/m1*S1y + m1/m2*S2y\n", "sigmastar3 = m2/m1*S1z + m1/m2*S2z" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 17: Fundamental Quantities \\[Back to [top](#toc)\\]\n", "$$\\label{fundquant}$$\n", "\n", " We collect here fundamental quantities from which we build $H_{\\rm real}$ (defined in [this cell](#Hreal))." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 17.a: $u$ \\[Back to [top](#toc)\\]\n", "$$\\label{u}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.40),\n", "\n", "\\begin{equation*}\n", " u = \\frac{ M }{ r }.\n", "\\end{equation*}\n", "\n", "We define $M$ in [this cell](#m) and $r$ in [this cell](#r)." ] }, { "cell_type": "code", "execution_count": 95, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.437385Z", "iopub.status.busy": "2021-03-07T17:24:22.436502Z", "iopub.status.idle": "2021-03-07T17:24:22.439782Z", "shell.execute_reply": "2021-03-07T17:24:22.440429Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "u = 1/r" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 17.b: $r$ \\[Back to [top](#toc)\\]\n", "$$\\label{r}$$\n", "\n", "From the discussion after [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.52),\n", "\n", "\\begin{equation*}\n", " r = \\sqrt{ x^{2} + y^{2} + z^{2} }.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 96, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.447280Z", "iopub.status.busy": "2021-03-07T17:24:22.446180Z", "iopub.status.idle": "2021-03-07T17:24:22.450067Z", "shell.execute_reply": "2021-03-07T17:24:22.450774Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "r = sp.sqrt(x*x + y*y + z*z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 17.c: $\\eta$ \\[Back to [top](#toc)\\]\n", "$$\\label{eta}$$\n", "\n", "From the discussion preceding [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.1),\n", "\n", "\\begin{equation*}\n", " \\eta = \\frac{ \\mu }{ M }.\n", "\\end{equation*}\n", "\n", "We define $\\mu$ in [this cell](#mu)." ] }, { "cell_type": "code", "execution_count": 97, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.457432Z", "iopub.status.busy": "2021-03-07T17:24:22.456351Z", "iopub.status.idle": "2021-03-07T17:24:22.459993Z", "shell.execute_reply": "2021-03-07T17:24:22.460633Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "eta = mu/M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 17.d: $\\mu$ \\[Back to [top](#toc)\\]\n", "$$\\label{mu}$$\n", "\n", "From the discussion preceding [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.1),\n", "\n", "\\begin{equation*}\n", " \\mu = \\frac{ m_{1} m_{2} }{ M }.\n", "\\end{equation*}\n", "\n", "We define $M$ in [this cell](#m)." ] }, { "cell_type": "code", "execution_count": 98, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.467184Z", "iopub.status.busy": "2021-03-07T17:24:22.466044Z", "iopub.status.idle": "2021-03-07T17:24:22.469862Z", "shell.execute_reply": "2021-03-07T17:24:22.470505Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "mu = m1*m2/M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 17.e: $M$ \\[Back to [top](#toc)\\]\n", "$$\\label{m}$$\n", "\n", "From the discussion preceding [BB2010](https://arxiv.org/abs/0912.3517) Equation (5.1),\n", "\n", "\\begin{equation*}\n", " M = m_{1} + m_{2}.\n", "\\end{equation*}" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.476626Z", "iopub.status.busy": "2021-03-07T17:24:22.475638Z", "iopub.status.idle": "2021-03-07T17:24:22.480279Z", "shell.execute_reply": "2021-03-07T17:24:22.479590Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to SEOBNR/Hamiltonian-Hreal_on_top.txt\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/Hamiltonian-Hreal_on_top.txt\n", "\n", "M = m1 + m2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 18: Validation \\[Back to [top](#toc)\\]\n", "$$\\label{validation}$$\n", "\n", "The following code cell reverses the order of the expressions output to SEOBNR/Hamiltonian_on_top.txt and creates a Python function to validate the value of $H_{\\rm real}$ against the SEOBNRv3 Hamiltonian value computed in LALSuite git commit bba40f21e9 for command-line input parameters\n", "\n", "-M 23 -m 10 -f 20 -X 0.01 -Y 0.02 -Z -0.03 -x 0.04 -y -0.05 -z 0.06." ] }, { "cell_type": "code", "execution_count": 100, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.500015Z", "iopub.status.busy": "2021-03-07T17:24:22.483664Z", "iopub.status.idle": "2021-03-07T17:24:22.658494Z", "shell.execute_reply": "2021-03-07T17:24:22.659048Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Printing difference between notebook output and a trusted list of expressions...\n", "Checking file Hamiltonian_expressions.txt-VALIDATION\n", "No difference. TEST PASSED!\n" ] } ], "source": [ "import numpy as np\n", "import difflib, sys, os\n", "\n", "# The subterms in the Hamiltonian expression are sometimes written on more than\n", "# one line for readability in this Jupyter notebook. We first create a file of\n", "# one-line expressions, Hamiltonian-Hreal_one_line_expressions.txt.\n", "with open(os.path.join(Ccodesdir,\"Hamiltonian-Hreal_one_line_expressions.txt\"), \"w\") as output:\n", " count = 0\n", " # Read output of this notebook\n", " for line in list(open(\"SEOBNR/Hamiltonian-Hreal_on_top.txt\")):\n", " # Read the first line\n", " if count == 0:\n", " prevline=line\n", " #Check if prevline is a complete expression\n", " elif \"=\" in prevline and \"=\" in line:\n", " output.write(\"%s\\n\" % prevline.strip('\\n'))\n", " prevline=line\n", " # Check if line needs to be adjoined to prevline\n", " elif \"=\" in prevline and not \"=\" in line:\n", " prevline = prevline.strip('\\n')\n", " prevline = (prevline+line).replace(\" \",\"\")\n", " # Be sure to print the last line.\n", " if count == len(list(open(\"SEOBNR/Hamiltonian-Hreal_on_top.txt\")))-1:\n", " if not \"=\" in line:\n", " print(\"ERROR. Algorithm not robust if there is no equals sign on the final line. Sorry.\")\n", " sys.exit(1)\n", " else:\n", " output.write(\"%s\" % line)\n", " count = count + 1\n", "\n", "# Now reverse the expressions and write them in a function\n", "# This formulation is used to check that we get a reasonable H_real value\n", "with open(os.path.join(Ccodesdir,\"Hreal_on_bottom.py\"), \"w\") as output:\n", " output.write(\"import numpy as np\\ndef compute_Hreal(m1=23., m2=10., EMgamma=0.577215664901532860606512090082402431, tortoise=1, x=2.129681018601393e+01, y=0.000000000000000e+00, z=0.000000000000000e+00, p1=0.000000000000000e+00, p2=2.335391115580442e-01, p3=-4.235164736271502e-22, S1x=4.857667584940312e-03, S1y=9.715161660389764e-03, S1z=-1.457311842632286e-02, S2x=3.673094582185491e-03, S2y=-4.591302628615413e-03, S2z=5.509696538546906e-03):\\n\")\n", " for line in reversed(list(open(\"SEOBNR/Hamiltonian-Hreal_one_line_expressions.txt\"))):\n", " output.write(\" %s\\n\" % line.rstrip().replace(\"sp.sqrt\", \"np.sqrt\").replace(\"sp.Rational\",\n", " \"np.divide\").replace(\"sp.abs\", \"np.abs\").replace(\"sp.log\",\n", " \"np.log\").replace(\"sp.sign\", \"np.sign\").replace(\"sp.pi\",\n", " \"np.pi\"))\n", " output.write(\" return Hreal\")\n", "\n", "# Now reverse the expressions in a standalone text file\n", "# This formulation is used as a harsher validation check that all expressions agree with a trusted list\n", "with open(os.path.join(Ccodesdir,\"Hamiltonian_expressions.txt-VALIDATION\"), \"w\") as output:\n", " for line in reversed(list(open(\"SEOBNR/Hamiltonian-Hreal_one_line_expressions.txt\"))):\n", " output.write(\"%s\\n\" % line.rstrip().replace(\"sp.sqrt\", \"np.sqrt\").replace(\"sp.Rational\",\n", " \"np.divide\").replace(\"sp.abs\", \"np.abs\").replace(\"sp.log\",\n", " \"np.log\").replace(\"sp.sign\", \"np.sign\").replace(\"sp.pi\",\n", " \"np.pi\"))\n", "\n", "print(\"Printing difference between notebook output and a trusted list of expressions...\")\n", "# Open the files to compare\n", "file = \"Hamiltonian_expressions.txt\"\n", "outfile = \"Hamiltonian_expressions.txt-VALIDATION\"\n", "\n", "print(\"Checking file \" + outfile)\n", "with open(os.path.join(Ccodesdir,file), \"r\") as file1, open(os.path.join(Ccodesdir,outfile), \"r\") as file2:\n", " # Read the lines of each file\n", " file1_lines=[]\n", " file2_lines=[]\n", " for line in file1.readlines():\n", " file1_lines.append(line.replace(\" \", \"\"))\n", " for line in file2.readlines():\n", " file2_lines.append(line.replace(\" \", \"\"))\n", " num_diffs = 0\n", " for line in difflib.unified_diff(file1_lines, file2_lines, fromfile=os.path.join(Ccodesdir,file), tofile=os.path.join(Ccodesdir,outfile)):\n", " sys.stdout.writelines(line)\n", " num_diffs = num_diffs + 1\n", " if num_diffs == 0:\n", " print(\"No difference. TEST PASSED!\")\n", " else:\n", " print(\"ERROR: Disagreement found with the trusted file. See differences above.\")\n", " sys.exit(1)\n", "\n", "# Import the new Hamiltonian function and the trusted Hamiltonian function\n", "import SEOBNR.SEOBNR_v3_Hamiltonian as Hreal_trusted\n", "import SEOBNR.Hreal_on_bottom as Hreal_new\n", "\n", "# Compute the trusted and new Hamiltonian values; compare; exit if they disagree!\n", "Hreal = Hreal_trusted.compute_Hreal()\n", "Hreal_temp = Hreal_new.compute_Hreal()\n", "\n", "if(np.abs(Hreal-Hreal_temp)>1e-14):\n", " print(\"ERROR. You have broken the Hamiltonian computation!\")\n", " print(\"Hreal_trusted was \",Hreal)\n", " print(\"...and Hreal is now \", Hreal_temp)\n", " sys.exit(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 19: Output this notebook to $\\LaTeX$-formatted PDF file \\[Back to [top](#toc)\\]\n", "$$\\label{latex_pdf_output}$$\n", "\n", "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\n", "[Tutorial-SEOBNR_Documentation.pdf](Tutorial-SEOBNR_Documentation.pdf) (Note that clicking on this link may not work; you may need to open the PDF file through another means.)" ] }, { "cell_type": "code", "execution_count": 101, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:24:22.665086Z", "iopub.status.busy": "2021-03-07T17:24:22.662741Z", "iopub.status.idle": "2021-03-07T17:24:24.144048Z", "shell.execute_reply": "2021-03-07T17:24:24.145059Z" }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[NbConvertApp] WARNING | pattern 'Tutorial-SEOBNR_Documentation.ipynb' matched no files\n", "Created Tutorial-SEOBNR_Documentation.tex, and compiled LaTeX file to PDF\n", " file Tutorial-SEOBNR_Documentation.pdf\n" ] } ], "source": [ "import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n", "cmd.output_Jupyter_notebook_to_LaTeXed_PDF(\"Tutorial-SEOBNR_Documentation\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.1" } }, "nbformat": 4, "nbformat_minor": 4 }