Structure-preserving plasma physics in Python.

Struphy is an open-source framework for solving fluid, kinetic, and hybrid plasma models with geometric finite elements and Lagrangian particles.

Toroidal wireframe Tokamak domain generated with Struphy

Loading interactive domain…

Tokamak domain generated with Struphy.Drag to rotate · Scroll to zoom · Shift-drag to pan

Why Struphy

One framework, from equations to reproducible simulations.

Struphy connects geometric numerical methods with a practical Python workflow, so researchers can move between fluid, kinetic, and hybrid descriptions without rebuilding their simulation stack.

Preserve the physics

Compatible discretizations retain structural identities and important invariants over long simulations.

Combine model families

Study fluid fields, kinetic particles, or coupled hybrid systems through a common model interface.

Work with mapped geometry

Run models on Cartesian, cylindrical, toroidal, and externally generated domains.

Prototype in Python

Use a researcher-friendly Python workflow backed by compiled performance-critical kernels.

Reproduce every run

Keep model, domain, equilibrium, perturbation, and parameters together in inspectable configurations.

Search the full catalogueCitation and reproducibility

What "structure-preserving" means

Many plasma physics PDEs carry exact invariants: energy, mass, and the divergence-free condition on magnetic fields among them. Standard discretizations can violate these invariants over long simulations, letting numerical error accumulate. Struphy instead builds its finite-element and particle discretizations from a discrete de Rham complex, so these structural properties hold exactly at the discrete level, not only in the limit of vanishing grid size.

The discrete de Rham complexFour compatible finite-element spaces are connected by the gradient, curl, and divergence operators: H1 maps to H(curl) via grad, H(curl) maps to H(div) via curl, and H(div) maps to L2 via div. Because these discrete spaces and operators commute exactly with their continuous counterparts, identities such as curl grad equals zero and div curl equals zero hold to machine precision, not just approximately.scalar potentialsH(curl)electric fieldH(div)magnetic fieldmass densitygradcurldiv
Discrete fields live in compatible finite-element spaces linked by exact discrete operators, so identities like ∇·(∇×E) = 0 hold precisely, not just approximately.

Models

A common numerical framework supports several descriptions of plasma dynamics while preserving their underlying geometric structure.

Fluid

Maxwell, MHD, and multi-fluid systems using compatible finite elements.

Kinetic

Vlasov and drift-kinetic models represented by Lagrangian particles.

Hybrid

Coupled field-particle descriptions, including MHD-kinetic models.

Quick start

Install Struphy and compile its performance-critical kernels.

Continue with the installation guide, the quick start guide, andtutorials.

$ pip install struphy
$ struphy compile

Publications

A selection of papers describing the methods and algorithms behind Struphy. See thefull publication list for more.