Add soft-plused second adiabatic invariant derivative and SoftConnectivity objectives - #2309
Open
a957924278 wants to merge 6 commits into
Open
Add soft-plused second adiabatic invariant derivative and SoftConnectivity objectives#2309a957924278 wants to merge 6 commits into
a957924278 wants to merge 6 commits into
Conversation
…and soft-connectivity objectives
Implement differentiable optimization objectives for stellarator omnigenity
targeting the second adiabatic invariant J* along Boozer field lines and
enforcing clean single-well magnetic field topology via soft connectivity.
- Compute layer (desc/compute/_omnigenity.py):
* Add analytical dJ*/dalpha derivative kernel using smooth softplus cutoff
at bounce points to eliminate square-root endpoint singularity.
* Add structured soft-connectivity penalty along Boozer field lines
supporting periodic cubic spline parameterizations for well extrema.
- Magnetic fields layer (desc/magnetic_fields/):
* Introduce SplineZeta Optimizable class for parameterizing toroidal
min/max extrema curves zeta(alpha) with optional stellarator symmetry.
- Objectives layer (desc/objectives/_omnigenity.py):
* Add SecondAdiabaticInvariantAlphaDerivative and SoftConnectivity objectives.
* Export new classes in desc.objectives and desc.magnetic_fields.
- Unit tests (tests/test_second_adiabatic_invariant.py):
* Full test suite covering kernels, smooth approximations, JVP/VJP,
spline parameterization, and joint equilibrium optimization.
References:
- Chen et al. (2026), "Direct Optimization of Stellarator Omnigenity
from the Second Adiabatic Invariant", arXiv:2608.02418.
Contributor
Memory benchmark result| Test Name | %Δ | Master (MB) | PR (MB) | Δ (MB) | Time PR (s) | Time Master (s) |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
test_objective_jac_w7x | 0.10 % | 4.252e+03 | 4.256e+03 | 4.04 | 32.37 | 29.04 |
test_proximal_jac_w7x_with_eq_update | -0.55 % | 6.850e+03 | 6.812e+03 | -37.61 | 159.30 | 153.80 |
test_proximal_freeb_jac | -0.12 % | 1.356e+04 | 1.354e+04 | -15.95 | 80.48 | 79.60 |
test_proximal_freeb_jac_blocked | -0.30 % | 7.888e+03 | 7.864e+03 | -23.92 | 71.24 | 69.59 |
test_proximal_freeb_jac_batched | -0.03 % | 7.874e+03 | 7.872e+03 | -2.30 | 69.80 | 69.70 |
test_proximal_jac_ripple | -1.29 % | 3.794e+03 | 3.745e+03 | -49.01 | 55.98 | 55.86 |
test_proximal_jac_ripple_bounce1d | 0.09 % | 3.755e+02 | 3.758e+02 | 0.34 | 3.70 | 3.70 |
test_eq_solve | 0.46 % | 1.826e+03 | 1.834e+03 | 8.42 | 53.58 | 53.04 |
test_objective_quadratic_flux_jac | -0.42 % | 1.896e+03 | 1.888e+03 | -7.94 | 34.92 | 35.04 |For the memory plots, go to the summary of |
- Add SoftConnectivity to specials in test_objective_funs to resolve missing spline argument TypeError in parameterized tests - Add changelog entry for SecondAdiabaticInvariantAlphaDerivative, SoftConnectivity, and SplineZeta in CHANGELOG.md - Format modified codebase with black
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2309 +/- ##
==========================================
+ Coverage 94.33% 94.38% +0.04%
==========================================
Files 101 101
Lines 29055 29344 +289
==========================================
+ Hits 27410 27695 +285
- Misses 1645 1649 +4
🚀 New features to boost your workflow:
|
…B_star paths Add tests to satisfy codecov/patch on PR PlasmaControl#2309: - scalar B_star branch in boozer alpha-derivative wrapper - spline_symmetry=False expansion branches in soft-connectivity penalty - zeta_max_knots=None fallback branch - SplineZeta save/load roundtrip exercising _set_up and NFP property - _set_up errorif validation branches - _wrap_zeta_max_near_zero_jax consistency with numpy version - end-to-end SoftConnectivity objective with symmetry=False spline
a957924278
marked this pull request as ready for review
September 4, 2026 03:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces differentiable optimization objectives for stellarator omnigenity based on the second adiabatic invariant (bounce action)$J^*$ along Boozer magnetic field lines, as derived in Chen et al. (2026).
Key Contributions:
SecondAdiabaticInvariantAlphaDerivative):SoftConnectivity):SplineZeta):Optimizableparameterization class managing control points for the low-field valley ($\zeta_{\rm min}(\alpha)$) and high-field seam ($\zeta_{\rm max}(\alpha)$) with optional stellarator symmetry mirroring.tests/test_second_adiabatic_invariant.py):References
Checklist
upstream/master.