The maximum-J property in quasi-isodynamic stellarators

Some stellarators tend to benefit from favourable average magnetic curvature for trapped particles when the plasma pressure is sufficiently high. This so-called maximum-$J$ property has several positive implications, such as good fast-particle confinement, magnetohydrodynamic stability and suppression of certain trapped-particle instabilities. This property cannot be attained in quasisymmetric stellarators, in which deeply trapped particles experience average bad curvature and therefore precess in the diamagnetic direction close to the magnetic axis. However, quasi-isodynamic stellarators offer greater flexibility and allow the average curvature to be favourable and the precession to be reversed. We find that it is possible to design such stellarators so that the maximum-$J$ condition is satisfied for the great majority of all particles, even when the plasma pressure vanishes. The qualitative properties of such a stellarator field can be derived analytically by examining the most deeply and the most shallowly trapped particles, although some small fraction of the latter will inevitably not behave as desired. However, through numerical optimisation, we construct a vacuum field in which 99.6 % of all trapped particles satisfy the maximum-$J$ condition.


Introduction
A basic requirement for magnetic fusion devices is the ability to confine collisionless particle orbits, a property which not all stellarators possess.Although the existence of nested magnetic surface is sufficient to confine circulating (untrapped) particle orbits to lowest order in the smallness of the gyroradius (Helander 2014), particles that are trapped in local minima along the magnetic field tend to drift out of the plasma unless the field is carefully tailored to avoid this phenomenon.
If we write the magnetic field in Clebsch form (D'haeseleer et al. 2012), B = ∇ψ × ∇α, then the coordinates (ψ, α) are constant along B and can thus be used to label field lines.In a field tracing out toroidal magnetic surfaces, we take ψ to be the magnetic flux enclosed by such a surface divided by 2π, and α ∈ [0, 2π] thus labels the different field lines on each surface.In Boozer coordinates α = θ − ιϕ, where θ denotes the poloidal angle, ϕ the toroidal angle, and ι(ψ) the rotational transform (Boozer 1981).
As a trapped particle drifts across the field, the second adiabatic invariant (Hastie, Taylor & Haas 1967) is conserved to high accuracy if the gyroradius is small.Here, m denotes the mass of the particle in question, v = v √ 1 − λB its speed along the magnetic-field line (if the electric field is sufficiently small) and the arc length in this direction.The ratio of the magnetic moment to the kinetic energy is denoted by λ = v 2 ⊥ /(v 2 B), where B is the field strength, and the integration is carried out between two consecutive bounce points ( L and R ) where v vanishes. 1Thus J is a function of the variables (ψ, α, v, λ).
The net cross-field magnetic drift of a magnetically trapped particle of charge q travelling between two consecutive bounce points is given by the Hamiltonian equations (Kadomtsev & Pogutse 1967;Helander 2014) (1.2b) In particular, the particle remains in the vicinity of one flux surface if ∂J /∂α = 0. Magnetic fields in which this property holds for all orbits are called omnigenous (Hall & McNamara 1975;Cary & Shasharina 1997).The direction and magnitude with which particles precess within the surface is governed by ∂J /∂ψ.It is convenient to define a precession frequency ω α where the bounce time is (1.4) Fields in which the precession frequency is negative for electrons (that is, qω α > 0) and thus opposed to the diamagnetic drift (qω = p (ψ)/n < 0), so-called maximum-J-configurations, have long been known to possess favourable stability properties for trapped-particle modes (Rosenbluth 1968;Proll et al. 2012;Helander, Proll & Plunk 2013).
The maximum-J property is additionally correlated with, but not identical to (Helander 2014), the existence of a magnetic well (Greene 1997), which is beneficial for magnetohydrodynamic (MHD) stability.This circumstance has to do with its relation to magnetic curvature.If the magnetic curvature vector is decomposed into components in the direction of ∇ψ and ∇α κ = b • ∇b = κ ψ ∇ψ + κ α ∇α, (1.5) then a positive value of κ ψ is referred to as favourable (or 'good') curvature.Since the guiding-centre curvature drift is in the direction b × κ and good curvature is clearly correlated with the maximum-J property.Indeed, the latter can be interpreted as the condition that a certain average of the normal curvature should be favourable for all trapped-particle orbits. 2he trapped particles in an omnigenous stellarator can precess in the poloidal, toroidal or helical directions, and if the precession is poloidal, the field is called quasi-isodynamic (QI) (Helander & Nührenberg 2009;Nührenberg 2010).This feature is determined by the topology of the contours of constant |B|.The aim of the present paper is to explore conditions under which a QI field may possess the maximum-J-property.It has long been known that this can be the case at finite plasma β (thermal pressure divided by magnetic pressure), very recently achieved at low values (Sánchez et al. 2023;Goodman et al. 2024) and, as we shall see, it is also possible (to a very good approximation) when β vanishes.This is in stark contrast to quasisymmetric magnetic fields (including tokamaks), where the maximum-J-property is unattainable, at least in a region near the magnetic axis.If the maximum-J condition is satisfied for some, but not all, particle orbits, then ∂J /∂ψ must vanish for certain orbits, meaning they will not precess poloidally but drift in the radial direction, resulting in super-banana (Velasco et al. 2021) or banana-drift convective (Paul et al. 2022) losses.It is clearly preferable that all orbits satisfy the maximum-J condition.
Quasi-isodynamic stellarators are sometimes referred to as a system of linked mirrors (Boozer 1998).Following this analogy, the maximum-J-condition can be seen to be closely related to the so-called minimum-B property in magnetic mirrors, which was proposed in the early 1960s (Taylor 1963).To see why, consider particles trapped in the vicinity of a local minimum, B min (ψ).Since it follows that the maximum-J-property requires ∂B ∂ψ α,l > 0, (1.8) at the field minimum.In other words, B min increases with radius and the magnetic field strength assumes a global minimum on the magnetic axis of a maximum-J stellarator (Helander 2014).In the vicinity of this minimum, the surfaces of constant field strength are ellipsoids aligned with the magnetic field.
In the following sections, we explore these ideas further and derive conditions for attaining the maximum-J-condition, focusing particularly on deeply trapped particles close to the magnetic axis.

Trapped-particle precession
A derivation of the general expression for the precession frequency of trapped particles in an arbitrary stellarator is presented in Appendix A. The result is expressed as an integral along the magnetic field between two consecutive bounce points (ϕ L and ϕ R ), which in Boozer coordinates becomes (2.1) For simplicity, we have assumed that the net toroidal plasma current enclosed by the magnetic surface under consideration vanishes, I(ψ) = 0.In (2.1) there are two separate terms contributing to the precession: the radial derivative of B = |B| and the pressure gradient p , which is negative for typical pressure profiles. 3owever, it would be wrong to conclude that a non-zero pressure gradient only affects the precession frequency through the explicit pressure term in (2.1).This naïve interpretation would imply that a negative pressure gradient tends to make qω α more negative and thus oppose the maximum-J condition.However, the radial derivative of |B| depends on the pressure profile in an equilibrium field, as the magnetic pressure responds to the change in thermal pressure.If the central plasma β is increased, the magnetic-field strength usually drops in the centre of the plasma to hold the plasma in place, and ∂ ψ B thus grows.The net result turns out, in practice, to make the maximum-J condition much easier to attain at high plasma beta compared with the case of a vacuum field.It is thus important to address the question of how ∂ ψ B depends on the pressure, which we shall consider later.
In general, ω α is a function, for each trapping well, of the pitch-angle parameter λ, the flux-surface label ψ and the field-line label α.The dependence on α is present only when the field is not omnigeneous.Then the second adiabatic invariant depends on α, and, as a result, the precession frequency of trapped particles varies as they drift from field line to field line.Numerical examples are shown in figure 1, where the normalised precession frequency is displayed for three different numerically optimised QI fields (Goodman et al. 2023).
Here, ψ a denotes the value of ψ at the plasma boundary and ωα has been plotted as a function of the trapping parameter (Roach, Connor & Janjua 1995) As discussed below, the magnitude of ωα can be interpreted as the precession frequency (for thermal particles) divided by the diamagnetic frequency (within a factor of order unity).The grey lines correspond to field lines on the same flux surface with different values of α.The fact that these lines are different from each other is an indication of departure from exact omnigeneity.For most of the discussion to follow, we shall assume, unless otherwise stated, that the field is omnigeneous.We may then choose any field line to compute the bounce average (1.7) of ∂ ψ B, or alternatively its Boozer form in (2.1).In a vacuum field with p (ψ) = 0, these integrals are weighted averages of ∂ ψ B, where the weight is positive for all trapped particles (i.e.all λ).It thus follows that the so-called minimum-B condition, ∂ ψ B > 0, is a sufficient condition for maximum-J behaviour.
2.1.Necessary conditions: special points It is, however, not necessary to make ∂ ψ B > 0 everywhere in order to attain the maximum-J condition.Even if ∂ ψ B < 0 at certain positions along the field line, the average precession can still be favourable.The condition ∂ ψ B > 0 must nevertheless be satisfied at all local minima and maxima of |B| along the field line.At these points, deeply and barely trapped particles spend nearly all their time, other points along the orbit not contributing much to the average.It is therefore necessary, both at the bottom and top of every magnetic well, that ∂ ψ B| α,ϕ > 0, even if p = 0.This result may be formally derived as the appropriate limits of (2.1), but a simpler argument has already been given in § 1: since the time required for a trapped particle to move from one bounce point to the next is equal to the precession frequency for deeply trapped particles, for which 1 − λB 1, becomes (2.5) Since ∂B/∂ = 0 at the point of minimum field strength, the derivative ∂B/∂ψ can equally well be computed at constant Boozer angles (θ, ϕ) for an omnigeneous stellarator.
A similar argument holds for barely trapped particles.A more detailed discussion can be found in Appendix A, including a proof that the explicit pressure term does not contribute, (A10).Thus, if the minimum-B-condition is satisfied at all local maxima and minima of B along the field line, i.e. if B max (ψ) > 0 and B min (ψ) > 0, (2.6a,b) then deeply and barely trapped particles are guaranteed to precess in the desired direction (qω α > 0).The recently proposed 'flat-mirror' criterion (Velasco et al. 2023) can be re-interpreted as a condition like that in (2.6a,b).It would, however, be wrong to infer that all particles trapped at intermediate depths in the magnetic wells then precess in the same direction.Such a conclusion cannot be drawn by solely considering the radial gradient of B at its extrema along the field.The conditions in (2.6a,b) are necessary for maximum-J, but not sufficient.Enforcing them as part of an optimisation effort may be helpful, but does not guarantee the maximum-J behaviour everywhere.This inference is, however, possible under additional assumptions about |B|.Obviously, if ∂ ψ B were bounded from below by either of the local |B| gradients, then (2.6a,b) would become a necessary and sufficient criterion.One scenario in which this holds true is when the shape of the magnetic well along field lines behaves 'rigidly.'That is, in going from one surface to another, |B| = B 0 (ψ) + η(ψ)f ( ) along field lines.A particularly enlightening example is that of a sinusoidal variation along one field line, |B| = B 00 + B M cos ϕ, treated in Velasco et al. (2023).In general, however, the behaviour of ∂ ψ B, and thus ω α , can be rather complicated.Figure 1 shows a recently published example of omnigeneity-optimised QI stellarators, where the behaviour at k = (0, 1) (deeply and barely trapped particles respectively) are not always good indicators for intermediate particles.Nevertheless, given the simplicity and necessary nature of the condition in (2.6a,b), we shall use it as a representative feature of the maximum-J-condition, and extend it to more global considerations.

Quasi-isodynamic fields
The treatment so far has considered little information about the magnetic field other than properties that follow directly from the requirements of the MHD equilibrium and omnigeneity.In the interest of describing the particulars of QI fields, however, we introduce to the discussion features unique to this class of stellarators.To do so, and to further simplify the discussion, we focus our attention to the vicinity of the magnetic axis.
By expansion in the minor-radius coordinate r = 2ψ/ B, where B is some reference magnetic-field strength, which we choose to be equal to that at the minimum, to second order the magnetic-field magnitude may be written in the following form: where, as shown in Appendix A, the coefficients satisfy the following relation in an exactly QI stellarator-symmetric field (Rodríguez & Plunk 2023): Here, B 0 (ϕ) and B 20 (ϕ) are even in ϕ whereas d(ϕ) and B 2s (ϕ) are odd, if we choose the angle ϕ to vanish at the point where B 0 (ϕ) attains its minimum.As a result, the first-order term B 1 vanishes at the minimum, and the precession frequency (2.5) for the most deeply trapped particles, being proportional to ∂B/∂ψ, is determined by the second-order term B 2 .It becomes where everything is evaluated at the minimum, ϕ = 0, the primes denote a derivative with respect to the toroidal angle ϕ, and ω non-QI α represents the contribution from deviations https://doi.org/10.1017/S0022377824000345Published online by Cambridge University Press from omnigeneity, which will be discussed later.To achieve qω α > 0, the magnetic field must be carefully tailored in such a way that for deeply trapped particles the quantity in the square brackets of (2.9) is positive.As we shall see, this is eminently possible but requires careful consideration of the terms within the square brackets.
As shown explicitly in Appendix B, (A25), departures from the condition of omnigeneity lead to additional terms in the expression for precession, here denoted by ω non-QI α .These contributions may be interpreted as non-intrinsic contributions due to departures from QI. Breaking omnigeneity at first order in r leads to a contribution that scales as ω non-QI α,−1 ∝ cos α/r, (A24), while deviations at second order lead to ω non-QI α,0 ∝ cos 2α, (A25).Because of the dependence on α, there always exists a field line on which the non-omnigeneous contribution is qω non-QI α < 0, i.e. detrimental to the maximum-J condition.The deviations that arise at first order are particularly worrying near the magnetic axis due to the 1/r scaling.We explain the origin of this behaviour in the following subsection.From the forms above we may nevertheless conclude that omnigeneity is necessary for the maximum-J property.

Comparison with quasisymmetric fields
Trapped-particle precession in a QI field is markedly different from that in quasisymmetric (QS) configurations, the other important class of optimised stellarators.Particle orbits in the latter are similar to those in tokamaks, and the maximum-J property cannot be satisfied throughout the volume for all particle classes.In fact, close to the magnetic axis, the magnetic-field strength in any QS field (characterised by the helicity of the symmetry N) is (Garren & Boozer 1991a;Landreman & Sengupta 2019) (2.10) and the precession frequency of trapped particles becomes (Kadomtsev & Pogutse 1967;Helander & Sigmar 2005;Rodríguez & Mackenbach 2023) (2.11) where E and K denote elliptic integrals of the first and second kinds (Olver et al. 2020, § 19).Their argument is defined by k = sin(χ b /2), where χ b is the bounce point in the well, so that k = 0 refers to deeply trapped particles and k = 1 to the trapped-passing boundary.This definition matches (2.3) to leading order.We present a plot of the behaviour in QS configurations in figure 2.
To make the comparison with the QI case more explicit, we turn to the general expression for the precession frequency close to the magnetic axis given in (A20) and consider the limit in which the magnetic-field strength only varies slightly along the magnetic axis.Then trapped particles have 1 − λB 1 and (A20) reduces to where The precession frequency is thus proportional to a bounce average of the function f (ϕ) between the two turning points.This expression reveals several important differences between the precession frequency in QI and QS stellarators (including tokamaks): 2) (see Rodríguez & Mackenbach (2023) for more details and discussion).As in figure 1, the plots on the right show the variation with field line label α, which is difficult to discern due to the high degree of quasisymmetry in these configurations.
(i) In a QS field the particle precession becomes 'infinite' (∼1/r) as the magnetic axis is approached, whereas it remains finite in QI fields.This 1/r behaviour comes from a finite poloidal component of the curvature drift as the axis is approached.In a QI configuration, the curvature of the magnetic field vanishes at the minimum on the axis, eliminating this behaviour.In the QS case, deeply trapped particles reside in the bad-curvature region, and the normal curvature is even about the minimum of B (see figure 2.10).This difference in behaviour follows directly from the difference in the topology of |B| contours, and its implications on the order-r correction to B 0 , (2.8) and (2.10).Formally, this difference in parity explains the leading-order cancellation of the precession in QI fields and the elimination of the 1/r contribution.The cancellation ceases to be exact, however, whenever the field deviates from omnigeneity.In that event, there will always exist some r a such that, for r < r a , the field ceases to satisfy the maximum-J condition (see figure 6 for example).It is known that omnigeneity must be broken at first order near the tops of the magnetic well (Plunk, Landreman & Helander 2019;Rodríguez & Plunk 2023), which unavoidably leads to a small, but finite, r a below which some fraction of trapped particles near the magnetic well tops are not maximum-J.We discuss this issue further in Appendix A.4, but shall otherwise make the assumption of exact omnigeneity, so that this term may be neglected.(ii) In QS stellarators, the fraction of trapped particles decreases as one approaches the magnetic axis, as it is the first-order poloidal variation of the field strength that defines the trapping well.In QI stellarators, this is not the case and there remains a finite trapped population on axis.This difference is important close to the axis, where there is a region with so-called potato orbits (Helander & Sigmar 2005;Rodríguez & Mackenbach 2023) in QS stellarators where the thin-orbit approximation to J breaks down.(iii) In QS, it is always the case that there are trapped particles precessing in opposite directions.Deeply trapped particles precess as in a minimum-J field (qω α < 0), while barely trapped ones do so in the opposite way.This is generally not the case in QI, where the function f , (2.13), has more freedom than in the QS case.This stems from differences in the distribution of good and bad curvature about the minimum of |B|.
These conclusions hold rigorously on the magnetic axis and, by continuity, also in its vicinity.The differences in the behaviour of curvature can be seen to hold approximately true in practice, as is shown through two examples in figure 3.In addition, in the QS case it has been shown that the near-axis description remains instructive as a model of QS configurations beyond its asymptotic regime (see figure 2 and Rodríguez & Mackenbach 2023).
The most important observation is that, in the context of QI configurations, maximum-J behaviour appears possible even in a vacuum field.Within the near-axis framework, whether this is the case depends on the sign of the bounce average of the function f (ϕ), which is analysed below.

