sigway.integrators¶
The integrator performs the double integral over the two internal momenta \(s\in[0,1]\) and \(t\in[0,\infty)\).
Base class¶
sigway.integrators.Integrator ¶
Abstract base class for SIGW double-integral strategies.
An integrator performs the numerical double integral over the two rescaled internal momenta \(s \in [0, 1]\) and \(t \in [0, \infty)\) that defines the scalar-induced gravitational-wave tensor power spectrum. Given a Kernel (which encodes the radiation-transfer physics) and a primordial scalar power spectrum ScalarPerturbations, it returns the un-normalised tensor power spectrum on a wavenumber grid.
The global normalisation prefactor (kernel.norm), the conversion between
frequency and wavenumber, and any output upsampling are applied by
OmegaGW after calling this method.
Subclasses must override integrate.
Methods:
| Name | Description |
|---|---|
integrate |
Evaluate the un-normalised tensor power spectrum on |
Simpson quadrature¶
sigway.integrators.SimpsonIntegrator ¶
Bases: Integrator
2-D Simpson quadrature over the \((s, t)\) momentum plane (Gaussian spectrum).
This integrator performs the double integral that enters the scalar-induced gravitational-wave energy density. It assumes a Gaussian primordial curvature perturbation, so the integrand contains the product of two copies of the dimensionless scalar power spectrum \(\mathcal{P}_\zeta\):
where the dimensionless internal momenta are defined by
and \(J(t, s)\) is the Jacobian of the \((u, v) \to (s, t)\) change of variables (see polynomial).
The integral is discretised on user-supplied grids for \(s\) and \(t\) and evaluated with composite Simpson quadrature. Grid choice matters physically: the integrand peaks near \(t \approx 1\), so the \(t\)-grid should be linear below 1 (to resolve the peak) and geometric above 1 (to cover the slowly-decaying tail efficiently). A few hundred points total is typically sufficient.
If the Kernel declares a resonant feature at a
specific value \(t_\mathrm{res}\) (kernel.resonant_t is set), an
additional 1-D Simpson integral over \(s\) at that fixed \(t\) slice is
computed and added to the 2-D result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s
|
array_like or callable
|
Quadrature nodes for the momentum variable \(s \in [0, 1]\).
May be a fixed 1-D array or a callable |
required |
t
|
array_like or callable
|
Quadrature nodes for the momentum variable \(t \in [0, \infty)\).
May be a fixed 1-D array, a 2-D array of shape |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
s |
array_like or callable
|
The \(s\)-grid as supplied at construction time. |
t |
array_like or callable
|
The \(t\)-grid as supplied at construction time. |
Methods:
| Name | Description |
|---|---|
integrate |
Evaluate the un-normalised tensor power spectrum on |
Examples:
Build a SimpsonIntegrator with a hybrid \(t\)-grid that is linear near the
integrand peak (\(t \lesssim 1\)) and geometric in the tail (\(t \gtrsim 1\)):
>>> import jax.numpy as jnp
>>> from sigway.integrators import SimpsonIntegrator
>>> s = jnp.linspace(0.0, 1.0, 10)
>>> t = jnp.concatenate([jnp.linspace(1e-5, 0.999, 200),
... jnp.geomspace(1.0, 1e3, 800)])
>>> integ = SimpsonIntegrator(s, t) # or pass s=, t= straight to OmegaGW
integrate ¶
Evaluate the un-normalised tensor power spectrum \(\overline{I^2}(k)\).
Resolves the \(s\) and \(t\) grids (evaluating them as callables if needed), then performs the composite Simpson quadrature over both momentum variables and returns the result on the requested wavenumber grid.
For analytic primordial spectra (pzeta.jittable = True) the
quadrature is compiled at first call and reused for subsequent calls
with
different physical parameters at the same array shapes, making parameter
scans fast. Spectra computed by the Mukhanov-Sasaki solver run the same
quadrature without compilation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kernel
|
Kernel
|
A Kernel instance providing the
radiation-transfer function \(\overline{I^2}(t, s, k)\). If the
kernel has a resonant feature it additionally provides
|
required |
pzeta
|
ScalarPerturbations
|
The primordial scalar power spectrum
\(\mathcal{P}_\zeta(k)\). Its |
required |
kvec
|
(array_like, shape(nk))
|
Wavenumber grid at which \(\overline{I^2}(k)\) is evaluated.
Units must be consistent with those used by |
required |
theta_pz
|
tuple
|
Physical parameter values for the scalar power spectrum (e.g. amplitude, tilt, peak scale). |
required |
theta_k
|
tuple
|
Physical parameter values for the kernel (e.g. equation-of-state parameter \(w\)). |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(nk))
|
Un-normalised tensor power spectrum values \(\overline{I^2}(k)\) at
each wavenumber in |