pybhpt: Python Library for Kerr Perturbations
- pybhpt is an open-source Python library for first-order black-hole perturbation theory that computes waveforms and invariant quantities for generic eccentric and precessing Kerr orbits.
- It employs a frequency-domain framework to solve the Teukolsky equation using spectral source integration, MST series, and Hertz potential–based metric reconstruction.
- The library links self-force calculations with conservative Hamiltonian data, enabling cross-framework comparisons among effective-one-body and post-Newtonian descriptions.
Searching arXiv for papers on pybhpt and related black-hole perturbation theory. pybhpt is an open, frequency-domain Python library that implements first-order, in the small mass ratio , black-hole perturbation theory for a point particle on generic eccentric, precessing bound orbits in Kerr spacetime. It solves the Teukolsky equation for the maximal-spin Newman–Penrose curvature scalars and , reconstructs the metric perturbation in multiple radiation-gauge variants, computes the generalized redshift invariant, and, through a recent Hamiltonian formulation, supplies the conservative first-order Hamiltonian needed for first post-adiabatic waveform generation. In later work, pybhpt also serves as a benchmark and integration target for alternative frequency-domain Kerr solvers based on a unified confluent-Heun framework (Nasipak, 10 Jul 2025, Chen et al., 10 May 2026).
1. Problem domain and physical content
pybhpt is designed for first-order self-force and waveform calculations in the small-mass-ratio limit for a point particle on generic eccentric, precessing, bound Kerr geodesics. The library computes frequency-domain solutions for the Weyl scalars with spin weight and with spin weight , assembles both horizon-side and infinity-side extended homogeneous solutions, reconstructs radiation-gauge metric perturbations , and evaluates the generalized redshift invariant along eccentric, precessing Kerr orbits. Through the identification of the interaction Hamiltonian with the time-averaged first-order redshift correction, it provides conservative Hamiltonian data for waveforms with conservative self-force effects. The code reaches near-extremal spins, with up to 0, eccentricities up to 1, and inclinations up to 2 (Nasipak, 10 Jul 2025).
The implemented quantities sit at the interface of several relativistic-perturbation problems. On the dissipative side, pybhpt computes fluxes at infinity and at the horizon from 3 modes. On the conservative side, it computes 4, which directly determines the first-order conservative Hamiltonian. This places the library in a position to connect self-force calculations with effective-one-body and post-Newtonian descriptions. A plausible implication is that pybhpt is useful not only for flux production but also for invariant-based calibration problems across approximation schemes.
2. Frequency-domain Kerr perturbation framework
pybhpt adopts a null tetrad aligned with Kerr’s principal null directions and, in the Geroch–Held–Penrose formalism, uses the Kinnersley tetrad. At linear order, the gauge-invariant curvature information is encoded by the maximal spin-weight scalars 5 and 6, related to the metric perturbation by linear differential operators. The rescaled scalars satisfy the Teukolsky equations with spin 7, sourced by the point-particle stress-energy tensor.
For bound motion, the frequency spectrum is discrete:
8
with integers 9, 0, and 1. For equatorial motion, 2; for circular or spherical motion, 3. The radial Teukolsky equation is
4
with
5
Retarded boundary conditions are imposed at the horizon and at null infinity using homogeneous solutions 6 and 7 normalized by their asymptotics. The amplitudes are computed through Green’s-function integrals,
8
with
9
and
0
Extended homogeneous solutions are then assembled as
1
These formulas define the core frequency-domain structure on which the remainder of the library is built (Nasipak, 10 Jul 2025).
The orbital sector is parameterized either by 2 or by orbital elements 3. Introducing Mino time 4 via 5, the motion separates into librations in 6 and 7 and linear drifts in 8 and 9, with fundamental coordinate-time frequencies
0
This structure is the basis for the spectral source integration used later in the code.
3. Metric reconstruction and gauge structure
In vacuum regions, pybhpt reconstructs the metric perturbation from Hertz potentials using Wald’s adjoint-operator identity. The library implements four reconstruction formalisms. Two are the Chrzanowski–Cohen–Kegeles–Wald reconstructions from either 1 or 2, leading to ingoing radiation gauge and outgoing radiation gauge. Two build on Aksteiner–Andersson–Bäckdahl identities and use both 3 and 4; the paper labels these symmetric radiation gauge and antisymmetric radiation gauge.
The reconstructed fields are
5
6
7
8
IRG satisfies 9 and 0; ORG satisfies 1 and 2. SRG and ARG are traceless combinations rather than standard gauges. The Aksteiner–Andersson–Bäckdahl identity gives
3
with 4 in Boyer–Lindquist coordinates. ARG requires time derivatives of Hertz potentials, and static modes with 5 are excluded from ARG in this work (Nasipak, 10 Jul 2025).
For point particles, the spacetime is divided into two vacuum domains separated by the worldline. Reconstruction is performed on each side, and radiation-gauge reconstructions are glued into a no-string solution. Physical solutions also require stationary-axisymmetric completion terms,
6
For bound geodesics,
7
The completed solution in each domain and in a target gauge 8 is
9
This organization is central to pybhpt’s redshift extraction, because continuity of 0 across the worldline is the key practical condition for obtaining the regularized invariant.
4. Generalized redshift invariant and Hamiltonian interpretation
The generalized redshift invariant is defined in the effective metric 1 by 2. Expanding,
3
The generalized redshift is the infinite coordinate-time average at fixed frequencies 4, primary mass 5, secondary mass 6, and spin 7:
8
For bound biperiodic motion, the averaging is written as phase-space integrals in 9:
0
1
The resulting quantity is described as a quasi-invariant across physically reasonable gauges (Nasipak, 10 Jul 2025).
Regularization uses a mode-sum compatible with locally Lorenz singular structure:
2
In practice, the leading locally Lorenz parameter 3 suffices to render the sum convergent, while pybhpt accelerates convergence by fitting the large-4 tail to determine effective higher-order 5. For generic Kerr orbits,
6
with 7 and 8 given in terms of Kerr metric functions and constants of motion, and 9 the complete elliptic integral.
The Hamiltonian connection is
0
with actions 1, and
2
Thus pybhpt provides 3, from which conservative equations of motion follow through Hamilton’s equations. This is the library’s main link to waveform generation with conservative 4 effects and to cross-framework comparisons involving self-force, EOB, and PN descriptions.
5. Software organization and computational workflow
pybhpt is organized into domain-specific modules that follow the perturbative pipeline from geodesic motion to radiative and conservative observables (Nasipak, 10 Jul 2025).
| Module | Role |
|---|---|
geo |
Geodesic functions, turning points, and fundamental frequencies; spectral evaluation of 5 and 6 |
swsh |
Spin-weighted spheroidal harmonics via spherical expansions; coupling coefficients 7 and eigenvalues 8 |
radial |
Homogeneous Teukolsky ODEs with Zenginoğlu stabilization; Teukolsky–Starobinsky mappings between 9 and 0; monodromy-based 1 optional |
teuk |
Inhomogeneous amplitudes 2 via SSI; robust error tracking and thresholds |
hertz |
Mode functions 3 using identities; angular and radial derivatives for reconstruction |
metric |
Analytic reconstruction coefficients for applying GHP operators to Hertz modes; assembling 4 |
redshift |
Coefficients to form 5, worldline projection, mode-sum assembly, and regularization/fitting to extract 6 |
flux |
GW fluxes at infinity and horizon built from 7 modes |
The library’s typical workflow is geodesics 8 9 modes 00 Hertz potentials 01 metric reconstruction 02 03 04 05 06 07. In the angular sector, spin-weighted spheroidal harmonics are expanded in spin-weighted spherical harmonics,
08
with the coupling coefficients obtained from a five-term recurrence recast as an eigenvalue problem. In the radial sector, homogeneous solutions are integrated using Zenginoğlu’s transformation and a Prince–Dormand 09 method with adaptive stepping from the GNU Scientific Library. Coulomb or Heun boundary series supply initial data, and the complementary spin sector is rebuilt through reduced Teukolsky–Starobinsky identities.
The source amplitudes are evaluated by spectral source integration. The source takes a distributional form with up to two 10-derivatives,
11
where
12
Hertz potentials are then built in mode-sum form, reconstruction operators are applied in a spherical-harmonic basis, and the worldline quantity 13 is regularized and averaged.
6. Convergence, validation, and limitations
Away from the worldline, convergence is exponential. Near the worldline, the radiation gauges have the expected singular structure. IRG, ORG, and SRG have the expected 14 singularity near the particle, producing 15 as 16. ARG modes are more singular, with 17–18 behavior in half-string form, reflecting an 19–20 divergence, and ARG excludes static modes with 21. SRG inherits the “worst” asymptotic behavior of IRG and ORG at boundaries but remains 22 near the particle (Nasipak, 10 Jul 2025).
The main numerical limitation identified in the paper comes from spectral source integration at very high mode numbers. For large 23, 24, and 25, especially at high eccentricity and small 26, oscillatory cancellation limits accuracy; pybhpt drops modes when the relative error exceeds a threshold. This limits accuracy for 27 near the innermost stable orbit. The paper reports that eccentric equatorial redshift values agree with van de Meent–Shah (2015) at the 28–29 level across gauges. It also reports new precessing results with spins up to 30 and, for near-extremal Kerr, the first observation of negative 31 near the ISCO, implying a surface in 32 where the interaction Hamiltonian vanishes.
These features are important for interpretation. The gauge-dependent local fields remain singular in the expected ways, but the regularized redshift invariant and Hamiltonian data retain their utility. A plausible implication is that pybhpt’s most robust outputs are invariant or quasi-invariant quantities assembled after reconstruction and regularization, rather than raw local metric components near the particle.
7. Relation to later HeunC-based solvers
A later study on generic Kerr-orbit fluxes describes pybhpt as implementing a hybrid semi-analytical/semi-numerical pipeline: MST series for the radial Teukolsky equation, spectral methods for spin-weighted spheroidal harmonics, and Frobenius expansions of HeunC for boundary data, together with adaptive Runge–Kutta integration and spectral source techniques. That work identifies three typical challenges for pybhpt-style frequency-domain calculations: computational overhead in determining auxiliary parameters such as MST’s renormalized angular momentum 33 and high-accuracy angular eigenvalues, stiffness and loss of accuracy for strong-field or high-frequency modes, and sensitivity of oscillatory source integrals to grid resolution (Chen et al., 10 May 2026).
The unified confluent-Heun framework reformulates both the angular and radial Teukolsky equations directly as confluent Heun equations and computes global solutions via Motygin’s hybrid analytic-continuation algorithm. In the benchmarks reported there, for the total radiative flux summed over 34 low-order modes, the HeunC framework achieves relative errors of order 35, with HeunC runtime 36–37 s versus pybhpt 38–39 s, corresponding to a 40–41 speedup. For a highly oscillatory single-mode case, HeunC converges in 42 ms, while pybhpt’s uniform trapezoidal rule over 43 took 44 ms with larger error. The same study describes integration into existing pipelines, including pybhpt, as straightforward: reuse orbit and frequency infrastructure, replace MST or Runge–Kutta radial propagation with HeunC plus connection coefficients, and adopt adaptive bi-power mapping quadrature.
This comparison places pybhpt in a broader methodological lineage. It remains a complete frequency-domain Python pipeline for Kerr perturbation theory, metric reconstruction, redshift regularization, and conservative Hamiltonian data, while later HeunC-based work suggests a path toward faster and more stable flux backends for strong-field and highly oscillatory regimes.