abcmb.main module
- class abcmb.main.Model(user_species=None, **kwargs)[source]
Bases:
ModuleModel configuration and computation manager.
Creates instances of fluid species based on user input and organizes them for computation. Manages the full pipeline from background evolution through CMB power spectrum computation.
Attributes:
PEperturbations.PerturbationEvolverABCMB perturbations module
SSspectrum.SpectrumSolverABCMB spectrum module
RecModelhyrex.recomb_modelHyRex recombination module
specsdictA dictionary of run options (expected to be static)
species_listtupleA list of all fluids in the user cosmology
species_dictdictA dictionary containing the names of all fluids, in the same order as they appear in species_list.
PArthENoPE_CLASS_tableArrayA 2D table for interpolation of the helium-4 mass fraction based on the user’s input baryon density and Neff
thermo_model_DNefflinx.BackgroundModelA LINX background model for BBN thermodynamics
abundanceModellinx.AbundanceModelA LINX abundance model used for computing the helium-4 mass fraction given the user’s input baryon density, Neff, neutron lifetime, and nuclear reaction rates.
adjointdiffrax.adjointAdjoint mode for diffrax solves. Default is ForwardMode.
Methods:
__call__:Compute CMB angular power spectra
get_PTBG:Get perturbation table and background cosmology
get_BG:Get background cosmology
add_derived_parameters:Compute derived parameters
- get_BG(params: dict, pre_BG: BackgroundPreRecomb, recomb_output)[source]
Construct the full
Backgroundfrom pre-recomb + HyRex output.Selects the reionization model (z-input vs tau-input) via
lax.cond. NOT directly@eqx.filter_jit-decorated; called from inside_run_post_recomb(which is jit-wrapped).Parameters:
paramsdictCosmological parameters
pre_BGBackgroundPreRecombPre-recombination stage object.
recomb_outputtupleHyRex output
(xe, lna_xe, Tm, lna_Tm).
Returns:
background.Background
- get_BG_pre_recomb(params: dict)[source]
Pre-recomb stage: tabulate conformal time and bundle H, T, nH for recombination.
Parameters:
paramsdictCosmological parameters
Returns:
BackgroundPreRecomb
- get_PTBG(params: dict, pre_BG: BackgroundPreRecomb, recomb_output)[source]
Get perturbation table and full Background.
Constructs the post-recomb Background from
pre_BG+recomb_outputand runs the perturbation evolver.Parameters:
paramsdictCosmological parameters
pre_BGBackgroundPreRecombPre-recombination stage object.
recomb_outputtupleHyRex output
(xe, lna_xe, Tm, lna_Tm).
Returns:
- tuple
(PerturbationTable, Background)
- run_cosmology_abbr(params: dict)[source]
Compute CMB angular power spectra for given parameters.
Runs the full pipeline from background evolution through perturbation integration to CMB power spectrum computation.
Parameters:
paramsdictCosmological parameters (must already have derived keys).
Returns:
- Output
CMB power spectra and friends.
- class abcmb.main.Output(ClTT: array, ClTE: array, ClEE: array, Pk: array, l: array, k: array, BG: Background, PT: PerturbationTable, params: dict)[source]
Bases:
ModuleObject containing final and intermediate results from one cosmological simulation.
Attributes:
ClTTjnp.arrayTemperature-temperature power spectrum
ClTEjnp.arrayTemperature-polarization power spectrum
ClEEjnp.arrayPolarization-polarization power spectrum
Pkjnp.arrayMatter power spectrum
ljnp.arrayMultipoles l at which ClTT/ClTE/ClEE are output
kjnp.arrayWavenumbers k at with Pk is output
BGbackground.BackgroundBackground object containing functions like Hubble, recombination history, etc
PTperturbations.PerturbationTablePerturbation table including perturbations for all fluids
paramsdictComplete parameter dictionary including derived parameters