Instructions to use phanerozoic/starwell with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use phanerozoic/starwell with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="phanerozoic/starwell", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("phanerozoic/starwell", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Starwell
Starwell is a generative model for stellarator design. Given a number of field periods, an aspect ratio and a target magnetic-gradient scale length L_grad_B, it samples a plasma boundary for the mhd_stable problem of the ConStellaration benchmark, predicts its benchmark metrics, and lays out modular coils for it.
Usage
from transformers import AutoModel
model = AutoModel.from_pretrained("phanerozoic/starwell", trust_remote_code=True)
boundaries = model.sample(nfp=[3, 4], aspect_ratio=[8.0, 16.0], l_grad_b=[6.5, 21.5])
open("submission.json", "w").write(model.to_submission(boundaries))
design = model.design(nfp=3, aspect_ratio=8.0, l_grad_b=6.5)[0]
design["boundary"], design["predicted"], design["coils"]
grades = model.predict_chain(boundaries)
reactor = model.sample(nfp=4, aspect_ratio=15.0, l_grad_b=19.0,
chain={"effective_ripple": 0.01, "alpha_lost": 0.1, "stable": True})
Boundaries are SurfaceRZFourier dicts (r_cos, z_sin) that constellaration evaluates directly; sample also takes tau, guidance, steps and seed, and model.config.sampling holds the integrator's defaults. Coils are simsopt CurveXYZFourier coefficients for one half period with their currents, and simsopt.field.coils_via_symmetries builds the full set; limits (in metres and per metre) sets the coil spacing, plasma clearance and curvature they are made for, and each coil set reports the bending and twist strain of a REBCO tape wound on it (strain_met).
Model
The generator is a conditional flow-matching transformer with one token per Fourier mode of the boundary, conditioned on nfp, log aspect ratio and log L_grad_B through adaptive layer norm, trained on boundaries that satisfy all five mhd_stable constraints. A residual MLP head predicts L_grad_B and the five constrained quantities. A second predicts the coils from the boundary and the engineering limits; it was trained on the coil sets of Proxima Fusion's CoilStellaration that meet their limits and on our own optimized sets. The model also carries a library of coil sets that meet every limit. The nearest library set is tried first and the head's coils when it misses a limit, with the currents solved on the boundary; polish=N refines the better start by up to N L-BFGS iterations of a stage-two coil objective, stopping once every limit holds, and polishes the other start only if the first fails.
A chain head, an ensemble of residual MLPs on the boundary and the performance head's predictions, predicts the grades of a physics chain beyond the benchmark: VMEC's Mercier criterion and DESC's Mercier criterion and ideal-ballooning growth rate at 3 % volume-averaged beta, DESC's effective ripple and Gamma_c at rho 0.5, and the fraction of 3.5 MeV alphas lost within 10 ms at reactor scale. predict_chain returns each grade with its pass call and reactor, the call on every criterion together; model.config.chain_head["grades"] defines each grade and its limit. Given chain targets (grade names with limits, "stable": True for the stability grades, or "reactor"), sample draws several candidates per target and keeps the one the chain head ranks closest to the targets within the benchmark's constraints.
- Downloads last month
- 186
