Stepped Pressure Equilibrium Code — The Revised Edition
SPECTRE computes general 3D MHD equilibria with generalized magnetic topology, in the framework of Multi-Region relaxed MHD (MRxMHD). The plasma is subdivided into stepped-pressure subdomains separated by ideal interfaces, in each of which a Beltrami field is computed. SPECTRE builds on the earlier SPEC code with significant algorithmic and software improvements.
Full documentation: spectre.readthedocs.io
- 3D MHD equilibrium calculations for arbitrary stepped-pressure plasma configurations
- Fixed-boundary and free-boundary scenarios (e.g. QA stellarators, W7-X)
- Force minimization to find MRxMHD equilibria
- Field line tracing and Poincaré analysis
- Postprocessing tools for geometry, field, and stability diagnostics
- TOML-based human-readable input files
pip install -e .SPECTRE is MIT-licensed and a default build is fully permissive: the FFT uses
pocketfft (BSD-3-Clause) and field-line tracing uses CyRK (Apache-2.0,
installed from GitHub because the PyPI releases up to 0.17.1 still carry a
stale NonCommercial license string in their metadata; see
thirdparty_licenses/). The faster GPL-licensed FFTW can be selected
explicitly:
pip install -e . -C cmake.define.SPECTRE_FFT_BACKEND=fftwFor platform-specific instructions and the FFT-backend / licensing details, see the installation guide in the docs.
The Get Started guide walks through input file preparation, running a Beltrami field calculation, and postprocessing results.
A self-contained example is available in examples/qa_vac_vol7/ — a force minimization calculation for a 7-volume QA stellarator
vacuum equilibrium.
pytestThis runs the full test suite in tests/ and verifies that the compiled Fortran back-end is working correctly.
See the contributing guide in the docs for the Git workflow, coding conventions, and pre-commit hook setup.
Any work that uses SPECTRE, or results obtained with it, needs to cite the following paper:
E. Balkovic, J. Loizu, E. Lanti, C. Smiet, C. Lazzati, R. Ramasamy, A. Goodman, J. Geiger and J. P. Graves, "SPECTRE: a robust solver for 3D equilibria with arbitrary topology", Plasma Phys. Control. Fusion 68, 115021 (2026). doi:10.1088/1361-6587/aebef8
@article{balkovic2026spectre,
title = {{SPECTRE}: a robust solver for {3D} equilibria with arbitrary topology},
author = {Balkovic, E. and Loizu, J. and Lanti, E. and Smiet, C. and Lazzati, C. and Ramasamy, R. and
Goodman, A. and Geiger, J. and Graves, J. P.},
journal = {Plasma Physics and Controlled Fusion},
volume = {68},
number = {11},
pages = {115021},
year = {2026},
doi = {10.1088/1361-6587/aebef8}
}Erol Balkovic, Joaquim Loizu, Emmanuel Lanti, Chris Smiet