Shallowly and deeply trapped particles in QI
The special character of the bottom and top of the magnetic well provides us with a simple way to assess the possibility of maximum-J behaviour in QI stellarators.
Satisfying the maximum-J-condition for the most shallowly trapped particles tends to be easy in practice.These particles spend most of their time close to the turning point where the field strength reaches its maximum along the field line, B(ψ, α, ϕ) = B max (ψ), which is independent of the field-line label α in a QI stellarator.Moreover, the maximum is located at a constant value of the toroidal Boozer angle, ϕ = ϕ max , which is independent of α (Cary & Shasharina 1997;Landreman & Catto 2012;Helander 2014).At the maximum, the Taylor expansion of the field strength in the coordinates α and ϕ is thus of the form since, at the toroidal angle of the maximum, the following derivatives all vanish: where the second term is negative at the top of the well.Now, in a vacuum field (zero plasma pressure), the quantity where we have used Shafranov 1970).Because of the maximum principle for subharmonic functions, the maximum of B 2 over any closed, bounded domain cannot be attained in its interior unless B 2 is constant (Evans 2022, Theorem 1, Chapter 6.4.1).It thus follows that the function B max (ψ) in (2.14) cannot have a local maximum at any value of ψ.Therefore, B max (ψ) ≥ 0 for all ψ and, following (2.6a,b), then shallowly trapped particles must satisfy the maximum-J-condition, qω α > 0, throughout the plasma. 4It should be clear that this argument holds for any omnigenous magnetic configuration, including a QS stellarator.
The situation is very different at the opposite end of the trapped population.The most deeply trapped particles at the bottom of the well tend to precess in the unfavourable direction.Indeed, these particles frequently (though not always, see figure 1), have the smallest value of qω α .The relevant question here is then whether this tendency be reversed to make the system acquire the maximum-J property at the bottom of the trapping well.
In order to understand the maximum-J condition on deeply trapped particles, we resort to (2.9), which provides an explicit expression for ω α in terms of B 20 , B 0 and d.The expressions at this point may be further simplified by realising that the curvature of the magnetic axis vanishes at the point of minimum |B|, i.e. κ(ϕ) = 0 when ϕ = 0.As a result, the behaviour of |B| is significantly constrained.The field around this point thus resembles a straight magnetic mirror, and thus we can gain some intuition about QI fields by analysing a straight magnetic mirror, which is done in Appendix C.
With these remarks in mind, we proceed to consider the governing set of equations in the near-axis framework.Formally, we explore the properties of a magnetic field in MHD equilibrium that satisfies the solenoidal condition, and possess flux surfaces at ϕ = 0.The analysis is presented in Appendix B, assuming perfect QI at first order for simplicity, and leads to an explicit form for the average radial derivative of the magnetic pressure (B 20 ), which is primary ingredient of (2.9), explicitly constructed in (B4) in Appendix B. When the condition of omnigeneity at second order is also imposed (that is, the choice of functions is made so that QI is satisfied at the bottom of the well at second order), the function f in (2.12) can be written in the following form: where d = d/κ and ᾱ = d4 B 2 0 / B2 is directly related to the elongation (along the direction of curvature) of the cross-section at the toroidal position ϕ = 0.There are thus five different terms contributing to f , which we proceed to analyse individually.

