Skip to main content

jaxace

Tests Documentation Documentation codecov

JAX/Flax implementation of cosmological emulators with automatic JIT compilation.

Installation

pip install -e .

Usage

import jaxace
import jax.numpy as jnp
import numpy as np

# Cosmology
cosmo = jaxace.w0waCDMCosmology(
    ln10As=3.044, ns=0.9649, h=0.6736,
    omega_b=0.02237, omega_c=0.1200,
    m_nu=0.06, w0=-1.0, wa=0.0
)

# Background functions
z = jnp.array([0.0, 0.5, 1.0])
growth = cosmo.D_z(z)
distance = cosmo.r_z(z)

# Neural network emulator
emulator = jaxace.init_emulator(nn_dict, weights, jaxace.FlaxEmulator)
output = emulator(input_data)  # Auto-JIT + batch detection

Included trained generic emulators

jaxace ships artifact definitions for the official 300303 trained GenericEmulator pair:

  • ACE_mnuw0wacdm_sigma8_basis
  • ACE_mnuw0wacdm_ln10As_basis

They can be loaded directly from the package artifact registry. The first call downloads and caches the emulator; later calls reuse the local cache.

import jaxace
import numpy as np

# Input order for the sigma8-basis emulator:
# z, sigma8, ns, H0, ombh2, omch2, Mnu, w0, wa
emu = jaxace.get_emulator("ACE_mnuw0wacdm_sigma8_basis")
params = np.array([0.5, 0.8, 0.96, 67.0, 0.022, 0.12, 0.06, -1.0, 0.0])
output = emu.run_emulator(params)

# The ln10As-basis emulator uses ln10As in the second slot instead of sigma8:
emu_ln10As = jaxace.get_emulator("ACE_mnuw0wacdm_ln10As_basis")
params_ln10As = np.array([0.5, 3.044, 0.96, 67.0, 0.022, 0.12, 0.06, -1.0, 0.0])
output_ln10As = emu_ln10As.run_emulator(params_ln10As)

Available artifact-backed emulators can be listed with:

jaxace.list_emulators()

Postprocessing API

jaxace 0.6.0 matches the current AbstractCosmologicalEmulators.jl generic emulator API. Custom postprocessing functions should take three arguments:

def postprocessing(input_params, output, emulator):
    return output

When loading an emulator from disk, postprocessing.py should define that function. Legacy four-argument functions postprocessing(input_params, output, auxiliary_params, emulator) are still accepted for backward compatibility, but new emulators should use the three-argument form.

Features

  • Background cosmology (growth, distances, Hubble)
  • Neural network emulators with auto-JIT
  • Massive neutrinos and dark energy support
  • Full JAX integration (grad, vmap, jit)

Metadata

Release files for jaxace 0.7.0

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

Source distribution (sdist)

Source distribution for jaxace 0.7.0
File Size Uploaded
jaxace-0.7.0.tar.gz 35.1 kB Details

Built distribution (wheel)

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

Total release size: 72.7 kB

Release files / jaxace-0.7.0.tar.gz

Download URL jaxace-0.7.0.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a38c642439066605a12b985dfe01242bc65b2970bc45112f25604522191f7920
BLAKE2b-256 checksum
How to use checksums
2a974b306bd145ff508d5935c7bbf5ba47ef8512f66273873ff03f56f762d434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 27, 2026.

Transparency log

Release files / jaxace-0.7.0-py3-none-any.whl

Download URL jaxace-0.7.0-py3-none-any.whl
Size 37.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42efb7348ad805af913ec12bac4b7016cfd6116dab6dcc165fa9998ebf08f3ac
BLAKE2b-256 checksum
How to use checksums
8a3e69f75b6a0dad3ac38d9e77c2ec3842b5e3dbb926e149c23746a34ad936e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.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