### Install all recommended dependencies Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the package with all recommended software dependencies. ```bash pip install '.[dev, testing, extended]' ``` -------------------------------- ### Install pybhpt with all recommended software Source: https://pybhpt.readthedocs.io/en/latest/installation.html Install pybhpt with all recommended software dependencies. ```bash pip install '.[dev, testing, extended]' ``` -------------------------------- ### Install pybhpt from source Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the package from the source directory using pip. ```bash pip install . ``` -------------------------------- ### Install basic development dependencies Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the package with basic development and testing dependencies. ```bash pip install '.[dev, testing]' ``` -------------------------------- ### Example output of total fluxes Source: https://pybhpt.readthedocs.io/en/latest/notebooks/fluxes.html Example output showing the total fluxes for the circular Kerr example. ```text Total fluxes (E, Lz, Q): [0.00122957 0.01496423 0. ] ``` -------------------------------- ### Install pybhpt with basic development dependencies Source: https://pybhpt.readthedocs.io/en/latest/installation.html Install pybhpt with the basic development and testing dependencies. ```bash pip install '.[dev, testing]' ``` -------------------------------- ### Install compiler on Linux Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the necessary compiler for Linux using conda. ```bash conda install gcc_linux-64 gxx_linux-64 ``` -------------------------------- ### Install Jupyter dependencies Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install ipykernel and matplotlib for running code in a Jupyter notebook. ```bash pip install ipykernel matplotlib ``` -------------------------------- ### Example output of flux components Source: https://pybhpt.readthedocs.io/en/latest/notebooks/fluxes.html Example output showing horizon, infinity, and total fluxes for the mode. ```text [-3.606222842872166e-36, -3.5075219557527026e-35, -1.979059439027494e-34] [6.753687090778148e-25, 6.56884135710292e-24, 3.7063566971910574e-23] [6.753687090742086e-25, 6.568841357067845e-24, 3.706356697171267e-23] ``` -------------------------------- ### Install compiler on macOS arm/silicon Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the necessary compiler for macOS arm/silicon using conda. ```bash conda install clang_osx-arm64 clangxx_osx-arm64 ``` -------------------------------- ### Install pybhpt with pip Source: https://pybhpt.readthedocs.io/en/latest/_sources/index.md Install the latest tagged release of pybhpt from PyPI using pip. This command is for macOS and 64-bit Linux wheel packages. ```bash python3 -m pip install pybhpt ``` -------------------------------- ### Import pybhpt and matplotlib Source: https://pybhpt.readthedocs.io/en/latest/_sources/notebooks/waveform.ipynb Imports the pybhpt library and matplotlib for plotting. This is the initial setup for the notebook. ```python import pybhpt import matplotlib.pyplot as plt import matplotlib as mpl ``` -------------------------------- ### Run unit tests with pytest Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Run the unit tests to ensure the package installed properly. ```bash pytest . ``` -------------------------------- ### Run pybhpt unit tests with pytest Source: https://pybhpt.readthedocs.io/en/latest/installation.html Run the unit tests to ensure the package installed properly. ```bash pytest . ``` -------------------------------- ### Import pybhpt.flux and dependencies Source: https://pybhpt.readthedocs.io/en/latest/notebooks/fluxes.html Imports TeukolskyMode, FluxMode, KerrGeodesic, numpy, and matplotlib for the flux tutorial. ```python from pybhpt.teuk import TeukolskyMode from pybhpt.flux import FluxMode from pybhpt.geo import KerrGeodesic import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl ``` -------------------------------- ### KerrGeodesic.__init__ Source: https://pybhpt.readthedocs.io/en/latest/_modules/pybhpt/geo.html Initializes a KerrGeodesic object with the given orbital parameters. Validates the black hole spin, sample count, and parametrization, then constructs the underlying Cython geodesic and computes various orbital quantities. ```APIDOC ## KerrGeodesic.__init__ ### Description Initializes a KerrGeodesic object with the given orbital parameters. Validates the black hole spin, sample count, and parametrization, then constructs the underlying Cython geodesic and computes various orbital quantities. ### Method Constructor ### Signature `KerrGeodesic(a, p, e, x, nsamples=256, parametrization="darwin")` ### Parameters - **a** (float) - Required - The black hole spin parameter. Must be in the range [0, 1]. - **p** (float) - Required - The semilatus rectum of the orbit. - **e** (float) - Required - The eccentricity of the orbit. - **x** (float) - Required - The inclination of the orbit. - **nsamples** (int) - Optional - The number of samples to use for the geodesic. Must be a power of two. Default is 256. - **parametrization** (str) - Optional - The phase variable used to sample the geodesic and source. "mino" (default) samples uniformly in the Mino phases (q_r, q_theta); "darwin" (alias "psi") samples uniformly in the relativistic anomalies (psi radial, chi polar), which resolves high-eccentricity / near-separatrix orbits more efficiently. Both yield identical mode amplitudes. Default is "darwin". ### Attributes - **blackholespin** (float) - The black hole spin parameter. - **semilatusrectum** (float) - The semilatus rectum of the orbit. - **eccentricity** (float) - The eccentricity of the orbit. - **inclination** (float) - The inclination of the orbit. - **orbitalenergy** (float) - The orbital energy En of the orbit. - **orbitalangularmomentum** (float) - The z-component of the orbital angular momentum Lz of the orbit. - **carterconstant** (float) - The Carter constant Qc of the orbit. - **orbitalconstants** (numpy.ndarray) - The orbital constants (En, Lz, Qc) of the orbit. - **radialroots** (numpy.ndarray) - The roots of the radial equation. - **polarroots** (numpy.ndarray) - The roots of the polar equation. - **minofrequencies** (numpy.ndarray) - The orbital frequencies with respect to Mino time. - **timefrequencies** (numpy.ndarray) - The orbital frequencies with respect to the time coordinate. - **frequencies** (numpy.ndarray) - The (coordinate time) frequencies of the orbit. - **carterfrequencies** (numpy.ndarray) - The frequencies for computing Carter constant fluxes. - **timeradialfourier** (numpy.ndarray) - The Fourier coefficients of coordinate time with respect to the radial Mino phase. - **timepolarfourier** (numpy.ndarray) - The Fourier coefficients of coordinate time with respect to the polar Mino phase. - **radialfourier** (numpy.ndarray) - The Fourier coefficients of radial position with respect to the radial Mino phase. - **polarfourier** (numpy.ndarray) - The Fourier coefficients of polar position with respect to the polar Mino phase. - **azimuthalradialfourier** (numpy.ndarray) - The Fourier coefficients of azimuthal position with respect to the radial Mino phase. - **azimuthalpolarfourier** (numpy.ndarray) - The Fourier coefficients of azimuthal position with respect to the polar Mino phase. ### Exceptions - **ValueError** - If `a` is not in the range [0, 1]. - **ValueError** - If `nsamples` is not a power of 2. - **ValueError** - If the parametrization is unknown. - **ValueError** - If the orbital parameters do not represent a valid bound non-plunging orbit. ### Example ```python from pybhpt.geo import KerrGeodesic geo = KerrGeodesic(a=0.5, p=10.0, e=0.2, x=0.8) ``` ``` -------------------------------- ### Initialize boost submodule Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Initialize and update the boost submodule under extern/boost. ```bash git submodule update --init --recursive extern/boost ``` -------------------------------- ### Install Jupyter dependencies for pybhpt Source: https://pybhpt.readthedocs.io/en/latest/installation.html Install ipykernel and matplotlib for running pybhpt in Jupyter notebooks. ```bash pip install ipykernel matplotlib ``` -------------------------------- ### Build boost headers Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Build the Boost headers by running bootstrap.sh and b2 headers in the extern/boost directory. ```bash cd extern/boost chmod +x bootstrap.sh ./bootstrap.sh ./b2 headers ``` -------------------------------- ### Import pybhpt modules and dependencies Source: https://pybhpt.readthedocs.io/en/latest/_sources/notebooks/waveform.ipynb Loads TeukolskyMode, KerrGeodesic, SpinWeightedSpheroidalHarmonic, numpy, and matplotlib for the waveform computation. ```python from pybhpt.teuk import TeukolskyMode from pybhpt.geo import KerrGeodesic from pybhpt.swsh import SpinWeightedSpheroidalHarmonic import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl ``` -------------------------------- ### Install compiler on macOS Intel Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Install the necessary compiler for macOS Intel using conda. ```bash conda install clang_osx-64 clangxx_osx-64 ``` -------------------------------- ### Run all benchmarks Source: https://pybhpt.readthedocs.io/en/latest/_sources/performance/index.md Runs the full benchmark suite covering geodesic, swsh, radial, teuk, and flux computations. Use this command to reproduce the committed performance numbers on your own machine. ```bash python -m benchmarks.run all # geodesic, swsh, radial, teuk (+flux) ``` -------------------------------- ### Register Jupyter kernel Source: https://pybhpt.readthedocs.io/en/latest/_sources/installation.md Make the pybhpt-env environment accessible within Jupyter by installing a kernel. ```bash python -m ipykernel install --user --name=pybhpt-env ``` -------------------------------- ### Import pybhpt.swsh and dependencies Source: https://pybhpt.readthedocs.io/en/latest/_sources/notebooks/swsh.ipynb Imports SpinWeightedSpheroidalHarmonic and swsh_eigenvalue from pybhpt.swsh, along with numpy and matplotlib for numerical and plotting support. ```python from pybhpt.swsh import SpinWeightedSpheroidalHarmonic, swsh_eigenvalue import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl ```