Skip to main content

bolojax

CI status Documentation PyPI version Python License

Bolometric sensitivity calculator for CMB instruments, built on JAX.

bolojax models the full radiative transfer chain of a CMB telescope and computes noise-equivalent temperature (NET), noise-equivalent power (NEP), and mapping speed. Because the compute path is written in pure JAX, the entire forward model is automatically differentiable, enabling gradient-based fitting, Fisher forecasting, MCMC sampling, and potentially inverse design.

History

This package descends from BoloCalc by Charlie Hill (arXiv:1806.04316), which was subsequently forked and restructured by Eric Charles at KIPAC/bolo-calc. bolojax is a fork of bolo-calc that replaces the configuration layer with pydantic and the numerical backend with JAX, equinox, and zodiax, making the sensitivity calculation JIT-compiled and fully differentiable.

What you can do

Task Before (BoloCalc / bolo-calc) With bolojax
Forward modeling Supported (YAML config only) Supported, JIT-compiled
Monte Carlo (posterior predictive) Supported (sample parameters, run many realizations) Supported, faster with JIT
Least-squares fitting Subprocess wrapper, finite-difference Jacobians Exact Jacobians through autodiff
Fisher analysis Limited by finite-difference accuracy and subprocess overhead Exact Fisher matrix in a single JIT-compiled pass
MCMC / HMC Not practical (no gradients) Enabled by autodiff

Installation

uv pip install bolojax

For GPU support:

uv pip install 'bolojax[gpu]'

Architecture

bolojax separates configuration (pydantic) from computation (JAX/zodiax):

Config layer (pydantic)         Compute layer (zodiax/JAX)
───────────────────────         ──────────────────────────
ExperimentConfig                Experiment
  SimConfig                       Instrument
  Universe                          elements: {name: Element}
  InstrumentConfig                  Tc, bath_temp, psat, ...
    Optics                        fsky, obs_time, obs_effic
    CameraConfig                SensitivityResult
      ChannelConfig               NET, NEP, powers, ...

ExperimentConfig.setup() bridges the two layers, returning an Experiment zodiax pytree that you compute with, differentiate through, and modify with .set().

Quick start

YAML-driven

import bolojax

config = bolojax.ExperimentConfig.from_yaml("config/example.yaml")
experiment = config.setup()

# Compute and export
ds = experiment.to_dataset()
ds.to_netcdf("results.nc")

Or from the command line:

bolojax -i config/example.yaml -o results.nc

Programmatic

import bolojax
import equinox as eqx

# 1. Load configuration and set up the compute object
config = bolojax.ExperimentConfig.from_yaml("config/example.yaml")
experiment = config.setup()

# 2. Compute sensitivity
result = experiment.compute()
print(f"NET = {result.NET.squeeze() * 1e6:.2f} uK-rts")

# 3. Get labeled xarray output
ds = experiment.to_dataset()
ds.to_netcdf("results.nc")

# 4. Modify parameters and recompute
exp2 = experiment.set("instrument.elements.window.loss_tangent", 2.5e-4)
result2 = exp2.compute()

# 5. Differentiate (filter_grad skips non-float leaves like ndet)
@eqx.filter_grad
def grad_net(exp):
    return exp.compute().NET.squeeze()

g = grad_net(experiment)

Optical element types

Each element in the optical chain has a type field and computes its own emissivity and transmission from physical properties. Quantities can include units.:

elements:
  - forebaffle:
      temperature: "240 K"
      scatter_frac: 0.013
  - window:
      type: dielectric
      temperature: "260 K"
      thickness: "0.025 m"
      index: 1.5246
      loss_tangent: 1.38e-4
      reflection: 0.01
  - primary:
      type: mirror
      temperature: "273 K"
      conductivity: 3.6e7
  - aperture:
      type: aperture_stop
      temperature: "5.5 K"
      spillover: 0.15

License

BSD 3-Clause. See LICENSE for details.

Metadata

Release files for bolojax 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bolojax 0.7.2
File Size Uploaded
bolojax-0.7.2.tar.gz 40.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bolojax 0.7.2
File Interpreter ABI Platform
bolojax-0.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 90.0 kB

Release files / bolojax-0.7.2.tar.gz

Download URL bolojax-0.7.2.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8f42a7605b80c01c80ccdbc0150cc2725a7f9ee3118c755659e54a3d6b7dd3fd
BLAKE2b-256 checksum
How to use checksums
251e4f296e0d1412929b61897084768eddc0e9ecf444a02b15de1f282d830acc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / bolojax-0.7.2-py3-none-any.whl

Download URL bolojax-0.7.2-py3-none-any.whl
Size 49.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5e7e7e7c6d1372626cb1b01c7c4343b7a8cdc5c415948f16ef3aecff43f676b
BLAKE2b-256 checksum
How to use checksums
789c8f516f57eeeaa051c8f71f06a8ee86b8fc8933b9ce8a7745a85bb31e13e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.2 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page