Role of pressure
As expected, increasing the pressure gradient supported by the field, |p 2 | = ( B/2)|dp/dψ|, increases f 0 .That is, it makes deeply trapped particles more likely to satisfy the maximum-J condition qω α > 0. This is the well-known effect of finite β improving the maximum-J property of QI fields, which is precisely the opposite to the naïve interpretation of the role of the pressure from the explicit term in (2.1), which vanishes at the extremal points.This effect of p is the same at both the bottom and top of the well, thus bringing both deeply and barely trapped particles towards qω α > 0. To a large extent, then, we would expect the rest of the trapped population to do likewise, and although we cannot prove it, it is convenient to think of this effect as an overall upshift of qω α .This diamagnetic behaviour turns out to be the same in the axisymmetric/QS limit (Rosenbluth & Sloan 1971;Rodríguez & Mackenbach 2023, equation (3.6a)).The positive role of pressure gradients is well known (Wobig 1993).
Whether a non-zero pressure gradient is needed to ensure f 0 > 0 depends on the relative size of the other terms in (2.18).At a minimum, we need to overcome the detrimental effect of being located at the minimum of the magnetic field, f B 0 .The plasma beta, , we define to be β J and provides an estimate of the critical β that leads to maximum-J behaviour.If we consider a simple quadratic pressure profile for a field with minor radius (defined as in the near axis) r = a, then dp/dψ ≈ −2p 0 /B 0 a 2 , and thus f 0 > 0 when and is the mirror ratio and L B the characteristic parallel length scale of the bottom of the well.For typical field parameters (a moderately elongated cross-section with ᾱ ∼ 1, a well of the scale of the major radius, and R M ∼ 0.2), we get critical plasma betas around (or below) a per cent.This suggests that maximum-J behaviour is readily achievable at a moderate plasma β.

Difficulties at the minimum
The special character of the bottom of the well is captured by the f B 0 term, which is negative (since B 0 > 0) and thus opposes maximum-J behaviour.The situation is, however, reversed at the maximum of B, where B 0 < 0 and f B 0 > 0, implying an 'intrinsic' tendency for maximum-J behaviour at this location.In fact, in a vacuum field, f 0 > 0, in agreement with the general proof presented in the previous sections.
The detrimental contribution of f B 0 at the bottom of the well can be mitigated by reducing B 0 to a minimum, i.e. by flattening the bottom of the well (increasing L B ) or reducing the mirror ratio R M .The elongation of the flux surfaces may also be tweaked to reduce f B 0 , which is maximal for circular cross-sections ( ᾱ = 1).However, note that the other geometric contributions to f 0 , (2.18) also depend on the elongation, and thus in relative terms this shaping may not be as effective although it does reduce β J .
Flattening the bottom of the well comes with potential drawbacks in the form of sensitivity to deviations from omnigeneity.Having an extended region of small ∂B 0 /∂l makes the configuration more susceptible to error fields, as secondary shallow trapping wells may be created by small perturbations.Such wells can be seen in the near-axis description of |B|, where the requirement of omnigeneity (and more particularly, that of poloidally closed B-contours) limits the behaviour of B 1 depending on how flat B 0 is.As analysed in detail in Rodríguez & Plunk (2023), for a field near the minimum described by ), this will introduce defects in |B| that lead to losses of deeply trapped particles.In fields where this situation is avoided, that is, for u < 2v, the quantity f QI vanishes, (2.18e).Only in the special case of a first-order curvature zero (v = 1) and a quadratic well (u = 2) is this contribution finite.Because d 2 /B 0 vanishes at ϕ = 0 and is positive for ϕ > 0, its derivative must be greater than or equal to zero.Hence, f QI ≤ 0 at the bottom of the well; that is, its contribution is detrimental.This makes the 'standard' first-order curvature zero and quadratic-well field (Camacho Mata, Plunk & Jorge 2022) particularly unfavourable for maximum-J behaviour.Conversely, making the section of the field where minimum |B| is located as straight as possible (larger u and v) should be beneficial (see figure 4).

