Computing Remnant Properties from NRHybSur3dq8 Waveforms
This notebook generates waveforms using the NRHybSur3dq8 surrogate model, computes remnant properties with gw_remnant, and compares against the NRSur3dq8Remnant fit.
Requires pip install gw_remnant[surrogates].
Contact: Tousif Islam [tousifislam24@gmail.com]
1. Setup
[1]:
import warnings
warnings.filterwarnings("ignore", "Wswiglal-redir-stdio")
import numpy as np
import gwsurrogate
import surfinBH
import gwtools
from gw_remnant.gw_remnant_calculator import GWRemnantCalculator
from gw_remnant.gw_utils import waveform_generator
lal.MSUN_SI != Msun
[2]:
sur = gwsurrogate.LoadSurrogate('NRHybSur3dq8')
fit = surfinBH.LoadFits('NRSur3dq8Remnant')
Loaded NRHybSur3dq8 model
Loaded NRSur3dq8Remnant fit.
[3]:
def compare_remnants(calc, fit, q, chi1, chi2):
"""Print a side-by-side comparison of gw_remnant vs NRSur3dq8Remnant."""
mf, chif, vf, mf_err, chif_err, vf_err = fit.all(q, chi1, chi2)
print(f"{'Property':<25} {'gw_remnant':>15} {'NRSur3dq8Remnant':>20}")
print("-" * 62)
print(f"{'Remnant mass [M]':<25} {calc.remnant_mass:>15.6f} {mf:>20.6f}")
print(f"{'Remnant spin (z)':<25} {calc.remnant_spin:>15.6f} {chif[2]:>20.6f}")
print(f"{'Remnant |chi|':<25} {np.linalg.norm(calc.remnant_spin_vector):>15.6f} {np.linalg.norm(chif):>20.6f}")
print(f"{'Kick velocity [c]':<25} {calc.remnant_kick:>15.6f} {np.linalg.norm(vf):>20.6f}")
2. Non-spinning binary (q = 4)
[4]:
q = 4.0
chi1 = [0, 0, 0]
chi2 = [0, 0, 0]
times, h = waveform_generator.generate_nrhybsur3dq8(sur, q=q, chi1=chi1, chi2=chi2)
NRHybSur3dq8 time grid: [-29350.61, 135.49] M
Output time grid: [-5000.00, 49.90] M
[5]:
calc_ns = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
calc_ns.print_remnants()
==================================================
Remnant Properties Summary
==================================================
Mass ratio : 4.000
Initial mass : 1.00000000 M
Total energy radiated : 0.01679011 M
Peak luminosity : 0.00036349
Remnant mass : 0.97813243 M
Remnant spin (dimensionless) : 0.47088134
Remnant spin vector (x,y,z) : (0.00000000, 0.00000000, 0.47088134)
Remnant kick velocity : 0.00049463 c
Remnant kick velocity : 148.29 km/s
Remnant kick vector (x,y,z) : (0.00008521, 0.00048724, 0.00000000) c
Remnant displacement (x,y,z) : (0.00189779, 0.01756277, 0.00000000) M
==================================================
/var/folders/9k/xlxjfz4d2cz1063spty94p0r0000gq/T/ipykernel_23610/3385016684.py:1: UserWarning: Tips: If you are using NR waveforms, ensure that they do not contain junk radiation, as that is known to corrupt the remnant property estimation.
calc_ns = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
[6]:
compare_remnants(calc_ns, fit, q, chi1, chi2)
Property gw_remnant NRSur3dq8Remnant
--------------------------------------------------------------
Remnant mass [M] 0.978132 0.977807
Remnant spin (z) 0.470881 0.471630
Remnant |chi| 0.470881 0.471630
Kick velocity [c] 0.000495 0.000510
3. Aligned-spin binary (q = 3)
[7]:
q = 3.0
chi1 = [0, 0, 0.5]
chi2 = [0, 0, 0.3]
times, h = waveform_generator.generate_nrhybsur3dq8(sur, q=q, chi1=chi1, chi2=chi2)
NRHybSur3dq8 time grid: [-27121.80, 135.30] M
Output time grid: [-5000.00, 49.90] M
[8]:
calc_al = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
calc_al.print_remnants()
==================================================
Remnant Properties Summary
==================================================
Mass ratio : 3.000
Initial mass : 1.00000000 M
Total energy radiated : 0.03452028 M
Peak luminosity : 0.00072088
Remnant mass : 0.95937439 M
Remnant spin (dimensionless) : 0.76174956
Remnant spin vector (x,y,z) : (0.00000000, 0.00000000, 0.76174956)
Remnant kick velocity : 0.00022711 c
Remnant kick velocity : 68.09 km/s
Remnant kick vector (x,y,z) : (-0.00006610, 0.00021728, 0.00000000) c
Remnant displacement (x,y,z) : (-0.00279605, 0.01463853, 0.00000000) M
==================================================
/var/folders/9k/xlxjfz4d2cz1063spty94p0r0000gq/T/ipykernel_23610/1722731926.py:1: UserWarning: Tips: If you are using NR waveforms, ensure that they do not contain junk radiation, as that is known to corrupt the remnant property estimation.
calc_al = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
[9]:
compare_remnants(calc_al, fit, q, chi1, chi2)
Property gw_remnant NRSur3dq8Remnant
--------------------------------------------------------------
Remnant mass [M] 0.959374 0.959083
Remnant spin (z) 0.761750 0.763491
Remnant |chi| 0.761750 0.763491
Kick velocity [c] 0.000227 0.000223
4. Anti-aligned-spin binary (q = 2)
[10]:
q = 2.0
chi1 = [0, 0, 0.5]
chi2 = [0, 0, -0.5]
times, h = waveform_generator.generate_nrhybsur3dq8(sur, q=q, chi1=chi1, chi2=chi2)
NRHybSur3dq8 time grid: [-22204.19, 135.11] M
Output time grid: [-5000.00, 49.90] M
[11]:
calc_aa = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
calc_aa.print_remnants()
==================================================
Remnant Properties Summary
==================================================
Mass ratio : 2.000
Initial mass : 1.00000000 M
Total energy radiated : 0.03967582 M
Peak luminosity : 0.00092379
Remnant mass : 0.95352851 M
Remnant spin (dimensionless) : 0.74837908
Remnant spin vector (x,y,z) : (0.00000000, 0.00000000, 0.74837908)
Remnant kick velocity : 0.00030504 c
Remnant kick velocity : 91.45 km/s
Remnant kick vector (x,y,z) : (0.00029094, -0.00009168, 0.00000000) c
Remnant displacement (x,y,z) : (0.01533150, -0.00358134, 0.00000000) M
==================================================
/var/folders/9k/xlxjfz4d2cz1063spty94p0r0000gq/T/ipykernel_23610/2141681472.py:1: UserWarning: Tips: If you are using NR waveforms, ensure that they do not contain junk radiation, as that is known to corrupt the remnant property estimation.
calc_aa = GWRemnantCalculator(time=times, h_dict=h, q=q, chi1=chi1, chi2=chi2)
[12]:
compare_remnants(calc_aa, fit, q, chi1, chi2)
Property gw_remnant NRSur3dq8Remnant
--------------------------------------------------------------
Remnant mass [M] 0.953529 0.953202
Remnant spin (z) 0.748379 0.750797
Remnant |chi| 0.748379 0.750797
Kick velocity [c] 0.000305 0.000335
[ ]: