Code

Below are some of the research software projects I develop and contribute to. A fuller list is on my GitHub.


JAXMg logo

JAXMg

Python · JAX · C++/CUDA · XLA FFI

JAXMg started when both Roeland Wiersema at the Flatiron Institute and I found ourselves bottlenecked by the same problem in completely different domains of computational physics. Roeland needed to solve the large dense linear systems that arise in variational Monte Carlo for quantum many-body physics (see e.g. Wan, Wiersema & Zhang 2026), while I needed them for large-scale Bayesian inference workflows in cosmology. In both cases, there was no way to scale these solves across multiple GPUs without leaving JAX.

JAXMg connects JIT-compiled JAX programs to NVIDIA's cuSOLVERMp. You pass in an ordinary sharded JAX array and get back distributed linear solves and eigenvalue, singular-value and QR decompositions, on matrices approaching the combined memory of every GPU you have. It has since grown into a general tool used across computational science, from the large dense systems behind computational electromagnetics to tensor networks and time-dependent variational Monte Carlo. It is now integrated into major variational Monte Carlo libraries including NetKet and tachys, with support planned for jVMC.


BayesEoR forward model and inference workflow

BayesEoR-JAX

Python · JAX · JAXMg · Nested Sampling · Distributed Linear Algebra · Multi-GPU

BayesEoR is a Bayesian forward-modelling framework for recovering the cosmological 21-cm power spectrum from interferometric observations. It models the cosmological signal and radio foregrounds jointly through the instrument response, analytically marginalising high-dimensional nuisance parameters to recover the power spectrum and Bayesian evidence for model comparison.

This accelerated version combines JAXMg's distributed linear algebra with a statistically optimal, observation-specific latent space. A noise-informed Karhunen–Loève decomposition retains only the foreground modes resolvable above the thermal noise, so the dimensionality reflects the information content of the data rather than the resolution of the model. Constructed once, the basis is amortised across subsequent likelihood evaluations, reducing the full-field coefficient space from over 300,000 to under 10,000. This enables power-spectrum recovery and Bayesian evidence evaluation in around 20 GPU-minutes, with an estimated 830-fold computational saving relative to the unreduced GPU implementation.

Related papers

  • A Latent Space for Amortised Bayesian Uncertainty Quantification and Evidence Evaluation in Interferometric Visibilities In preparation

REACH GPU forward model and inference workflow

REACH GPU Data Analysis Pipeline

Python · JAX · BlackJAX · Nested Sampling · Neural Emulation · Multi-GPU

Detecting the global 21-cm signal requires separating a faint cosmological signal from radio foregrounds around ten thousand times brighter, observed through a complex and uncertain antenna response. Reliable inference therefore requires these contributions to be modelled jointly, propagating uncertainty through the full observational chain—a task that is computationally prohibitive with conventional simulators.

The REACH pipeline provides a flexible, differentiable and GPU-accelerated modelling and inference framework. Supported approaches include neural emulation of the cosmological signal, physics-informed foreground parameterisations and learned latent representations of antenna-beam uncertainty, with analytical marginalisation where the model structure permits. Coupled to GPU-accelerated nested sampling, this enables increasingly detailed uncertainty modelling and Bayesian model validation. In the configuration presented in our NeurIPS work, the combined forward model achieves a speed-up of 7.2 × 107 relative to the original simulators.

Related papers