analysis
analysis.py is a Python routine that contains functions used in the analyses of potential detection of GW signals by space-based GW detectors (LISA or Taiji).
Currently part of the cosmoGW code:
https://github.com/cosmoGW/cosmoGW/ https://github.com/cosmoGW/cosmoGW/blob/main/src/cosmoGW/analysis.py
Note
For full documentation, visit Read the Docs.
To use it, first install cosmoGW:
pip install cosmoGW
Dates
Created: 01/12/2021
Updated: 21/08/2025 (release cosmoGW 1.0: https://pypi.org/project/cosmoGW)
References
[RoperPol:2022iel]: A. Roper Pol, C. Caprini, A. Neronov, D. Semikoz, “The gravitational wave signal from primordial magnetic fields in the Pulsar Timing Array frequency band,” Phys. Rev. D 105, 123502 (2022), arXiv:2201.05630.
[RoperPol:2023bqa]: A. Roper Pol, A. Neronov, C. Caprini, T. Boyer, D. Semikoz, “LISA and γ-ray telescopes as multi-messenger probes of a first-order cosmological phase transition,” arXiv:2307.10744 (2023).
- cosmoGW.analysis.analysis_LISA_alphabeta(s, alphas, betas, vws, TTs, eps_turb=1.0, turb=True, cs2=0.3333333333333333, quiet=True, a_sw=3, b_sw=1, c_sw=3, alp1_sw=0, alp2_sw=0, corrRs=True, expansion=True, Nsh=1.0, model_efficiency='fixed_value', OmGW_tilde=0.01, bs_HL_eff=20, model_K0='Espinosa', bs_k1HL=40, model_decay='sound_waves', interpolate_HL_decay=True, b=0, model_shape='sw_LISA', strength='weak', interpolate_HL_shape=False, interpolate_HL_n3=False, N_turb=2, a_turb=5, b_turb=0.6666666666666666, alp_turb=0.35294117647058826, tdecay='eddy', tp='both', alpPi_turb=2.15, fPi_turb=2.2, bPi_turb=3, h0=1.0, Neff=3, interf='LISA', Tobs=4)
Compute the signal-to-noise ratio (SNR) for gravitational wave backgrounds from sound waves and turbulence in a first-order cosmological phase transition, for a range of phase transition and detector parameters, comparing the sensitivity of LISA with 4 years of observations (and no foregrounds).
This function calculates the GW spectrum for sound waves and turbulence, redshifts it to today, and computes the SNR for a given detector sensitivity. It supports vectorized input for all physical parameters, automatically adapting the output shape to match scalar or array inputs.
Parameters
- sarray_like
Array of normalized wave numbers, \(s = f R_\ast\).
- alphasfloat or array_like
Strength of the phase transition \(\alpha\) (latent heat fraction).
- betasfloat or array_like
Nucleation rate of the phase transition \(\beta/H_\ast\).
- vwsfloat or array_like
Bubble wall velocity \(v_w\).
- TTsfloat, array_like, or astropy.units.Quantity
Temperature(s) of the phase transition (can be MeV, GeV, etc).
- eps_turbfloat or array_like, optional
Fraction of kinetic energy converted to turbulence (default: 1).
- turbbool, optional
If True, include turbulence contribution (default: True).
- cs2float, optional
Square of the speed of sound (default: 1/3).
- quietbool, optional
Suppress verbose output (default: True).
- a_sw, b_sw, c_swfloat, optional
Spectral slopes for spectral shape of GWs from sound waves (default 3, 1, 3).
- alp1_sw, alp2_swfloat, optional
Additional shape parameters for sound waves (default are the reference values for model_shape=`sw_LISA`, see GW_templates.OmGW_spec_sw).
- corrRsbool, optional
Correct Rstar beta with \(\max(v_w, c_s)\) (default: True).
- expansionbool, optional
Include Universe expansion (default: True).
- Nshfloat, optional
Duration of the sound waves sourcing in number of shock formation times (default: 1).
- model_efficiencystr, optional
Model for GW production efficiency (default: ‘fixed_value’, other option is ‘higgsless’).
- OmGW_tildefloat, optional
Reference amplitude for GW spectrum (default: 1e-2).
- bs_HL_eff, bs_k1HLint, optional
Box size parameters for Higgsless simulation interpolation for UV and IR quantities (default: 20, 40), used if model_efficiency=’higgsless’, model_decay=’decay’ with interpolate_HL_decay True, or model_shape=’sw_HL_new with interpolate_HL_shape True.
- model_K0str, optional
Model for kinetic energy ratio (‘Espinosa’ or ‘higgsless’).
- model_decaystr, optional
Model for decay of the source (‘sound_waves’, ‘decay’).
- interpolate_HL_decaybool, optional
Interpolate decay parameter from HL simulations if model_decay=’decay’ (default: True).
- bfloat, optional
Decay parameter (default: 0).
- model_shapestr, optional
Spectral shape model for sound waves (default: ‘sw_LISA’).
- strengthstr, optional
Strength regime for HL shape interpolation (default: ‘weak’, used when model_shape=’sw_HL_new’ and interpolate_HL_shape False).
- interpolate_HL_shapebool, optional
Interpolate HL shape (default: False, used when model_shape=’sw_HL_new’).
- interpolate_HL_n3bool, optional
Interpolate HL n3 slope parameter (default: False, used when model_shape=’sw_HL_new’).
- N_turbint, optional
Ratio between decay time and effective source duration for turbulence production of GWs.
- a_turb, b_turb, alp_turbfloat, optional
Spectral fit parameters (slopes and smoothness) for turbulence (default 5, 2/3, 2).
- tdecaystr, optional
Determines finite duration in the turbulence model (default ‘eddy’).
- tpstr, optional
Type of turbulence source (‘both’, ‘magnetic’, ‘kinetic’).
- alpPi_turb, fPi_turb, bPi_turbfloat, optional
Parameters for the anisotropic stress fit for turbulence.
- h0float, optional
Hubble rate at present time (default 1), such that \(H_0 = 100\) km/s/Mpc.
- Neffint, optional
Effective number of neutrino species (default: 3).
- interfstr, optional
Detector/interferometer name (default: ‘LISA’).
- Tobsfloat, optional
Observation time in years (default: 4 years).
Returns
- SNRndarray
Signal-to-noise ratio for each parameter combination. The output shape adapts to the input: axes corresponding to scalar inputs are squeezed. For example, if all inputs are arrays, shape is (len(eps_turb), len(TTs), len(vws), len(alphas), len(betas)). If some inputs are scalars, those axes are removed.
References
RoperPol:2022iel, RoperPol:2023bqa