Role of local shear, twist and elongation
The contribution of the torsion of the axis to f 0 is always beneficial since f τ 2 0 > 0. In fact, the larger the torsion, the larger f 0 and, thus, the closer the behaviour of deeply trapped particles will be to the maximum-J requirement.The role of torsion may be surprising, but is understandable from the perspective of a straight magnetic mirror.At the bottom of a straight magnetic mirror, attaining maximum-J is only possible if magnetic-field lines are locally twisted (see Appendix C and (C18a)-(C18b)), i.e. if they experience some form of left-right asymmetry, and in this way possess non-zero local magnetic shear.In the context of our QI stellarator, the appearance of the τ 2 0 term is simply a statement of the necessity of this twist about the magnetic axis, which is the geometric meaning of torsion.
The comparison with a straight magnetic mirror is also helpful for understanding the role of flux-surface elongation, which in a mirror needs to increase away from the bottom of the magnetic well (see figure 11).In the context of a stellarator-symmetric QI stellarator, the elongation of the cross-section at the minimum is given by d2 , as previously https://doi.org/10.1017/S0022377824000345Published online by Cambridge University Press mentioned.Thus, a change in elongation would be expected to involve a term proportional to d . 5There is no term in f 0 which involves d , but this is a result of the condition of omnigeneity at second order.In fact, upon relaxing the latter, B 20 at the bottom of the well does depend on d , (B5), and it is only through the omnigeneity condition of (B9) that this explicit dependence can be eliminated.From the omnigeneity condition it follows that d d (1 . ., meaning that increasing the torsion to favour f τ 2 0 , requires one to modify d accordingly.The plasma cross-section must become elongated in the binormal direction away from the bottom of the well, which is a consequence purely of the omnigeneity condition.Looking at the contribution of the d term to the equilibrium equation of B 20 , (B5), we see that d d (1 − 1/ ᾱ) > 0 promotes maximum-J behaviour there.Shaping of elongation is once again vital, now for attaining maximum-J.For this shaping to be synergistic between the omnigeneity condition and maximum-J, we need a binormally elongated cross-section ᾱ < 1 (i.e.binormal elongation at the minimum, | d| < 1).In practice, we seek shapes like the exaggerated schematic in figure 5, features that appear to be common in many QI configurations (Camacho Mata et al. 2022;Jorge et al. 2022).
Given the central role played by the local field-line twist, a non-zero plasma current can be either beneficial or detrimental depending on its alignment with the torsion of the axis.As can be inferred from its contribution to the rotational transform (Mercier & Luc 1974), a negative current acts constructively with a positive torsion (and vice versa).The term f I 2 reflects precisely this fact.In QI configurations, toroidal currents tend to be small and this contribution may then be disregarded.
All in all, we learn from this analysis that in a vacuum magnetic field there is only one way of possibly attaining maximum-J behaviour for deeply trapped particles, which is to have a large torsion at the point of minimum B, in the sense that τ 0 L B > √ R M /2, and thereby also a strong growth of binormal elongation.In other words, the binormal vector must rotate significantly within the magnetic well.From this analysis, it follows that it is possible to make deeply trapped particles precess in the favourable maximum-J direction, unlike the case in quasi-symmetric or tokamak fields.This result is robust even FIGURE 5. Prototypical shape of flux surfaces of an omnigeneous, maximum-J field near the point of minimum field strength.Three-dimensional illustration of features generally expected from maximum-J, QI magnetic fields.Note that field lines twist and that the elongation grows with increasing distance from the field-strength minimum.
if we acknowledge the impossibility of exact QI at first order in the near-axis expansion, because the violation of omnigeneity is only necessary near the maximum of |B|.
The construction above poses some important practical difficulties.First of all, the field will generally tend to develop large shaping, both because the maximum-J criterion requires significant torsion and omnigeneity also an increase in elongation (see the depiction in figure 5).Comparing the various contributions with f 0 in (2.18) reveals that the shaping needs to be specific and substantial to endow the deeply trapped particles with the maximum-J property.If the shaping is constrained by practical considerations, as is usually the case in stellarator optimisation studies, the opportunity for attaining the maximum-J property is correspondingly limited.How much shaping is sufficient varies from case to case, and the competition between the various field and geometric quantities (we shall recall that the shaping arguments above are a simplified local view near the minimum).The second thing to bear in mind is that our considerations here are limited to deeply (and barely) trapped particles.Intermediate orbits could behave differently, which is something that needs to be checked by computing ω α for all k.

Beyond stellarator symmetry
The realisation that a certain level of asymmetry about the bottom of the magnetic well provides the means to enhance the precession of deeply trapped particles opens the door to several possibilities.In the case of a straight mirror, one needs to break left-right symmetry in order to achieve an omnigeneous, maximum-J field (see Appendix C and Catto & Hazeltine (1981)).In the case of a QI stellarator it is then natural to ask the question whether breaking stellarator symmetry can be exploited to further improve the behaviour of the deeply trapped particles.
The procedure followed for the discussion above can be extended to the non-stellarator-symmetric case.The details of the derivation are presented in Appendix B. As a result of this extension, the expression for f 0 acquires a number of additional terms, and the stellarator-symmetric contributions are also modified.The additions are, however, limited if we specialise, for simplicity, to the case in which the elliptical cross-section at the bottom of the magnetic well remains up-down symmetric in the Frenet-Serret frame, i.e. if we choose σ (ϕ = 0) = 0.In that case, there is only a single additional term that arises from stellarator symmetry, which is proportional to It is clear that f ( d ) 2 ≥ 0, and thus one can exploit stellarator-symmetry breaking to improve the maximum-J behaviour of deeply trapped particles.In this particular case, f ( d ) 2 > 0 and thus any amount of symmetry breaking will help the precession of deeply trapped particles.When the level of asymmetry is such that it changes d significantly within the well, L¯d < L B 0 , where L −1 d ∼ ∂ ln d, this is capable of overturning the unfavourable contribution from B 0 at the bottom of the well.This may be regarded as evidence that breaking stellarator symmetry might be beneficial.

Some examples
We showed in the previous section that it is possible to achieve maximum-J behaviour for deeply trapped particles in QI stellarators but not in QS ones.To attain this goal, the shaping of the magnetic field must, however, be carefully tailored and, in particular, significant shaping of the magnetic field is necessary to promote the correct precession behaviour.In this section, we construct concrete examples of QI fields and analyse their maximum-J properties.

Near-axis constructions
We begin by considering configurations found through the near-axis expansion.To this end, we use the QI-specific developments of Plunk et al. (2019) and Rodríguez & Plunk (2023) as well as the general equilibrium framework of Landreman & Sengupta (2019).To diagnose the resulting fields, we use the normalised precession frequency ωα , (2.2), where we express ψ a , the value of the flux at the boundary, in terms of an effective aspect ratio.
To this end, we denote the length of the magnetic axis by where the integral is taken along the axis once around the torus.To lowest order in the distance from the magnetic axis, the volume enclosed by a flux surface ψ = ψ a is equal to (Helander 2014) where B 0 is the magnetic strength on axis.It is natural to define an 'average' minor radius a by setting V = 2πR • πa 2 , and a logical definition of the aspect ratio is then which may be expressed in terms of averages over the Boozer toroidal angle ϕ where the overline represents a toroidal average (. ..) = 2π 0 (. ..) dϕ/2π.We shall use this form of the toroidal flux in the presentation of numerical results to follow (choosing the representative value of A ∼ 10).
To illustrate the behaviour of the precession in some near-axis constructions, we first consider configurations recently constructed by Camacho Mata et al. (2022), which were designed to be QI to first order in the distance from the magnetic axis.This work emphasised the reduction of shaping and neoclassical transport losses when a global equilibrium was constructed using the near-axis field.Because only first-order considerations were taken into account, there is, in principle, not a unique precession frequency characterising these configurations since a certain degree of freedom exists at second order to complete the construction.Nevertheless, there is a 'natural' second-order extension of these configurations, which we refer to as the minimal-shaping construction, namely, the one that makes the X 2c and X 2s modulations in the near-axis vanish.The resulting field should be representative of the first-order construction, especially if one considers the construction of a global solution using the first-order fields.We construct the field following the equilibrium equations in Landreman & Sengupta (2019) (see Appendix B), using the code pyQIC (Jorge, Agostinho & Rodríguez 2023).With such a second-order field in place, we may calculate the precession frequency, which is plotted in figure 6 for the N = 2 and N = 3 configurations of Camacho Mata et al. (2022), where the necessary integrals were computed following (A24) and (A25).Some additional details are included in table 1.
Similarly to the global QI-optimised stellarators in figure 1, these configurations do not have the maximum-J property.Most of the trapped particles precess in the diamagnetic direction, but some particles with turning points close to the magnetic-field maxima behave as expected in a maximum-J field.This behaviour is similar to that in axisymmetric/QS fields: deeply trapped particles tend to co-precess with the diamagnetic frequency, while barely trapped ones do the opposite.The configurations importantly exhibit a significant field-line-to-field-line variation (see the different grey lines), as a result of deviations from omnigeneity.This should not come as a surprise given that the second-order construction is not QI.But in addition, as noted in the construction of Camacho Mata et al. (2022), the tops of the wells deviate from QI already at first order.The result is a variability of ωα that diverges as r → 0 and primarily affects shallowly trapped particles, see figure 6. Note, however, that this first-order effect is only noticeable very close to the axis.This is testimony to the quality of the QI optimisation performed by Camacho Mata et al. (2022).
Although the precise form of the curves in figure 6 depends on how the near-axis magnetic field has been completed at second order, the behaviour of deeply trapped particles is independent of this detail, as we learnt in previous sections.For these particles, https://doi.org/10.1017/S0022377824000345Published online by Cambridge University Press  2022).The precession is computed using the analytical expressions derived in this paper.The near-axis fields have been constructed to second order, taking a 'minimal-shaping' construction X 2c = 0 = X 2s .The grey curves denote the variation of precession between different field lines (with the black curve corresponding to the average over α), reflecting the non-omnigeneous nature of the fields.Two different origins of the variability are apparent: a roughly r independent variation from the second-order contribution, and a variation proportional to 1/r due to breaking omnigeneity at first order.it suffices to compute the various terms that make up ω α in (2.9) at the minimum of B 0 .For this calculation, however, one should not use the form of f 0 in (2.18) but instead relax the assumption of QI at second order.Setting the explicit non-QI contributions aside for now, we must use the expression for B 20 needed for (2.9).The necessary expressions are given in Appendix B, (B5), where we use the notation P i to denote the contribution of a quantity i to B 20 , in analogy to f i in f 0 .These terms can be used to assess the near-axis construction at first order as in table 1.As d = 0 (and thus P¯d¯d = 0) and d < 1 in these examples, it is a priori clear that it is impossible for the deeply trapped particles to have the maximum-J property in these configurations.A finite plasma β would be necessary to attain this property.Much like the critical β J in (2.19), we can define β = a 2 ( P i )/(2( ) 2 ), where a is the value of r at the plasma edge, which we take to be at roughly a ∼ R/10.The quantity β represents the plasma β necessary to make the vacuum QI configuration reverse the behaviour of deeply trapped particles.The key features for the equilibria in figure 6 are collected in table 1.We have at this point neglected the contribution of ω non-QI α to (2.9), and since the configurations listed in table 1 are not exactly omnigenous, it is actually necessary to increase β further in order to overcome the α-dependence.The requisite β can be estimated from (A26) and (B7), and we may thus define β tot as the total β needed to make the 'least-maximum-J' field line be so.
The analytical value of β can be seen to be correct in the example of figure 7, where the plasma β of the configuration in figure 6(a) increases.Here, the pressure gradient has been varied whilst the shape of the magnetic axis and the ellipticity of the flux surfaces in its vicinity is kept fixed to first order.Note that different authors and contexts mean different things by 'increasing β' (i.e.different features of the equilibrium are kept constant), making direct comparison difficult.Of course, reaching this β is necessary but not sufficient for maximum-J of the whole trapped population.This is especially true in the examples in figure 6, where it is not the most deeply trapped particles that have the largest precession frequency.From the preceding analysis, we expect a non-zero plasma β to introduce an overall upshift of the precession qω α , which is indeed seen numerically.
A central conclusion of our analysis thus far is the possibility of making deeply trapped particles acquire maximum-J behaviour without the need of a non-zero plasma pressure.Accordingly, we now attempt to construct such a field first through optimisation within the near-axis framework.We construct an optimisation measure for maximum-J by summing ω 2 α (which we have learnt how to compute) over values of k that satisfy qω α < 0, call it g ω α .We are also interested in imposing the condition of QI, especially at second order.At the maxima and minima of the field strength we learnt in this work that we must satisfy (B9), from which we may construct an additional cost function, call it ǧQI .Under the assumption of satisfying this condition, one can show that it is possible to choose the near-axis construction at second order in such a way that it guarantees the correct second-order QI behaviour elsewhere.We give the most essential elements of this in Appendix D, but leave a full exploration to a later publication.Note that this way of completing the solution is formally correct, but in practice (i.e. when taking into account shaping, QI breaking in buffer regions, etc.) it may not be the best choice.For our proof of principle, however, it should suffice.With this, then, we construct our near-axis cost function simply as the weighted sum of the negative qω α and the QI condition, (B9), at the |B| extrema, g = g ω α + ǧQI .
With the cost function thus defined, we must explicitly state which our minimal degrees of freedom are.We shall allow only the axis shape and the function d(ϕ) to vary, while https://doi.org/10.1017/S0022377824000345Published online by Cambridge University Press (c) Precession ωα computed numerically using |B| from the near-axis expansion at two different radii on a number of field lines (grey curves, with the black representing the average).The increase in variability at low r is due to the buffer region in which omnigeneity is broken.
For this example, this contribution was not minimised.Close to the magnetic axis, the field satisfies the maximum-J criterion for almost every orbit, except those trapped in secondary minima (Rodríguez & Plunk 2023).
keeping the field strength B 0 (ϕ) fixed.The idea is not to find a practical field, which would require limiting the shaping and other additional practical features (and unlocking other degrees of freedom such as B 0 and the order of curvature zeroes).We are simply aiming at the construction of a proof-of-principle field that exhibits maximum-J behaviour in vacuum, especially for the deeply trapped particles.Other details of the optimisation are left to Appendix D. In figure 8 we present the resulting optimised configuration for N = 1.The shaping is forbiddingly large, owing to the fact that no attention was paid to limit it.Flux surfaces are extremely shaped and limit the physical radius of the configuration (r c ≈ 0.002 (Landreman 2021)).However, we may from this approach formally construct an asymptotic form of B at any r using its near-axis form as a model, and represent the geometry to first order to exhibit the features resulting from the optimisation.
The optimised field is one in which the deeply trapped particles exhibit maximum-J behaviour (see figure 8c). 6To achieve this, the optimiser has found a field with the features identified in the preceding section.Specifically, the flux surfaces are twisted in the necessary manner and elongated away from the region of low magnetic-field strength.Although maximum-J behaviour has thus been achieved for deeply trapped particles, it is clear that the field is not exactly omnigenous especially at larger k.This is mainly due to the first-order deviations from omnigeneity which the optimisation target did not include (clearly seen by the growth of the variation going from the bottom to the top plot of figure 8).Reducing the 'buffer region' (the region where omnigeneity is violated at first order) would reduce number of trapped-particles that do not satisfy the maximum-J condition.

Traditionally optimised equilibrium
Motivated by the theoretical possibility of a vacuum, QI, maximum-J field and proceeding beyond the near-axis expansion, we now turn to more traditional, global, stellarator optimisation.From what we have learned, relaxing the requirements in shaping and pushing for QI and maximum-J-behaviour should result in a valid equilibrium solution.We attempt this optimisation to verify these predictions.To this aim, we employ three target functions: g QI ensures that the field is QI, g B min ensures that the most deeply trapped particles satisfy the maximum-J criterion, and g J ensures that the other particles also do so.The total target function that we minimise is thus (3.5) Both g QI and g J are complicated targets, which are explained in greater detail by Goodman et al. (2024), and so is the starting point for the optimisation.Broadly speaking, g QI penalises the difference between J-contours on a flux surface by computing the difference in the second adiabatic invariant and a closely related, artificially constructed, perfectly QI flux surface.From the calculation of J , we also evaluate the term g J , which imposes ∂ ψ J < 0 in this constructed field.Thus, as g QI and g J decrease, the field becomes more QI and more maximum-J.The term g B min is a more straightforward target function.Using the fact that the maximum-J condition corresponds to minimum-B (for the most deeply and shallowly trapped particles), we simply designed this function to encourage the flux-surface's minimum field strength, B min (s), to have a positive derivative, where s = (r/a) 2 .To do this, for every consecutive pair of flux surface, the target calculates B min on s 0 and s 1 = s 0 + δs and then the fractional difference between the two We can thus define the target as f B min = max(0.01− δ B , 0) 2 , where the value of 0.01 has been chosen as an arbitrary positive number here.We initialise optimisation from a near-axis construction with a flatter bottom of the magnetic well (which we know from the work above that should favour maximum-J), using techniques to be presented by Plunk et al. (2024).The resulting optimised configuration is indeed (mostly) maximum-J and QI.This can be seen in the second adiabatic invariant contours of figure 10, which show that J decreases from the centre of the (s, α) plot radially outward, and the contours are approximately circular.It is evident, however, that for trapped particles sufficiently close to the bottom of the wells (see left-most plot), there is a fraction of the population that does not behave in a maximum-J fashion.This is signalled here by a relative shift of the approximately circular contours respect to the centre.As a result, there is a portion of field lines that are minimum-J (see also the top The overwhelming majority of all trapped particles satisfy the maximum-J criterion, ωα > 0. plot of figure 9c).In the spirit of a more quantitative measure, it would be convenient to come up with a single scalar that indicates what 'fraction' of the configuration truly behaves in a maximum-J fashion.For a Maxwellian distribution function, the fraction of the trapped-particle population whose rotation satisfies qω α > 0 is equal to is proportional to the bounce time of trapped particles.This way each flux surface is considered equally important (the Maxwellian distribution does not change from surface to surface).With this definition, for the optimised configuration above, f max-J ≈ 0.996.That is, a 99.6 % of the volume is maximum-J; i.e. for all intents and purposes, the configuration is maximum-J.The omnigeneous nature of the configuration can be quantified by the effective ripple (Nemov et al. 1999), which measures the 1/ν neoclassical transport and in the present case remains in the range eff ∼ 0.15 % − 0.45 % across the volume.
To realise these features in a vacuum configuration, we see that the optimiser indeed found the extreme shaping that we expected in such a configuration.In particular, we observe extremely elongated flux surfaces towards the field maximum, and a dramatic, localised 'twist' of the flux surfaces near the field minimum.Such features can be seen in figure 9(b).
The resulting configuration also has a significant so-called 'vacuum magnetic well' of approximately 3.3 % (as defined in Landreman & Paul 2022), a property that is important for MHD stability (Landreman 2021).A field is said to have a vacuum magnetic well if V (ψ) < 0 (where V is the volume enclosed by a flux surface).Generally, unless special care is taken, optimised configurations tend to have a 'magnetic hill', i.e.V (ψ) > 0, so it is notable that this configuration has such a substantial vacuum well.
The condition for a magnetic well means that, on a suitable average, the magnetic-field strength should increase with minor radius.This can be seen from the circumstance that the volume enclosed by a flux surface ψ is where the Jacobian in Boozer coordinates is J = (G + ιI)/B 2 .Since the flux-surface average is defined as (3.11) it follows that B 2 = 4π 2 (G + ιI)/V and consequently where the last term vanishes in a vacuum field, where G (ψ) and I(ψ) vanish.The magnetic well is sometimes defined without this term (Freidberg 2014).Thus we see, as argued in § 1, that increasing the radial derivative of B is directly related to MHD stability.Indeed, Helander (2014, p. 24) showed that there is a mathematical relation between maximum-J and magnetic-well criteria, but they are not identical.In the limit of large mirror ratio, where most particles are magnetically trapped, then the maximum-J property rigorously implies a magnetic well.It is therefore not surprising that the particular configuration optimised here possesses a vacuum magnetic well.

Discussion and conclusions
Before concluding the paper, we comment on the connection between the maximum-J condition and the suppression of trapped-particle instabilities (Proll et al. 2012;Helander et al. 2013) as well as the general reduction of curvature-driven instabilities and turbulence (Proll et al. 2022).These phenomena are sensitive to the relative size of the drift frequency ω d = k α ω α and the diamagnetic frequency where T denotes the plasma temperature in units of energy, n the density and the wave vector has been taken to be k = k α ∇α.It is thus of interest to assess the magnitude of the ratio which for a density profile n = n 0 (1 − ψ/ψ a ) becomes ω d /ω * = − ωα /2 for particles moving at the thermal speed, v = √ 2T/m.In the QI cases studied numerically in the present paper, ωα is of order 1/10, making ω d /ω * 1 for most of the particles in a thermal distribution.This circumstance is stabilising to trapped-electron modes even if the absence of the maximum-J property.Relatively few electrons are able to satisfy the resonance condition in the limit ω d /ω * → 0 (Connor, Hastie & Helander 2006), and the nonlinear energy available to trapped electrons for driving instabilities is small (Mackenbach, Proll & Helander 2022;Mackenbach et al. 2023a).The latter was recently studied and labelled as the 'strong' regime (Rodríguez & Mackenbach 2023), in which the available energy is only supplied by a small fraction of the trapped population proportional to ω α /ω .From a practical point of view, it is true that as long as | ωα | 1 the magnetic field may not need to strictly satisfy the maximum-J condition in order to substantially improve trapped-electron-mode stability.This condition is nevertheless helpful for MHD stability and fast-particle confinement, since particles with ω α = 0 are less prone to collisionless losses (Velasco et al. 2021;Paul et al. 2022).In any case, whenever the magnetic field of any concrete stellarator is optimised, a compromise will need to be found between the maximum-J condition and other desirable properties.
It is fortunate, although not merely a happy coincidence, that the maximum-J property is related to both MHD stability, trapped-electron-mode suppression, and good fast-ion confinement: three very beneficial properties that are otherwise considered separate and independent of each other.Quasi-symmetric stellarators struggle to possess the maximum-J property, but we show that QI ones are more amenable to it, and can be designed accordingly.Physically, this property is realised if all trapped particles experience average favourable magnetic curvature, and the precession frequency of these particles then has the opposite sign from the diamagnetic frequency.The behaviour of the most deep and the most shallow trapped-particle orbits can be examined analytically.It is found that the former usually precess in the wrong (i.e.diamagnetic) direction.This behaviour may be modified by appropriate twisting and flattening of the field near the bottom of the trapping well.Barely trapped particles always precess as desired, provided the magnetic field is perfectly omnigenous.Nevertheless, omnigeneity always fails for some of these particles, making them, too, precess in the wrong direction (as explicitly shown).As we have seen, despite this formal limitation, it is possible to design a vacuum QI field in which the vast majority of all particles satisfy the maximum-J condition.
the arc length element is d = (G + ιI) dϕ/B, so the adiabatic invariant becomes and its derivatives are with and the contribution from the boundary terms vanishing at the end points of the bounce integral.Equation (A4) can be simplified by using the MHD force balance equation.In particular, using (A1) to find the plasma current, computing j × B using the Boozer Jacobian and flux-surface averaging the ∇ψ component of the equation (Kruskal & Kulsrud 1958;Helander 2014) where p(ψ) denotes the plasma pressure and angular brackets indicate the usual flux-surface average.Hence The bounce time is and the precession frequency ω α = α/ t, using (1.2b), thus becomes The same expressions may be reached by considering the bounce integral of the poloidal and radial drifts directly.

A.2. Precession for deeply trapped particles
The expression in (A9) is valid in any stellarator with flux surfaces, but becomes much simpler for deeply trapped particles.In this case 1 − λB 1 in the full integration domain, which also shrinks as λ −1 approaches the minimum of |B|.This makes the first term in the square brackets dominate over the second one, and F(λ, B) ≈ 1/(2B 2 √ 1 − λB) independently of the shape of the magnetic well.To show this, one can approximate the bottom of the well as B ≈ B 0 (1 + B (n) ϕ n /n!) and evaluate for a deeply trapped particle with bounce point ϕ R The second term in the square bracket of (A9) thus yields a contribution that is ∼(1 − λB 0 ) smaller than the first, and thus vanishes for deeply trapped particles regardless of the shape of the well.As a result, at the bottom of the magnetic well (i.e. at the point where B • ∇B = 0) the precession frequency becomes simply This result regarding the local role of ∂ ψ B also applies to the mostly shallowly trapped particles, which spend most of the time close to the turning point where the magnetic field strength reaches its maximum on the field line in question, λB max 1.
The partial derivative of B keeping (α, ϕ) constant can be expressed in terms of common Boozer derivatives at fixed (θ, ϕ) by using the chain rule In this expression, the second term must vanish at the bottom of the magnetic well if the field is QI (in fact pseudosymmetry is sufficient Mikhailov et al. 2002;Skovoroda 2005), as can be seen from the following argument.By definition, (ι∂ θ + ∂ ϕ )B = 0 at the bottom of the magnetic well.Moreover, in a QI field, the level contours of B = |B| are poloidally closed, which implies that (c∂ θ + ∂ ϕ )B = 0 for some c(ψ, θ, ϕ) = 0 that cannot equal ι, at least not at all minima of B. At the bottom of the well, then, the directional derivative of B vanishes in two independent directions tangential to the magnetic surface, which implies that it vanishes in any such direction including ∂ θ B = 0.As a result, (A12) becomes A similar argument also applies to maxima of the field strength.

A.3. Near-axis expansion
We now consider the region close to the magnetic axis, expanding in the minor-radius variable r = 2ψ/ B, where B is some reference magnetic-field strength.To second order, https://doi.org/10.1017/S0022377824000345Published online by Cambridge University Press this expansion is (Garren & Boozer 1991b;Rodríguez & Plunk 2023) To check for omnigeneity, let us write the integral in (A3) for where ∂F/∂B = (∂F(λ, B 0 ))/∂ϕ)/B 0 (ϕ) and the integral is meant between bouncing points ϕ R,L .Expanding to second order in r and integrating by parts7 where the integral is taken between bounce points of B 0 (ϕ).If the field is to be omnigenous, ∂ α J = 0, this quantity must vanish for all λ ∈ [B −1 max , B −1 min ] and all α ∈ [0, 2π].For a stellarator-symmetric field, B(r, α, ϕ) = B(r, −α, −ϕ), we have the relations which are satisfied if d is chosen to be odd in ϕ, and ν = (n + 1/2)π.As a result of these constraints, the first-order contribution to (A17) in r vanishes.That at second order will also vanish if These relations form the basic requirements for omnigeneity close to the magnetic axis and were recently derived by Rodríguez & Plunk (2023) by a different method that avoids the explicit integrals.We refer to that paper for further details and discussion.
Employing the same near-axis expansion to (A7) gives in analogy to (A17) for a general stellarator where the integrals are, once again, taken between bounce points of B 0 (ϕ).Substituting the omnigeneous forms of the magnetic-field functions into this integral, and noting that the enclosed toroidal current I ∼ r 2 (in the absence of an infinite current density on axis), one obtains ω α = ω α,vac + ω α,p with where p(r) = p 0 + p 2 r 2 + • • • and ϕ L and ϕ R , to reiterate it, denote the toroidal locations of the bounce point to the left (L) and right (R) of the bottom of the well (for stellarator symmetry ϕ L = −ϕ R ).Although we have used the notation ω α,vac and ω α,p , one should not forget that the former includes pressure effects through B 20 .The flux average of B 2 0 appearing in this expression is equal to A.4. Omnigeneity breaking Because the expression in (A9) is valid for any stellarator, it provides an opportunity to learn how deviations from exact omnigeneity affect the precession frequency ω α .We consider this question from the near-axis perspective.

