Potential-field loss scaling in NF2
NF2 uses the analytic potential field as a height-dependent loss scale. The aim is simple: make the physics losses matter at every height, not only near the strong-field photosphere.
The problem
falls by orders of magnitude from the photosphere into the corona.
If a force-free residual is averaged over the whole volume, the strong-field base dominates the loss. The optimiser then pays much less attention to the upper corona.
The fix is to divide each point’s loss by an estimate of the local field strength.
The catch is that we cannot use the true field strength, because that is what we are solving for. We need a cheap reference profile.
Why use the potential field
The potential field is the minimum-energy field consistent with the observed normal boundary flux. It contains no currents, but it does capture the main height falloff set by the magnetogram’s spatial scales.
That makes it a good reference:
- it is cheap to compute;
- it needs only the boundary normal field;
- it gives a physically motivated height envelope;
- it does not require knowing the unknown coronal currents.
It is not the final solution. It is just a stable ruler for scaling the loss.
The FFT solver
NF2 builds the potential cube in Fourier space (nf2/potential/potential_field.py), using the Alissandrakis / linear-force-free method.
For horizontal modes , the Helmholtz form gives:
The bounded solution decays with height:
For the potential case, , so . Small spatial scales have large and decay quickly. Large-scale structure survives to greater height.
The field can then be written schematically as:
So the cube is cheap: one inverse FFT per height.
The fitted height envelope
NF2 then turns the potential cube into a 1D height profile:
- Build the potential cube from binned boundary .
- Convert it into model units.
- Compute the horizontal mean:
- Fit a quadratic in:
so:
The variable keeps the base finite and makes the near-surface falloff easier to fit. The quadratic term captures the steepening as small-scale modes decay away.
Applying the scale
At each training point, NF2 computes:
with power (default 1), and scales the local loss as:
High in the volume, is small, so dividing by it amplifies the loss. This gives the upper corona a stronger gradient signal.
The fitted profile is computed once and then frozen. This is different from the dynamic b_height scaler, which uses the current predicted field strength during training.