Software

Libraries and apps I design, write and maintain, followed by the code behind my papers and the material from workshops I have taught.

Virtual Brain Inference (VBI)

Probabilistic inference on whole-brain models, from simulation to posterior.

  • Fast simulators in C++, CuPy (GPU) and Numba; spectral, temporal and connectivity features; and deep neural density estimators that recover model parameters from neuroimaging data.
  • Lead developer; published in eLife (2025) and the Journal of Open Source Software (2026), and available on EBRAINS.
pip install vbi

Python, C++, CuPy, Numba, PyTorch, sbi, SWIG

VBI workflow: structural brain data and a model feed a simulator; features of the simulated data train a neural density estimator that returns a posterior over model parameters.
The VBI workflow: simulate, extract features, train an estimator, infer parameters.

JaxCont

Differentiable continuation and bifurcation analysis in JAX.

  • Follows equilibrium and periodic-orbit branches through folds, and detects fold, Hopf, branch-point and period-doubling events.
  • The whole sweep compiles with jit, batches with vmap and differentiates with grad, so bifurcation points can be optimised directly.
  • Checked case by case against MatCont 7.6 and BifurcationKit.
pip install jaxcont

Python, JAX, Matplotlib, pytest, Sphinx

S-shaped equilibrium branch of a cubic system; the JaxCont curve lies on top of the MatCont 7.6 reference points and both find the same two fold points.
A cubic S-curve traced by JaxCont over the MatCont 7.6 reference. Largest branch difference: 1.0×10−4.

lyapax

Lyapunov exponent spectra of ODEs, maps and delay equations, written natively in JAX.

  • Pushes tangent vectors through your own step function with jax.jvp and vmap, so no Jacobian has to be derived by hand.
  • Handles fixed-delay equations and partial spectra, whose cost grows with the number of exponents tracked rather than the system size.
  • Runs unchanged on GPU; benchmarked against ChaosTools.jl and jitcode.
pip install lyapax

Python, JAX, Diffrax, pytest, Sphinx

Log-log plot of wall-clock time against network size for a dense Kuramoto network. lyapax on GPU stays near one second up to 2000 nodes; lyapax on CPU grows to about 36 seconds; ChaosTools.jl reaches about 175 seconds at 200 nodes.
Full Lyapunov spectrum of a dense Kuramoto network. At 200 nodes lyapax takes about a second on CPU; ChaosTools.jl takes about three minutes.

LitForge

A local-first desktop app for finding, screening and writing from scientific literature.

  • Turns a DOI, a few keywords or a reference list into a ranked reading list from OpenAlex, Crossref and arXiv, with the reason each paper was found.
  • Parses each PDF once into sections, figures, tables and equations, so a language model reads only what a question needs; quoted answers are checked against the source page.
  • Includes a LaTeX writing studio with live preview and one-line installers for macOS, Linux and Windows.

Python, PyMuPDF, Docling, local and cloud LLMs, Typer, Tectonic

LitForge results screen: a ranked list of papers with scores, filters and charts.
Ranked results with scores, filters and charts.

MD Viewer

A Markdown viewer for mixed Persian and English text, with LaTeX math.

  • Each paragraph, heading and table cell takes its direction from its own first letter, so bilingual notes read correctly.
  • Ships as one offline web page, a desktop app for macOS, Windows and Linux, and an Android app on Cafe Bazaar.

JavaScript, marked, KaTeX, highlight.js, DOMPurify, Tauri

MD Viewer with a Markdown editor on the left and the rendered preview on the right, showing Persian and English paragraphs and two LaTeX equations.
Editor and live preview with right-to-left text and KaTeX equations.

More code

Smaller libraries, reproducible paper code, book companions and teaching material.

Libraries and contributions

vbjax
JAX package for virtual brain modelling, developed with the INS team.
vbjax_dynamics
JAX integrators for ordinary, stochastic and delay differential equations.
JITCSIM
Network dynamics with ordinary, delay and stochastic equations, compiled just in time.
sbi
Contributor to the simulation-based inference toolkit; co-author of sbi reloaded (JOSS, 2025).
NEST and Brian2
Pull requests to NESTML (#543, #560) and Brian2 (#1265).

Code for papers

SBI-VBMs
Simulation-based inference on virtual brain models of disorders. Machine Learning: Science and Technology, 2024.
Frontiers2021
Frequency-resolved functional connectivity: role of delay and the strength of connections. Frontiers in Neural Circuits, 2021.
ziaeeNN2020
Frequency-dependent organization of the brain's functional network through delayed-interactions. Neural Networks, 2020.
SReport2020
Emergence of global synchronization in directed excitatory networks of type I neurons. Scientific Reports, 2020.
parkinson_modeling
Spiking and rate models of the basal ganglia in Parkinson's disease.

Book companions

ModelingNeuralDynamics and mndynamics
Python and Brian2 code for Börgers, An Introduction to Modeling Neuronal Dynamics, also packaged on PyPI.
netsci
Notes and code for Barabási, Network Science.
spikes
Python and JAX code for Wilson, Spikes, Decisions, and Actions.
signal_processing
Fourier and wavelet transforms and time-frequency analysis.

Workshops

High-performance computing with Python
Profiling, Numba, JAX, CuPy, Cython, SWIG and pybind11 for fast scientific Python.
Programming
Python scripting, C++, Julia, JAX and Numba.
Machine learning
Deep learning by doing, a milestone course from tensors to CNNs for EEG; machine learning tutorials; simulation-based inference.
Neural simulators
Brian2, NEST and NESTML and Kuramoto model simulators.