Skip to content

Coil distance values, coil designs and constraint rows; one-contraction gamma_dash (GPU fix) - #190

Open
hongkelu wants to merge 4 commits into
mainfrom
coil-distance-values
Open

hongkelu wants to merge 4 commits into
mainfrom
coil-distance-values

Conversation

@hongkelu

@hongkelu hongkelu commented Oct 28, 2026 •

Copy link
Copy Markdown

Expose individual coil-distance constraints for constrained optimization. The CPU suite reported 387 passes and one skip, with the optional Optuna module excluded.

Measurements and test conditions

…oil-surface distances, mean squared curvature
The per-order einsum under vmap made XLA's GPU backend emit an illegal memory access in the reverse pass of
gamma_dash for 40 curves (5 base coils, nfp 4, stellarator symmetric) at every segment count; 24 and 32 curves
and the CPU were unaffected.  Same values (checked against spectral derivatives of gamma).
…, CoilLimits, coil_constraint

CoilDesign maps one design vector (relative base-coil currents, additive unscaled Fourier coefficients) to
coils and their BiotSavart field; CoilLimits turns lengths, curvatures, the mean squared curvature and the
coil-coil, self and coil-surface distances of this PR into scaled inequality rows; coil_constraint makes
pure-coil rows a SciPy NonlinearConstraint (reverse-mode or chunked forward-mode Jacobian), for SLSQP.
@hongkelu hongkelu changed the title Coil distance values for constraint rows; one-contraction gamma_dash (GPU fix) Coil distance values, coil designs and constraint rows; one-contraction gamma_dash (GPU fix) Oct 29, 2026
@rogeriojorge

rogeriojorge commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Hi Hongke, main has moved since you opened this, and the PR now conflicts in tests/test_coils.py. I opened #253 against your branch that merges main in and resolves it. You and main each appended a test at the end of the file, so I kept both: your curve-derivative test and main's zero-currents test. Under JAX_ENABLE_X64=1 with -n 2, tests/test_coils.py gives 34 passed, and test_coil_design.py plus test_objective_functions.py give 27 passed. Merging #253 into your branch clears the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants