Generative modeling for stellarator design with diffusion models and flow matching.
This repository covers the standard workflow:
training -> sampling -> physics evaluation
The codebase includes DDPM and flow-matching generators, sampling scripts, and VMEC-based evaluation utilities for quasi-symmetry metrics.
Create the conda environment:
conda env create -f environment.yml
conda activate distelIf the environment already exists:
conda env update -f environment.yml --prune
conda activate distelInstall local package hooks:
./install.shVMEC-related utilities:
./tools/setup/install_vmec2000.sh
./tools/dev/check_vmec.sh
./tools/dev/verify_vmec_env.py --instantiateTrain a model:
./scripts/train.sh
./scripts/train.sh --schedule ddpm
./scripts/train.sh --schedule flow
./scripts/train.sh --conditions mean_iota aspect_ratio nfp helicity --use_pca --pca_size 50Sample new configurations:
./scripts/sample.sh --model_dir <run_dir>
./scripts/sample.sh --model_dir <run_dir> --n_samples 64 --target_nfp 4
./scripts/sample.sh --model_dir <run_dir> --schedule flow --flow_formulation ode --flow_ode_order 3
./scripts/sample.sh --model_dir <run_dir> --schedule flow --flow_formulation sdeEvaluate sampled configurations:
./scripts/eval.sh --sample_dir <sample_dir>Run the full pipeline from a config file:
./scripts/pipeline.sh configs/pipeline.example.conf.shSearch scripts are in /scripts/search folder, please refer to /scripts/search/readme.md for execution.
Main comparison across the evaluated nfp range:
Weight ablation for search:
Runtime sweep:
- Misha Padidar, Teresa Huang, Andrew Giuliani, and Marina Spivak.
Diffusion for Fusion: Designing Stellarators with Generative AI. arXiv:2511.20445, 2025. https://arxiv.org/abs/2511.20445 - Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le.
Flow Matching for Generative Modeling. arXiv:2210.02747, 2022. https://arxiv.org/abs/2210.02747


