simsopt
simsopt copied to clipboard
Single-stage optimization with spec: CoilSet, ReducedCoilSet and CoilNormalField (PR 2 of 2)
This PR adds new features, and enables the optimizations presented at the Simons' retreat and meeting, and available in preprint (https://arxiv.org/abs/2407.02097).
The main additions are:
class CoilSet
A helper class to handle a set of coil
objects as a single object:
- convenience class
- provides helper methods for all the coil-related optimization targets
- serves as the base class for
ReducedCoilSet
- allows the
ReducedCoilSet
andCoilNormalField
to be implemented with minimal code duplication.
class ReducedCoilSet
Identical in use to CoilSet
, but it's degrees-of-freedom are linear combinations of the coil degrees-of-freedom.
- Calculates its degrees-of-freedom by performing a singular-value-decomposition on an arbitrary user-provided mapping.
- Ability to re-calculate the reduced basis when changing the function or other relevant properties of the CoilSet.
- Removes some overdetermination inherent in direct-from-coil optimization.
- Reduces the dimensionality of the optimization problem, speeds up optimization.
class CoilNormalField
Identical in use to a NormalField and interfaces with SPEC, but has degrees-of-freedom specified by a CoilSet
or ReducedCoilSet
.
- Provides the normal field on a boundary in the SPEC conventions.
- Uses a cache to avoid redundant Fourier transformations.
- Handles both
CoilSet
andReducedCoilSet
, provides method to reduce theCoilSet
using the mapping to SPEC input parameters (normal field Fourier components).
With these changes the functionality I describe in my preprint will be added to the simsopt master branch. I look forward to your suggestions to improve my code.