4Subpackages
130Python Modules
50Rust Modules
20,081Rust LOC

Python Subpackages

PackageModulesDescriptionKey Contents
scpn7 Top-level API, SPN → SNN compiler, contract system compiler contracts bitstream
core68 Physics solvers: GS equilibrium, MHD stability, transport, gyrokinetics, edge/pedestal grad_shafranov gk_transport mhd neoclassical
control43 10 controller types, digital twin, disruption prediction, actuator models pid mpc hinf ppo snn
phase10 Kuramoto-Sakaguchi dynamics, Knm, UPDE, Lyapunov guard, WebSocket streaming kuramoto knm upde
cli1 Click-based command-line interface: demo, benchmark, validate, live click

Rust Crates (PyO3)

CrateModulesDescriptionKey Exports
control-types4 Shared type definitions: state vectors, matrix wrappers, error types StateVec KnmMatrix
control-math13 Numerical primitives: Kuramoto kernel, RK4 stepper, Lyapunov exponent, matrix ops kuramoto_step rk4 lyapunov
control-core18 Physics solvers in Rust: GS iteration, transport coefficients, MHD criteria gs_solve mercier ballooning
control-control9 Controller implementations: PID, MPC, Riccati solver, gain scheduler pid_step mpc_solve dare
control-python1 PyO3 entry point: Python module registration, type conversions PyModule

Optional Dependencies

vizOptional
matplotlib, plotly — equilibrium contours, phase portraits, profile plots
dashboardOptional
streamlit, plotly — interactive Streamlit dashboard for live monitoring
hdf5Optional
h5py — HDF5 state checkpointing and GEQDSK I/O
wsOptional
websockets — async WebSocket phase streaming server
mlOptional
torch, scikit-learn — QLKNN surrogate, disruption predictor, neural equilibrium
jaxOptional
jax, jaxlib — JAX-differentiable GS solver, JIT compilation, GPU autodiff
neuroOptional
snnTorch — SNN compilation backend, LIF neuron models
rlOptional
stable-baselines3, gymnasium — PPO agent, tokamak environment
benchmarkOptional
pytest-benchmark — Python-side performance regression testing
fullMeta
All optional groups combined — equivalent to pip install "scpn-control[all]"