English

JAX-in-Cell: A Differentiable Particle-in-Cell Code for Plasma Physics Applications

Plasma Physics 2025-12-16 v1

Abstract

JAX-in-Cell is a fully electromagnetic, multispecies, and relativistic 1D3V Particle-in-Cell (PIC) framework implemented entirely in JAX. It provides a modern, Python-based alternative to traditional PIC frameworks. It leverages Just-In-Time compilation and automatic vectorization to achieve the performance of traditional compiled codes on CPUs, GPUs, and TPUs. The resulting framework bridges the gap between educational scripts and production codes, providing a testbed for differentiable physics and AI integration that enables end-to-end gradient-based optimization. The code solves the Vlasov-Maxwell system on a staggered Yee lattice with either periodic, reflective, or absorbing boundary conditions, allowing both an explicit Boris solver and an implicit Crank-Nicolson method via Picard iteration to ensure energy conservation. Here, we detail the numerical methods employed, validate against standard benchmarks, and showcase the use of its auto-differentiation capabilities.

Keywords

Cite

@article{arxiv.2512.12160,
  title  = {JAX-in-Cell: A Differentiable Particle-in-Cell Code for Plasma Physics Applications},
  author = {Longyu Ma and Rogerio Jorge and Hongke Lu and Aaron Tran and Christopher Woolford},
  journal= {arXiv preprint arXiv:2512.12160},
  year   = {2025}
}

Comments

5 pages, 6 figures

R2 v1 2026-07-01T08:23:10.810Z