v0.14.0
What's Changed
- Updates default parameters for partition support size in the singular surface integrals.
- Enables tracking multiple field lines in
Bounce2D. - Adds
desc.objectives.LinkingCurrentConsistencyfor ensuring that coils in a stage 2 or single stage optimization provide the required linking current for a given equilibrium. desc.objectives.Omnigenityis now vectorized and able to optimize multiple surfaces at the same time. Previously it was required to use a different objective for each surface.- Adds a new objective
desc.objectives.MirrorRatiofor targeting a particular mirror ratio on each flux surface, for either anEquilibriumorOmnigenousField. - Adds the output quantities
wbandwptoVMECIO.save. - Changes implementation of Dommaschk potentials to use recursive algorithm and symbolic integration, improving agreement of numerical results with the literature.
eq.solveandeq.perturbnow acceptLinearConstraintProjectionas objective. This option must be used without any constraints.- Allows non-proximal optimizers to handle optimizing more than one
Equilibriumobject simultaneously. - Renames compute quantity
sqrt(g)_Btosqrt(g)_Boozer_DESCto more accurately reflect what the quantiy is (the jacobian from (rho,theta_B,zeta_B) to (rho,theta,zeta)), and adds a new function to computesqrt(g)_Boozerwhich is the jacobian from (rho,theta_B,zeta_B) to (R,phi,Z). - DESC/JAX version and device info is no longer printed by default, but can be accessed with the function
desc.backend.print_backend_info().
New Features
-
Adds Bounce integral methods with
desc.integrals.Bounce2D. -
Adds Effective ripple
desc.objectives.EffectiveRippleand Gamma_cdesc.objectives.Gamma_coptimization objectives. -
Adds new compute quantities for partial derivatives in different coordinate systems.
-
Adds a new profile class
PowerProfilefor raising profiles to a power. -
Adds an option
scaled_termination(defaults to True) to all the desc optimizers to measure the norms forxtolandgtolin the scaled norm provided byx_scale(which defaults to using an adaptive scaling based on the Jacobian or Hessian). This should make things more robust when optimizing parameters with widely different magnitudes. The old behavior can be recovered by passingoptions={"scaled_termination": False}. -
Adds a new objective
desc.objectives.CoilIntegratedCurvaturefor targeting convex coils. -
Adds the example "reactor_QA", which is similar to "precise_QA" but with self-consistent bootstrap current at finite beta.
-
desc.objectives.CoilSetMinDistanceanddesc.objectives.PlasmaCoilSetMinDistancenow include the option to use a softmin which can give smoother gradients. -
Adds a new function
desc.coils.initialize_helical_coilsfor creating an initial guess for stage 2 helical coil optimization. -
Adds
desc.vmec_utils.make_boozmn_outputfor writing boozmn.nc style output files
for compatibility with other codes which expect such files from the Booz_Xform code. -
Adds a new objective
desc.objectives.ExternalObjectivefor wrapping external codes with finite differences. -
Allows specification of Nyquist spectrum maximum modenumbers when using
VMECIO.saveto save a DESC .h5 file as a VMEC-format wout file -
Adds an option to
VMECIO.saveto specify the grid resolution in real space. -
Performance Improvements
-
A number of minor improvements to basis function evaluation and spectral transforms to improve speed. These will also enable future improvements for larger gains.
-
proximal-optimizers use a singleLinearConstraintProjectionand this makes the optimization faster for high resolution cases where taking the SVD (for null-space and inverse) of constraint matrix takes significant time. -
Chunking/batching can now be used in more places. Note that this might change the default behavior and you might get OOM (out of memory) errors.
- Adds batching feature to parallelize singular integrals used in free boundary solves.
- Adds
chunk_sizeoption to compute magnetic field methods to increase performance. Users may need to update their scripts to pass inbs_chunk_size=20or some other reasonable number if out of memory occurs as the default attempts to perform the entire computation at once. desc.objectives.CoilSetMinDistanceanddesc.objectives.PlasmaCoilSetMinDistancenow have adist_chunk_sizeoption to break up the distance calculation into smaller pieces to save memory.- Changes hessian computation to use chunked
jacfwdandjacrev, allowingjac_chunk_sizeto now reduce hessian memory usage as well.
Bug Fixes
- Small bug fix to use the correct normalization length
ain the BallooningStability objective. - Fixes I/O bug when saving/loading
_Profileclasses that do not have a_paramsattribute. - Minor bugs described in #1323.
- Corrects basis vector computations made on surface objects #1175.
- Allows keyword arguments to be passed to
GenericObjectiveandObjectiveFromUser. - Fixes bug where
save_in_makegrid_formatfunction did not correctly account forCoilSetobjects with NFP>1 or sym=True attributes, and so would not save all the coils. - Fixes issue with interpolator for singular integrals #1522 and additional checks 1519.
- Fixes the coil currents in
desc.coils.initialize_modular_coilsto now give the correct expected linking current. desc.objectives.PlasmaVesselDistancenow correctly accounts for multiple field periods on both the equilibrium and the vessel surface. Previously it only considered distances within a single field period.- Sets
os.environ["JAX_PLATFORMS"] = "cpu"instead ofos.environ["JAX_PLATFORM_NAME"] = "cpu"when doingset_device("cpu"). - Fixes bug in
desc.input_reader.desc_output_to_inpututility function for asymmetric equilibria profiles, where the full profile resolution was not being saved. - Fixes bug when passing only
syminto.change_resolutionforFourierRZToroidalSurface,ZernikeRZToroidalSectionandFourierRZCurve. - Fixes bug that was setting
ObjectiveFunction._things_per_objective_idxincorrectly. Now each_Objectivecan define a unique order that it expects to use parameters for multiple "things". - Fixes bug that occurs when an NAE solution used with NAE constraints is asymmetric, but has a symmetric axis.
- Fixes bug in
FourierCurrentPotentialField.change_Phi_resolutionwhereN_Phiwould be changed toM_PhiifNis not explicitly passed into the method. - Fixes bug when setting current for a
MixedCoilSetwith an arbitrary tree structure. - Corrects Cholesky factorized least-squares solve for wide matrices used in root finding.
- Fixes bug in the formula for computing
"P_fusion".
Breaking Changes
- Adds support for Python 3.13 and removes support for 3.9 since new JAX versions require minimum Python 3.10.
Full Changelog: v0.13.0...v0.14.0