A.4.1. First-order breaking
Let us start with the QI requirement at first order in r.As we saw following (A17), the condition of omnigeneity requires the functions d and ν to be odd and even, respectively, in ϕ (see Plunk & Helander 2018;Camacho Mata et al. 2022;Rodríguez & Plunk 2023).This symmetry is crucial in a QI stellarator, as it causes the radial drift on either side of the magnetic well to cancel to leading order (as discussed in the main text).When the condition of omnigeneity is satisfied exactly, the 1/r contribution to ω α in (A19) vanishes.This balance is delicate, however, as any small deviation can lead to a large precession, restoring the O(1/r) dependence.This behaviour can be understood as the result of a finite poloidal drift occurring over an increasingly smaller flux surface as the magnetic axis is approached.The contribution may be written as following directly from (A19).This term is, in principle, always present since omnigeneity can never be realised exactly except in trivial cases (Cary & Shasharina 1997;Landreman & Catto 2012;Plunk et al. 2019;Rodríguez & Plunk 2023).In any non-axisymmetric torus, the requirements of omnigeneity clash with the required periodicity of the solution in θ and ϕ.Formally, periodicity requires ν(−π) = ν(π) + 2π(ι − N) in our near-axis description, which is incompatible with its even symmetry.This condition is necessarily broken at the points of maximum field strength, which we may write ν = π/2 + ν and ν is odd in ϕ.Barely trapped particles will always experience this lack of omnigeneity.
Using this notation, we may rewrite the O(1/r) contribution to the precession ) to which contributions arise from any particles that venture into the region where omnigeneity is broken, i.e. sin ν = 0.For these orbits, the non-omnigeneous part of the precession will always dominate for sufficiently small r.Because of the cos α dependence of the precession, these particles will precess in either poloidal direction depending on the field line considered.The immediate implication of this behaviour is that in a realistic magnetic field (one that allows for the necessary breaking of QI), the maximum-J property is technically not possible close to the magnetic axis, independently of plasma pressure.This somewhat bleak result appears to rule out maximum-J behaviour in QI configurations, much as in QS stellarators or tokamaks.It should, however, be noted that the factors that determine the size of the 1/r terms are naturally small.At the top of the magnetic well, where the conditions of exact omnigeneity need to be relaxed, it is by construction the case that the function d vanishes.That is, the magnetic-field perturbation B 1 is small in the vicinity of the maximum, as is necessary for the consistency with a locally straight magnetic field (and for the contour of B max to be independent of the poloidal angle).By shrinking the region in which omnigeneity is broken, the number of particles for which the precession frequency diverges as 1/r can be made arbitrarily small.8Only extremely close to the axis is the divergent behaviour of the precession frequency significant.
The size of this region can be gauged by estimating the minor radius r a below which the 1/r behaviour, (A24), dominates over the second-order contributions, (A20).By way of example, we define and compute the critical radius r a = k w 2 α,−1 / k w 2 α,0 (with the −1 and 0 indices referring to the respective r scalings) for the near-axis fields in figure 6.The amplification of the precession and its variation from field line to field line is especially noticeable in figure 6(b) for which r a ∼ 0.003, driven by the presence of 'buffer' regions (Plunk et al. 2019;Camacho Mata et al. 2022).It may perhaps appear counterintuitive that close to the axis, where the field is most omnigeneous, the variation between field lines (an indicator of departure from omnigeneity) increases.However, the bounce-averaged radial drift ω ψ does decrease linearly in r as expected from (A17)), indicating that omnigeneity does become perfect in the limit r → 0. The existence of a region very close to the axis in where we changed variables ϕ = η 0 ( φ) for the first equality, applied the first-order QI condition in a generally non-symmetric QI field (equation ( 19) in Rodríguez & Plunk 2023), and noted that the second integral is exactly the negative of the first one.This proves that the QI property is sufficient to make the integral vanish, without any stellarator-symmetry requirement being necessary.This should not come as a surprise.
The QI condition at second order may be succinctly written as an equation for the α-dependent part of B 2 as (equation (C12) in Rodríguez & Plunk 2023) ) where the subscript b denotes the evaluation of the expression inside the brackets at η 0 and the barred B2 represents the poloidal average of B 2 .Following the same substitution trick as for (A27), the θ dependent part of the order O(1) contribution to ω α can be shown to vanish, only leaving the θ (or α) dependent piece.The conclusion is that the expression for the omnigeneous part of ω α,0 is the same whether or not the field is stellarator symmetric, with the difference that in the asymmetric case usually ϕ L = −ϕ R .In addition, symmetry breaking will also affect the value of B 20 .

Appendix B. Radial derivative of B for deeply trapped particles in QI configurations
As we have seen in the main text, the average radial derivative of B at the minimum along the field, B 20 = B∂ ψ B/2| ψ=0 , is key in determining the tangential drift of trapped particles.This term is related to the magnetic well (3.12), which plays an important role for MHD stability (Freidberg 2014;Landreman & Jorge 2020;Rodríguez 2023).
Regardless of whether the field is QI, the term B 20 must have a form that is consistent with the equilibrium and solenoidal properties of the magnetic field.That is, it must be consistent with ∇ • B = 0 and j × B = ∇p.Within the asymptotic framework of the near-axis description of the field, the function B 20 is only partially constrained by the properties of the magnetic field on the axis and to first order.There is in general some freedom in its choice.However, at 'straight' sections where the curvature of the magnetic axis vanishes, the constraints of the equations become particularly stringent leaving no freedom.B 20 becomes uniquely determined by lower-order choices and the plasma pressure.In this appendix we find determine its value and explore formal consequences of it.
For this purpose, we focus on the minimum of |B| along field, where deeply trapped particles reside and κ = 0. We are interested in relating the magnetic-field magnitude B 20 to lower-order quantities in the near-axis expansion and to the flux-surface geometry.To do so, and as part of what is known as the inverse-coordinate approach to the near-axis expansion (Garren & Boozer 1991b), we describe flux surfaces in terms of Boozer coordinates (our independent set of coordinates) respect to a signed Frenet-Serret frame (Plunk et al. 2019) { b, κ, τ } as x − r 0 = X κ + Y τ + Z b.Here, r 0 represents the magnetic axis and {X, Y, Z} are functions describing the flux-surface shape.The near-axis expansion framework is designed to uncover the connection between the |B| and these features.The relevant equations and constructions can be found in Landreman & Sengupta (2019), to which we refer for further details.We shall invoke results from this work, reproducing the necessary expressions.In what follows, the symbol f ij represents the expansion coefficients of the function f , where the subscript i corresponds to the power of r in the expansion, and j equals 0, c or s depending on the θ harmonic it represents (constant, cosine or sine).At higher-order generalised notation can be devised (Rodríguez & Bhattacharjee 2021).
We first consider the shape of flux surfaces in the direction normal to the magnetic axis and begin with the function X 20 , which describes a rigid shift of the flux surfaces relative to each other (akin to the Shafranov shift Landreman 2021; Rodríguez 2023).This function can be read off from equation (A34) of Landreman & Sengupta (2019) ) where all the expressions on the right-hand side except B 20 , G 2 and I 2 are first-order quantities.
Since κ appears in the denominator of this expression, to avoid an unphysical diverging shift of flux surfaces at the point where κ = 0, B 20 is highly constrained at this point.If the curvature has a zero of order v, then we expect the first v − 1 derivatives of B 20 to be determined by (B1).Let us momentarily focus on B 20 (ϕ = 0) for κ(ϕ = 0) = 0. We shall assume stellarator symmetry and the configuration to be QI to first order, so that d = d/κ is even in ϕ, the (signed) curvature is odd, the torsion even, B 0 even, and σ odd (σ = (B 1s Y 1s + B 1c Y 1c )/ Bκ is a measure of up-down asymmetry).With this in mind, using the expression for Z 20 and q i from equations (A24), (A27) and (A37-40) of Landreman & Sengupta (2019), we find10  which are the forms used in the main text.It will be convenient to choose our reference field B to equal B at the bottom of the well, B 0 , but we keep the expressions here general.
An analogous approach to avoid divergence of X 2c yields the consistent value of B 2c at the minimum of the magnetic field.In this case, we need equation (A36) from Landreman & Sengupta (2019) Then, as before, we may write for B 2c with all quantities evaluated at the point ϕ = 0.For a simple zero, the equivalent for B 2s yields that B 2s (ϕ = 0) = 0.This is satisfied by the parity conditions derived from stellarator symmetry, and thus bring no additional information to the table.The expressions here presented may be found derived in a Mathematica script in the Zenodo repository associated with this paper.We re-emphasise that the form of these expressions assumes exact QI at first order in the near-axis expansion.For more general forms of the expressions see the comments in Appendix D.
B.1.Implications of the QI condition We showed in Appendix A and learnt from Rodríguez & Plunk (2023) that, in an omnigeneous field, B 2c must have a very particular form in a stellarator-symmetric field.At the same time, from the conditions of equilibrium, we have also found in (B7) that the value of B 2c is constrained at the bottom of the magnetic well.Thus, in principle, there are two different constraints that must be simultaneously satisfied in a QI field.
To further look into this issue, we note that the B 2c employed in this section is somewhat different from the QI form of B 2c employed elsewhere in the text.In fact, B 2c here (see Landreman & Sengupta 2019) is defined respect to the helical angle χ = θ − Nϕ, where N is related to the self-linking number of the signed Frenet frame of the axis (Rodríguez, Sengupta & Bhattacharjee 2022).In contrast, the QI version of B 2c (which we may denote

C.1.2. Leading order (C2)
To leading order, O(r −1 ), there are three different equations we obtain from the three projections along the Cartesian basis of (C2).From the ẑ-projection we have which is a statement of magnetic flux conservation along the flux tube labelled by r.This is of course fully analogous to the situation in a stellarator, as it is a property inherent to any flux tube.For a non-vanishing magnetic field B 0 = 0, the other two components of (C2) to O(r) can be combined linearly using X 1c and X 1s .The result is that Φ 1,c = Φ 1,s = 0.There is, in other words, no first-order contribution to the vacuum magnetic potential.
Next, the first-order O(r) form of (C3) yields the natural conclusion that B 1s = 0 and B 1c = 0, so that there is no α-variation of the magnetic-field strength to first order.This is an expected result, as we well know that, in the absence of a pressure gradient, the perpendicular gradient of |B| is proportional to the curvature vector.In the vicinity of a straight axis, there is therefore no first-order variation of the magnetic-field strength.This circumstance sets the straight mirror apart from a typical QI stellarator, in which the toroidal nature of the field forces the field to exhibit such a variation in most places along the magnetic axis.The leading form of the field is then that at next order, which must be quadrupole-like.

C.1.3. Zeroth order (C2)
Let us now turn to the next order of (C2), which is O(r 0 ).At this order we have a total of six independent equations, as each of the projections has cos α and sin α terms.
From the ẑ projection, and constructing appropriate linear combinations of the equations, we may write the following equations for Y 2c and Y 2s : which are thus explicitly related to the second-order quantities X 2 and Y 20 .This circumstance is reminiscent of the situation in a stellarator (equations (A32)-(A33) in Landreman & Sengupta 2019).In the interest of brevity, we shall not proceed to find coordinates), a fourth one being chosen consistently to make the curvature vanish at φ = 0, π (Camacho Mata et al. 2022;Rodríguez et al. 2022).This restricts us to first-order zeroes of curvature (Rodríguez et al. 2022;Camacho Mata & Plunk 2023).The function d is allowed to have 7 degrees of freedom through collocation points of a symmetric spline, symmetry being necessary to preserve stellarator symmetry.
With the optimisation procedure defined this way, we finally need to specify a starting point, which we take to be a generic QI axis with N = 1 and d = 1.Other details, such as the buffer region size etc. can be found in the supplementary material, in which all the numerical tools are provided.The optimisation is performed using the near-axis code pyQIC (Jorge et al. 2023) with appropriate upgrades (use of splines, second-order choice, etc.), and the optimisation libraries of scipy (the algorithms Nelder-Mead and BFGS are used, the latter as a refinement of the former).Broadly speaking, the optimisation proceeds in two stages: (i) Nelder-Mead optimisation for QI and maximum-J behaviour at the minima and maxima of B 0 ; (ii) full optimisation (on a few field lines) of the function g.Step (i) has the benefit of only requiring a first-order near-axis solution, thus being quite fast, while (ii) is slower as it needs to compute ωα .Additional refinements are of course possible.
The results of the optimisation are presented in figure 8, and all the pertinent files and scripts are included in the Zenodo repository associated with this paper.

FIGURE 1 .
FIGURE 1. Example of precession in highly QI fields.Normalised precession frequency ωα , (2.2), as a function of the trapping parameter k 2 , (2.3), for three recently optimised QI configurations with different number of field periods N (Goodman et al. 2023), in which omnigeneity is attained to a high degree.For each configuration, ωα is displayed at two values of the normalised radial flux coordinate on a number of different field lines (grey curves), with the black curve representing α = 0.A positive value of ωα corresponds to the maximum-J-property.Note that deeply trapped particles (k 2 → 0) tend to behave worse than barely trapped ones, and the intermediate population can exhibit non-monotonic dependence on k 2 .

FIGURE 2 .
FIGURE 2. Precession in zero-β tokamaks and QS stellarators.Panel (a) shows the predicted dependence of the leading-order precession frequency in a tokamak or QS stellarator as a function of the trapping parameter, k, (2.11).Panels (b,c) show the precession frequency on the boundary of actual QS vacuum configurations (Landreman & Paul 2022), normalised as in (2.2) (seeRodríguez & Mackenbach (2023) for more details and discussion).As in figure1, the plots on the right show the variation with field line label α, which is difficult to discern due to the high degree of quasisymmetry in these configurations.

FIGURE 3 .
FIGURE 3. Curvature about the minimum in a QS and QI field.The plots show a comparison of the curvature (B × κ • ∇α) in (a) a quasiaxisymmetric (the precise QA in Landreman & Paul 2022) and (b) a quasi-isodynamic (the N = 2 configuration in Goodman et al. 2023) configurations.Panels (a i,b i) show a three-dimensional rendition of the boundary of the configurations, in which the colours display the quantity B × κ • ∇α, with blue/red representing negative/positive values (good/bad curvatures) respectively.Panels (a ii,iii,b ii,iii) show the magnetic field |B| and the curvature along the field line, using the cylindrical coordinate φ and the PEST poloidal angle ϑ as coordinates along the field line.The scatter plot indicates the position of the minimum.These two examples illustrate the qualitative difference in the curvature parity between a QI and a QS field.

FIGURE 4 .
FIGURE 4. Schematic depiction of trapping wells that favour maximum-J behaviour.Certain magnetic field features make them more prone to maximum-J behaviour than others.In particular, wide and flat magnetic trapping wells (a) at straighter sections (b) of the stellarator favour maximum-J.The diagram on the right is a schematic top-down view on an N = 2 stellarator, with the shading denoting |B|.

FIGURE 6 .
FIGURE 6. Precession of trapped electrons for two near-axis QI examples.Three-dimensional rendition of flux surfaces at r = 0.1 (with the colour map representing the magnetic-field strength) and normalised precession frequency ωα at two different radii for near-axis fields with N = 2 and N = 3 of Camacho Mata et al. (2022).The precession is computed using the analytical expressions derived in this paper.The near-axis fields have been constructed to second order, taking a 'minimal-shaping' construction X 2c = 0 = X 2s .The grey curves denote the variation of precession between different field lines (with the black curve corresponding to the average over α), reflecting the non-omnigeneous nature of the fields.Two different origins of the variability are apparent: a roughly r independent variation from the second-order contribution, and a variation proportional to 1/r due to breaking omnigeneity at first order.

FIGURE 7 .
FIGURE 7. Reversal of trapped-particle precession with increasing β.Normalised precession frequency ωα for three different values of plasma β for the 'minimally shaped' near-axis field N = 2 from Camacho Mata et al. (2022) at r = 0.01.The black lines correspond to the α = π/4 field line, and grey curves reflect the variation in precession frequency due to non-omnigeneity.The analytical estimate for the normalised pressure at which deeply trapped particles reverse their precession is β = 5.5 % and corresponds to the middle set of curves.The legend on the right shows how the plasma cross-section at the radii r = 0.05, 0.1 and toroidal angle φ = 0 change with β.

FIGURE 8 .
FIGURE 8. Proof of principle of a maximum-J-optimised near-axis field.The panels show a near-axis field optimised so as to exhibit quasi-isodynamicity and maximum-J behaviour, especially near the minimum of the magnetic field on each flux surface.The shaping of the configuration is very large, and thus the resulting field impracticable, but shows that the optimisation criteria can be met.(a) A three-dimensional rendition of the field for r = 0.02, using only the first-order description.(Second-order contributions are large and obscure the visualisation.)(b) First-order cross-sections near the minimum of |B| (in (R, Z) coordinates and between φ = 3π/4, 5π/4).The dotted curve represents the position of the magnetic axis.(c) Precession ωα computed numerically using |B| from the near-axis expansion at two different radii on a number of field lines (grey curves, with the black representing the average).The increase in variability at low r is due to the buffer region in which omnigeneity is broken.For this example, this contribution was not minimised.Close to the magnetic axis, the field satisfies the maximum-J criterion for almost every orbit, except those trapped in secondary minima(Rodríguez & Plunk 2023).

FIGURE 9 .
FIGURE 9. Example of a maximum-J-optimised global equilibrium.The plots show a magnetic field optimised by minimising (3.5) so as to attain quasi-isodynamicity and maximum-J behaviour in a vacuum magnetic field.The configuration has an aspect ratio of A VMEC ∼ 7, three field periods and exhibits strong shaping, which was not constrained in this proof-of-principle example.(a) Three-dimensional rendition of the outermost surface of the field, where the colour map represents |B|.(b) Detail of cross-sections near the core (at = 0.1, and for reference to indicate the large shaping of surfaces = 0.5 as broken contours) and about the minimum of |B| (in(R, Z) coordinates and between φ = 3π/4, 5π/4), showing features of twist and shape studied analytically.The dotted curve represents the position of the magnetic axis.(c) Precession frequency at two radii on a number of field lines (grey curves, with the black α = π/2).The increase in variability at low r is a consequence of the breaking of omnigeneity.The overwhelming majority of all trapped particles satisfy the maximum-J criterion, ωα > 0.

FIGURE 10 .
FIGURE 10.Contours of the second adiabatic invariant J in polar coordinates (s, α).Contours showing the second adiabatic invariant as a function of the polar coordinates (s, α) for three different trapped-particle classes.The values of λ used are λ = [(B max − B min )λ n + B min ] −1where B max and B min denote the maximum and minimum field strengths on the flux surface in question.An ideal omnigeneous field would have concentric circular contours.The wiggle in the contours is indicative of QI breaking, which is particularly prominent close to the trapped-passing boundary (small λ).An ideally maximum-J field would show a monotonic decrease of J along any ray emanating from the origin.

TABLE 1 .
Critical β and geometric contributions.Geometric parameters and critical β for the N = 2 and N = 3 near-axis QI examples in Camacho Mata et al. (2022).Here, β is a measure of the required plasma beta to prevent deeply trapped particles from precessing in the diamagnetic direction in an idealised omnigeneous field (β tot if the non-omnigeneous nature of the field is considered).