Direct construction of optimized stellarator shapes. Part 3. Omnigenity near the magnetic axis

The condition of omnigenity is investigated, and applied to the near-axis expansion of Garren & Boozer (Phys. Fluids B, vol. 3 (10), 1991a, pp. 2805–2821). Due in part to the particular analyticity requirements of the near-axis expansion, we find that, excluding quasi-symmetric solutions, only one type of omnigenity, namely quasi-isodynamicity, can be satisfied at first order in the distance from the magnetic axis. Our construction provides a parameterization of the space of such solutions, and the cylindrical reformulation and numerical method of Landreman & Sengupta (J. Plasma Phys., vol. 84 (6), 2018, 905840616); Landreman et al. (J. Plasma Phys., vol. 85 (1), 2019, 905850103), enables their efficient numerical construction.


Introduction
The 'near-axis expansion', an expansion in the distance from the magnetic axis, has been investigated as a method to characterize the space of magnetic equilibria, and determine how well the condition of quasi-symmetry can be maintained across the plasma volume (Garren & Boozer 1991a,b). More recently, it is being reconsidered as a method to rapidly generate such equilibria, without resorting to costly numerical optimization.
The present work, the third paper in a series (Landreman & Sengupta 2018;Landreman, Sengupta & Plunk 2019), is concerned with extending these ideas to the broader class of omnigenous fields, which confine collisionless particle orbits, but do not necessarily satisfy quasi-symmetry. By relaxing this requirement, a large amount of freedom is gained, and the solution space can be considered as an exhaustive catalogue of 'good' equilibria (i.e. all those that confine trapped particle orbits). We note that some analytical work of this type provided a basis for the development of stellarator configurations (Gori, Lotz & Nührenberg 1996;Nührenberg 2010), but was limited to treatment of deeply trapped particles in a particular (quasi-isodynamic) class of equilibria.
Two related properties, characterizing optimal stellarator equilibria, are quasisymmetry and omnigenity. The relationship between them is somewhat paradoxical, as found by Cary & Shasharina (1997): quasi-symmetry is formally a subclass of omnigenity -all quasi-symmetric fields are also omnigenous. However, those omnigenous fields that break quasi-symmetry are, under reasonable conditions, also non-analytic, so that under the restriction of analyticity, it appears, disappointingly, that these classes are the same. However, by replacing a non-analytic solution with a sufficiently smooth approximation, one can indeed approach omnigenity while sharply violating quasi-symmetry, explaining why it is indeed fruitful to simply search for equilibria that confine particles, without necessarily imposing the satisfaction of quasi-symmetry.
These facts set the stage for our near-axis expansion, where analyticity is indeed assumed in the two dimensions perpendicular to the magnetic axis. It should be no surprise, therefore, that we find two variants of omnigenity (those with toroidally and helically closed contours of magnetic field strength) cannot be achieved without breaking quasi-symmetry -one, however, cannot rule out their existence entirely, as they might be found via a less restrictive construction.
We do, however, find that omnigenity can be approximately satisfied (at first order in the distance from the magnetic axis) for the class of equilibria with poloidally closed contours of magnetic field strength, so-called quasi-isodynamic equilibria. Constructing such equilibria presents some technical difficulties (as compared with quasi-symmetric equilibria), but the potential benefit in terms of freedom is quite substantial -three additional free functions of the toroidal angle, as compared with quasi-symmetric construction!
The near-axis construction of optimal stellarator equilibria can thus be summarized as follows. Quasi-axisymmetric and quasi-helically symmetric equilibria can be directly constructed, but there are no other consistent omnigenous equilibria with toroidally or helically closed contours of field strength. On the other hand, one cannot construct quasi-poloidally symmetric equilibria near the magnetic axis, but we find that one can indeed find approximately quasi-isodynamic ones, i.e. quasi-symmetry must be broken to achieve this kind of omnigenity. Therefore, it seems that quasi-helical symmetry, quasi-axial symmetry and quasi-isodynamicity are the three natural ways to achieve good stellarator equilibria with a near-axis approximation. These are the only types of equilibria with collisionless orbit confinement and therefore small neoclassical transport. It should be noted, however, that quasi-isodynamic equilibria do not share other neoclassical properties of quasi-symmetric ones. The bootstrap current vanishes identically (Helander & Nührenberg 2009;Landreman & Catto 2012) and the transport is not intrinsically ambipolar, which severely restricts plasma rotation (Helander 2007;Helander & Simakov 2008).
The paper is organized as follows. In § 2 we review the definition and geometric interpretation of omnigenity, and introduce a coordinate mapping, based on that of Cary & Shasharina (1997). We use the mapping as a tool to construct omnigenous magnetic-field-strength functions. In particular, in § 5, the mapping is expanded for nearly quasi-symmetric fields, which, due to its invertibility in this case, means that such fields can be parameterized by a free function representing the perturbation. Although this expansion may have more general application, it is particularly useful for generating equilibria using the near-axis expansion, since such equilibria must necessarily be nearly quasi-symmetric. This is discussed in § 6, where the near-axis and omnigenous forms of the magnetic field strength are checked for consistency. In this section two classes of omnigenity are shown to yield inconsistencies, and are therefore eliminated from consideration, leaving only the third, quasi-isodynamicity. After demonstrating consistency in the forms of magnetic field strength, the remaining conditions needed to construct an equilibrium solution are then examined in § 7. In § 8 it is demonstrated numerically that the equilibrium equation can indeed be solved, yielding solutions that satisfy omnigenity to the degree predicted by the theory. The results are summarized and discussed in § 9.

Omnigenity
The most fundamental optimization for a stellarator is the shaping of the magnetic field to confine collisionless trapped particle orbits. This is achieved when there is no 'radial' excursion of such particles during a single orbit, as expressed in terms of the change in the coordinate labelling the magnetic flux surfaces, here ψ (2πψ is the toroidal magnetic flux). Denoting the magnetic drift velocity of a particle as v d and using dψ/dt = v d · ∇ψ, the condition is written as ψ = 0, where, for a given magnetic well, is found to be In the first line, the quantity is represented as a time average. In the second line, it is rewritten as an integral over the arc length l between two bounce points l 1 and l 2 . In the third line, the arc length is replaced by the magnetic field strength B as a variable of integration, and the sign γ ≡ sign(∂B/∂l) is introduced which identifies the two sides of the magnetic well, and the upper bound of integration is written explicitly in terms of the quantity λ = v 2 ⊥ /(v 2 B). To obtain the final line, we use the expression for the drift velocity of a particle of mass m and charge q, v d = mb/qB × (v 2 κ + (v 2 ⊥ /2)∇ ln B), where κ =b · ∇b is magnetic curvature,b = B/B, and note that ∇ψ · (B × κ) = ∇ψ · (B × ∇ ln B). Thus, the integrand may be separated into a purely geometric factor Y (depending generally on the flux surface label ψ, field line label α and the magnetic field strength B), and an additional factor h = (2mv/qB)(1 − λB/2)/ √ 1 − λB depending on the magnetic field strength and the pitch angle. The expression for ψ given by (2.4) can be viewed as an integral transformation from B space to λ space (the velocity v appears only as a multiplicative factor), which can be inverted, implying that the condition ψ = 0 is satisfied if and only if For a quasi-symmetric field, Y is constant on flux surfaces (Helander & Simakov 2008) and this condition is trivially satisfied. Equation (2.6) is a purely geometric condition, in the sense that it is a condition on the spatial dependence of the magnetic field strength. For the purposes of this paper, we will consider the consequences of this condition on the magnetic field in Boozer poloidal and toroidal coordinates, θ and ϕ respectively. Using (2.5), we write the magnetic field in the numerator in the covariant form B cov = G∇ϕ + I∇θ + K∇ψ, and the field in contravariant form in the denominator, where the toroidal and poloidal currents I(ψ) and G(ψ) have been introduced. This expression can be interpreted as the ratio of two (linearly independent) components of the gradient of B in the θ -ϕ plane. Equation (2.6) states that this ratio must be equal at the two (bounce) points of equal magnetic field strength, i.e. γ = ±1. This fact has the simple geometric interpretation that the gradients of B must be anti-parallel, i.e. the contours of constant magnetic field strength must be parallel at those two points. Equivalently, the angular separation between points of equal magnetic field strength (within a given magnetic well) must be the same for all field lines. A number of corollaries follow intuitively, for instance that the contours of magnetic field strength must all close in the same sense (either poloidally, toroidally or helically), and the contour of the global maximum must be straight (for irrational rotational transform).

Cary-Shasharina (CS) mapping
It was shown by Cary & Shasharina (1997) that the condition of omnigenity can be satisfied by functions B(ξ , ζ ) that satisfy a set of geometric conditions. Here, ξ and ζ are angular coordinates (defined in terms of Boozer angles) defined so that contours of constant magnetic field strength close in the ξ direction. We will use the angle ξ to denote either the poloidal or toroidal coordinate, θ or ϕ, depending on the class of symmetry. The idea with the CS mapping is to introduce a new coordinate η, to replace the ζ coordinate, so that lines of constant magnetic field strength will appear straight in the η-ξ plane.
The expression for magnetic field strength given by Cary & Shasharina (1997) is where | r | < 1 ensures that B has no zeros; other expressions would also work, but this one has the benefit that it is analytic in η. The coordinate mapping for η is defined via Omnigenity near the magnetic axis 5 When expressed in this manner, an explicit form of F can be given, from which the condition of omnigenity is enforced where we note that ι is the rotational transform in the ξ -ζ plane (number of ζ transits per ξ transit). The contour of maximum field strength is straight, i.e. η = 0 at ζ = 0, independent of ξ , so we have the additional constraint The function ζ (η) specifies the angular separation, as measured along a magnetic field line, between a contour of constant η, say η = η 0 , and the corresponding contour where the magnetic field has the same strength, i.e. η 1 = 2π − η 0 ; this function is therefore defined for π η 2π, and has the properties ζ (π) = 0 and ζ (2π) = 2π. The condition of omnigenity is that this angular separation only depends on the magnetic field strength, in this case labelled by η.
The above construction only considers the relatively simple case of a single magnetic well. Parra et al. (2015) demonstrated that more complicated fields are possible, by providing an explicit construction for a two-well case. It is not surprising that more general omnigenous magnetic fields, with arbitrarily complex arrangement of magnetic wells are also allowed, and a general construction is given in the following section.

General omnigenous fields
One can think of the CS mapping as representing the general deformation of a one-dimensional prototype magnetic-field-strength function, i.e. (3.1), such that quasisymmetry is broken while preserving omnigenity. Let us introduce a general function B(η), and propose a procedure to continuously deform it. This function is assumed to satisfyB (η) > 0, (4.1) be 2π periodic and reach its global maximum at η = 0. We would also like this function to possess some degree of smoothness (so that smoothness imparted in the mapping for η may be inherited by the magnetic field itself) but it need not be analytic; for instance piecewise polynomials may be convenient. The functionB(η), an example of which is given in figure 1, implies a set of boundary points in η, which define what we will call trapping domains. Let us itemize these points: First there are the locations of local minima and maxima, starting with the global maximum at η = 0. Then, each local maximum that is less than the global maximum implies a number of additional boundary points associated with values of η where the magnetic field reaches the level of that local maximum. We will denote these boundary points, in the order they appear along the field line, as η 0 , η 1 , η 2 . . . , and we will number the trapping domains, defined by neighbouring points, in the order of increasing η, but assign the same index to the two domains that have matching bounce points; see figure 1. Thus, the left-hand domain, wherē B < 0 will be numbered i, and denoted D iL while the complimenting domain, with B > 0 will have the same index and be denoted D iR . We denote the unions of left and right trapping domains as D L and D R .
Next a function η b (η, i) must be constructed, which returns the left bounce point for a given point in a right-hand domain. That is, for any point η contained in a right-hand domain D iR , the function η b (η, i) returns the corresponding bounce point in the left-hand part of domain D iL . (The quantity corresponding to η b in the original CS mapping is 2π − η.) Note the explicit dependence on the index i, since we must distinguish between domains at locations that exactly coincide with boundary points. For example, for the case depicted in figure 1, η b (η 6 , 4) = η 4 , while η b (η 6 , 2) = η 2 . Note that it may be advantageous to use a simple method for constructingB(η), so that the function η b might be defined analytically.
As before, the mapping is given by (3.2), but now the function F must be defined over the various trapping domains, where ζ (η, i) prescribes the angular difference between field lines in magnetic coordinate ζ . Note that this can be confirmed by evaluating (3.2) at two bounce points in a well, and taking the difference. That is, take (ξ 1 , ζ 1 , η 1 ) in D iL and (ξ 2 , ζ 2 , η 2 ) in D iR . Since these are bounce points, we have the identities η b (η 2 , i) = η 1 , and ξ 2 − ι ζ (η 2 , i) = ξ 1 . The difference of the two equations thus gives ζ 2 − ζ 1 = ζ (η 2 , i). While (4.2) is a relatively simple and direct generalization of the CS mapping, it is cumbersome to enforce continuity of ζ at the boundary points. In part this is due to the fact that the function ζ must be constructed in a consistent manner, for instance so that the angular distance spanning a well is consistent with the distance prescribed in the external trapping regions, resulting in a hierarchy of additional constraints. Therefore, we propose a simplification, without loss of generality, namely to consider the angular distance as being prescribed byB(η) itself. That is, we take We arrive then at the simple form Note now that the function f (ξ , η) need only be defined over the left-hand domain D L . We emphasize that there is no loss of generality in this choice of ζ , as angular separation between bounce points can be controlled during the construction ofB(η). This choice also has the benefit of separating out the freedom associated with the corresponding narrower class of quasi-symmetric magnetic fields, from the freedom associated with breaking quasi-symmetry.
What remains is merely to enforce continuity of ζ (thus F) at boundary points (one may also wish to enforce continuity of some number of derivatives). Some of these conditions are trivial: by construction, continuity of F is already satisfied at local minima ( η = 0 at such points). Also, at boundary points between two left-hand domains, F will be continuous as long as f is continuous. The other boundary points must satisfy shifted conditions due to the translation by −ι η in the ξ coordinate, but this can clearly be satisfied since the function f is completely arbitrary, aside from the requirement that f (ξ , 0) = 0 and the invertibility requirement ∂F/∂η > −1 (i.e. that the Jacobian of the variable transformation is non-zero).
Thus it is demonstrated that arbitrarily complex magnetic well structures are compatible with omnigenous B, and the construction of such functions is only constrained by a set of matching conditions, and an invertibility requirement. In the remainder of the paper, the definition for F given in (4.3) will be used.

Analyticity
Analyticity of the magnetic field B in its spatial coordinates, will, under reasonable conditions, imply analyticity of the function F in the coordinate η (Krantz & Parks 2002). Using their mapping, Cary & Shasharina (1997) showed that (assuming irrational rotational transform) analyticity of F in η can only be satisfied for quasi-symmetric fields, in particular continuity of derivatives of the magnetic field at η = 0, 2π, where the field maximum is located, require that the corresponding derivatives of f are zero, Thus if f is to be analytic, it must, generally speaking, be independent of η, i.e. it must be quasi-symmetric. The interesting cases, therefore, are non-analytic. Note that other boundary points, for instance local minima of the magnetic field (say η min = η j ) are also locations of potential discontinuity in derivatives. Therefore, it may be useful to establish the analyticity constraints there as well. For example, by imposing (∂F/∂η) η min − = (∂F/∂η) η min + , using (4.3), we arrive at the condition Thus it would seem that analyticity at η min demands a particular relationship between η and f at boundary points. However, given that analyticity must already be abandoned at η = 0, it is not obvious why one should demand analyticity at other locations such as η min . Nevertheless, conditions such as (4.4) and (4.5), can be used to enforce continuity of arbitrary derivatives of the magnetic field strength, if desired.

Invertibility
It would seem that the mapping (4.3) allows one to generate a generic omnigenous field-strength-function using the free functions f and ζ . However, a complication arises in that its invertibility is not guaranteed. That is, although ζ is uniquely defined in the ξ -η plane, it is not necessarily true that a unique value of η can be obtained as a function of ξ and ζ . Note, for instance, that two contours of two values of η could intersect, which cannot be allowed since the magnetic field strength must be single valued.
The issue is reminiscent of the problem involving the specification of a general coordinate mapping x(ψ, θ, ϕ), which can generate self-intersecting magnetic surfaces. Practically, this presents a challenge for the parametrization of the space of omnigenous magnetic field strengths, i.e. devising a general method to construct omnigenous functions B(ξ , ζ ). However, since the change of coordinates is fairly simple (it essentially one-dimensional, ζ → η), the Jacobian is readily computed, and the condition that it is non-zero could be asserted, i.e.
which translates, via (4.3), into a condition on f ; note that requiring the derivatives of f to be small would suffice. This might be suitable for numerically generating well-behaved mappings. However, for present purposes, we find a more convenient approach is to expand about known omnigenous fields, the quasi-symmetric ones, relying on the fact that sufficiently small deviations will preserve the topology of the lines of constant η, and therefore ensure the invertibility of the mapping.

Omnigenity near quasi-symmetry
In this section we derive an approximate form of omnigenity, expanding about a quasi-symmetric field. Besides the near-axis expansion, this form could have other applications, such as numerical optimization or direct solutions applying omnigenity on a single surface (Plunk & Helander 2018). Let us express the mapping as being composed of a quasi-symmetric and non-quasi-symmetric parts, The mapping is then defined by We can now consider the deviation to be small, 1, so that the coordinate η may be expanded as The mapping at zeroth order is then Henceforth, and without loss of generality, we will assume f 0 = 0, so that F 0 = 0 and η 0 = ζ . This amounts to absorbing all the freedom of the zeroth-order mapping into the definition of the zeroth-order functionB 0 (η 0 ) =B 0 (ζ ). Note thatB 0 also determines the function η b and η. The first-order terms of (5.3) yield The magnetic field to first order can be expressed as where we have introduced the small parameter , and introducedB 1 , which can account for changes to the functional form ofB (small modifications of well depths, heights, locations, etc.). Thus, the problem of specifying an omnigenous field has been reduced to specifying the zeroth-order quasi-symmetric magnetic field, and adding an arbitrary, small deviation to the CS mapping via the perturbation f 1 . There is a great deal of freedom in specifying f 1 : it must only satisfy the appropriate continuity conditions, and f 1 | η=0 = 0, and, optionally, continuity in derivatives of a desired order.

Compatibility of omnigenous and near-axis forms of B
In the near-axis expansion, the magnetic field is nearly quasi-symmetric in a trivial sense, because the zeroth-order contribution (i.e. the on-axis magnetic field) can only depend on the Boozer toroidal angle. The field is therefore simultaneously quasi-axisymmetric, quasi-helically symmetric and quasi-poloidally symmetric on the axis if the on-axis field is constant; if the field strength varies with the Boozer toroidal angle, it cannot be quasi-axisymmetric or quasi-helically symmetric, but it is still automatically quasi-poloidally symmetric. At a small distance from the axis, we are concerned with whether omnigenity can still be satisfied, when quasi-symmetry is broken. The first step is to check for consistency between two forms of the magnetic field strength, namely the omnigenous form and the near-axis form.
In § 6.1 we consider the case of constant on-axis magnetic field, and conclude that the two forms are inconsistent, implying that omnigenous non-quasi-symmetric equilibria of this type do not exist -at least not any that are consistent with the axis expansion to first order. The question of consistency for the case of varying on-axis field strength is then treated in § 6.2, where more optimistic conclusions are drawn.
Following Garren & Boozer (1991a), we write the general form of the magnetic field to first order in the distance from the axis where 1 can be taken as a measure of the distance from the axis. Please note that α(ϕ) is not to be confused with the field line label in the Clebsch representation of the magnetic field. We will compare this form to the general form of a weakly nonquasi-symmetric omnigenous magnetic field, given by (5.9), for the three symmetry classes.

Impossibility of omnigenity with constant on-axis magnetic field
Let us expand the magnetic fieldB(η), introduced in (4.1), about its constant on-axis value,B ≈B 0 + B 1 (η). (6.2) Note that we do not employ the expansion of § 5 here, which is inapplicable as the first-order fieldB 1 determines the magnetic well structure non-perturbatively when the zeroth-order fieldB 0 is constant. Within § 6.1, we will allow this to describe a possibly non-omnigenous field, that nevertheless does satisfy a more relaxed condition called 'pseudo-symmetry'. Pseudo-symmetry means that the contours of magnetic field all have a common topology -i.e. they all close poloidally, all close toroidally, or all close helicallywhich is a necessary but not sufficient requirement for omnigenity (Subbotin et al. 1999;Helander & Nührenberg 2011). To assert pseudo-symmetry we assume that (3.2) still applies, but with F not necessarily satisfying (4.3). Equating the two forms of the magnetic field, equations (6.1)-(6.2), we obtain at dominant orderB 0 = B a , i.e. a constant, and at first order 6.1.1. Toroidally or helically closed lines of magnetic field strength Let us consider the cases of toroidally or helically closed contours of constant magnetic field, taking ζ = θ − Nϕ and ξ = ϕ, where N = 0 for the toroidal case. Let us write α = α + Nϕ, so that (6.3) becomes B 1 (η) = d(ϕ)B a cos(ζ − α(ϕ)). (6.4) First, we note that pseudo-symmetric fields are consistent with (6.4), for instancē B 1 ∝ cos(ζ + c sin(ϕ)), with |c| < 1. This example is not, however, omnigenous since the contour of maximum field strength (i.e. η = 0) is not straight. In fact, omnigenous examples are not possible, which can be proved as follows. First we can determine d(ϕ) by evaluating (6.4) at the global maximum, η = ζ = 0, yielding .
(6.5) Equation (6.4) then becomesB We can show that the only omnigenous fields consistent with this form are quasi-symmetric. Note first that ifB 1 is omnigenous but not quasi-symmetric, then α must be a non-constant function of ϕ. However, the function 1/ cos( α) must then reach a global maximum at some value of ϕ. The coordinate ζ can be independently optimized to maximize the function cos(ζ − α), i.e. ζ = α or ζ = α + π, depending on the desired sign. This means that the magnetic field reaches its maximum at a point in the ζ -ϕ plane, which is inconsistent with the required topology of contours of constant η. Therefore we reach a contradiction and conclude that α must be a constant, i.e. the only possible omnigenous fields with toroidally or helically closed contours of magnetic field strength are quasi-symmetric.
6.1.2. Poloidally closed lines of magnetic field strength Finally, we consider the case of poloidally closed lines of constant field strength, taking ζ = ϕ and ξ = θ. We can show that pseudo-symmetric fields are altogether impossible. Fixing η = η c such thatB 1 (η c ) = 0, we consider a poloidal transit θ → θ + 2π. While the left-hand side of (6.3) remains constant, the argument of cos on the right-hand side must increase by 2π since the ϕ returns to its initial value at the end of the transit. Therefore, by the intermediate value theorem, this argument must pass through a zero of cos, making the right-hand side zero, contradicting the assumption thatB 1 = 0. Thus we find the only fields that satisfy (6.3) areB 1 = 0.
6.2. The case of varying on-axis magnetic field strength (quasi-isodynamic fields) We now consider the on-axis magnetic field strength to vary with ϕ (i.e. ∂B a /∂ϕ = 0 almost everywhere). This restricts us to the class of poloidally closed magnetic fields (e.g. quasi-poloidal symmetric and quasi-isodynamic fields). We thus henceforth fix the angles of the CS mapping to be ζ = ϕ and ξ = θ . For this case we find it is possible to construct first-order omnigenous fields, at least in a certain approximate sense. Note that quasi-poloidal symmetry cannot be achieved at first order because it requires d, a quantity proportional to the axis curvature, to be zero. A magnetic axis with zero curvature everywhere cannot be closed.
We now set the two forms of the magnetic field strength equal, i.e. by (5.9) and (6.1), and use η 0 = ϕ to obtain at zeroth order in and, at first order, B a (ϕ)d cos(θ − α) = η 1B 0 (ϕ) +B 1 (ϕ). (6.8) The first thing we notice is that although the left-hand side depends on θ, the term B 1 on the right-hand side depends only on ϕ, therefore, it must balance and cancel with part of the other term on the right-hand side. Formally, we may filter out the θaveraged part and ignore it since, by (6.8), it cannot affect the magnetic field strength, so it represents non-physical freedom in the functionB(η). That is, we assume η 1 to henceforth have no θ-average, and setB 1 = 0 without loss of generality. (This is entirely consistent with (5.8)-(5.7) since the filtering commutes with the ζ -shift.) Solving (6.8) for η 1 and using (5.7), we obtain Now we observe that the omnigenous form of F 1 , equation (5.8), expresses a sort of symmetry that can be written as Applying this condition to the expression for F 1 given in (6.9), we obtain an equation of the form a cos(θ + t 1 ) = b cos(θ + t 2 ) from which it follows that a = ±b and t 1 = t 2 + 2πn + (π ∓ π)/2; we choose the upper sign convention and take n = 0, obtaining and α(ϕ) = α(η b (ϕ)) + ι η(ϕ), for ϕ ∈ D iR . (6.12) To obtain (6.11), note thatB 0 (η b (ϕ)) =B 0 (ϕ) impliesB 0 (ϕ) = η b (ϕ)B 0 (η b (ϕ)). Equation (6.12) can be thought of as providing a way to construct the function α(ϕ) for ϕ ∈ D iR , given its dependence within D iL . Equation (6.11) provides a similar prescription for d(ϕ). Note that, assuming irrational ι, the function α cannot be consistently defined to force periodicity. That is, evaluating (6.12) at the global maximum, ϕ = 2π, we obtain α(2π) − α(0) = 2πι, which can only be a multiple of 2π if ι is an integer. This does not actually affect the periodicity of the first-order magnetic field, since, from (6.8) andB 0 (0) = 0, we must have d(0) = 0, implying that it is zero at ϕ = 0 (and therefore is periodic). In fact this must be true at all extrema ofB 0 , d = 0, at all local extrema, (6.13) which also follows from (6.11) if d is to be continuous at these locations. Even if the field strength is periodic, this does not automatically imply periodicity in derivatives of the magnetic field strength, but this would be too much to hope for, given that omnigenous solutions are generally non-analytic (Cary & Shasharina 1997). As we will see, periodicity is also not be so easily enforced for the full solution, but in the next section we will propose a way to repair these discontinuities.

Constructing quasi-isodynamic equilibria
In the previous section, we have demonstrated that the first order magnetic field strength of the near-axis expansion can be made consistent with the condition of omnigenity. This alone is not sufficient to solve the equilibrium problem. We must also demonstrate that there is a consistent solution of the equilibrium equation introduced by Garren & Boozer (1991a).
To apply the results of Garren & Boozer (1991a) to the present problem, however, we must account for the fact that the curvature of the magnetic axis will be zero at some toroidal locations (this follows from (6.13) as shown below). The conventional Frenet frame is discontinuous at points of zero curvature, when the normal and binormal unit vectors change their signs, which can be considered the typical case since it corresponds to first-order zeros of the curvature. Fortunately, we can employ a modified Frenet frame that accounts for these sign flips; a formal development of such frames is given by Carroll, Kose & Sterling (2013). Under reasonable conditions, this frame will be continuous everywhere, and its derivatives satisfy precisely the same equations as the traditional Frenet frame, so that the derivations of Garren & Boozer (1991a) proceed identically, with only the trivial modification of replacing the curvature with the 'signed curvature' κ s (ϕ) = s(ϕ)κ(ϕ), and reinterpreting the components of the coordinate mapping using the modified frame. Note that the sign s(ϕ) takes values +1 or −1, and switches at locations of zero curvature, and the normal and binormal unit vectors of the modified Frenet frame are given by multiplying those of the traditional Frenet frame by s(ϕ).
The equation that must be solved to find an equilibrium solution is a first-order nonlinear ordinary differential equation (ODE) for the quantity σ (ϕ), which can be interpreted as follows with the modified Frenet frame: the coordinate mapping is expressed to first order as x ≈ r 0 + X 1 n s + Y 1 t s , where r 0 (ϕ) specifies the magnetic axis, and, via its derivatives, also the signed normal and binormal unit vectors, n s (ϕ) and t s (ϕ). The iterative solution of the equilibrium equations leads to expressions for the components X 1 and Y 1 , so that the quantity σ is seen to be related to the amplitude of the in-phase part of the binormal component of the coordinate mapping (see Garren & Boozer (1991a) and Landreman & Sengupta (2018) for more details), whered is related to d as d(ϕ) =d(ϕ)κ s (ϕ). (7.3) Note that from this and (6.13) we see that the curvature must indeed be zero at extrema of B a . Although d generally changes sign at points of zero curvature,d can be continuous and non-zero at these places. Note thatd cannot have any zeros, for Y 1 to remain finite. Because of this, κ s and d must have zeros of the same order. Furthermore, the periodicity of X 1 cannot be achieved by setting the coefficient,d, of (7.1) to zero. Instead, periodicity of X 1 and Y 1 implies the constraints where the first should already be satisfied if d, satisfies (6.11). Given irrational ι, the second of these conditions is not consistent with omnigenity (6.12), which implies α(2π) − α(0) = 2πι. We will propose a possible way to overcome this in the next section. Finally, the equation that must be solved for σ (ϕ) is σ + (ι − α )(σ 2 + P) + Q = 0, (7.7) where P = 1 +d 4 /4, Q = −G 0d 2 (τ + I 2 /2), with G 0 , I 2 and τ (ϕ) being related to the poloidal current, toroidal current and torsion of the magnetic axis, respectively. Let us now summarize the problem of finding an omnigenous magnetic field at first order: first one can freely specify the on-axis magnetic field strengthB 0 (ϕ), an axis shape, (having zero curvature at the extrema ofB 0 ) and a function d(ϕ) satisfying (6.11). A function α(ϕ) can also be arbitrarily specified on D L but its dependence on D R is constrained by (6.12) which depends on ι. Therefore the solution of (7.7) for σ (ϕ) and ι, must be done consistently; see § 8 for the demonstration of this. In principle, this would complete the solution. However, as we have discussed, there is a conflict between (6.12) and the periodicity constraint on α, equation (7.5), and in the following section we propose a practical way to address this.

Controlled approximation of omnigenous fields
Because an omnigenous magnetic field (that is not quasi-symmetric) is necessarily non-analytic, such a field can only ultimately be physically realized by a smooth approximation. One approach, proposed by Cary & Shasharina (1997), is to truncate a series representation of an exactly omnigenous field, resulting in a smooth but slightly non-omnigenous one. Another idea is to specify a sufficiently smooth magnetic field that violates omnigenity in a controlled way -this, as we show below, can also simultaneously help resolve the conflict between omnigenity and periodicity, which was encountered in the previous section.
To ensure the appropriate behaviour of α(ϕ), equation (7.5), we introduce small matching regions near ϕ = 0, 2π, where α will be defined such that condition (7.5) is satisfied, while abandoning the condition of omnigenity there, (7.8) In region II where omnigenity is satisfied, equation (6.12) implies that α II may be written in terms of the function a(ϕ), defined on D L , Introducing c(ϕ) = a(ϕ) + (ι/2) ϕ(ϕ b (ϕ)), extending the definition of η b (ϕ) to D L such that it is its own inverse, η b = η −1 b , we can write α in a more symmetric form, To make further progress, let us make some simplifying assumptions. We assume symmetric, single-wellB 0 (ϕ), so that ϕ b (ϕ) = 2π − ϕ, and ϕ(ϕ) = 2ϕ − 2π. Equation (7.7) can be written as σ + γ (ϕ)(σ 2 + P) + Q = 0, (7.11) where γ (ϕ) = ι − α . The functions α I and α III must be chosen such that α(2π) − α(0) = 2πN, but are otherwise free. However, a particularly simple prescription is found as follows. We note that α II , as expressed in (7.10), is composed of a secular piece (ι/2 ϕ(ϕ) ), and an even period piece, which need not be corrected to satisfy periodicity. Thus, we extend α II into the buffer regions, and add a correction to the secular part. That is, we write α I = α II + α I and α III = α II + α III , where continuity of α requires that the correction goes to zero at the interface with the buffer ( α I (δ) = 0, and α III (2π − δ) = 0), and the periodicity constraint is satisfied via α I (0) = −Nπ and α III (2π) = Nπ. Taking α I (ϕ) and α III (ϕ) to be linear functions of ϕ then uniquely determines them, resulting in for δ ϕ 2π − δ, (ϕ − 2π)/δ + 1, for 2π − δ < ϕ 2π. (7.12) The function γ is then simply (7.14) We note that the integer N, introduced in (7.5), must be consistently set, taking into account the number of times the coordinate mapping rotates around the magnetic axis during a toroidal transit, so that θ behaves as a proper poloidal angle -i.e. it increases by 2π with a poloidal transit, but is periodic in the toroidal direction.
Note that ι only appears in the definition of γ (ϕ) in the matching regions, so we may consider solving (7.11) independently in the omnigenous region. Then, ι can be tuned in the matching regions to achieve 2π periodicity of σ . Assuming that, for small δ, the functions P, Q and γ can be considered constant in the matching regions, the proof of the existence and uniqueness of this value of ι in fact follows easily from the results of Landreman et al. (2019). A general existence and uniqueness theorem, i.e. allowing general α I , α III andB 0 , appears more difficult to prove.

Algorithm
We now describe how the equations of § 6.2 can be solved in practice numerically. The inputs to the calculation are the shape of the magnetic axis, the functions B 0 =B 0 (ϕ) and d(ϕ), a chosen width for the buffer regions α I and α III and a finite value of aspect ratio. The outputs of the calculation are ι, B 1 (θ , ϕ) = B 0 (ϕ)d cos(θ − α) and the shape of the elliptical flux surfaces.
The first step in the numerical solution is to compute G 0 and ϕ(φ) along the axis, where G 0 is the on-axis value of the coefficient G in B cov , and φ is the standard toroidal angle (i.e. the azimuthal angle for cylindrical coordinates). These calculations can be done by iteratively solving (2.20)-(2.22) in Landreman & Sengupta (2018), where = |dr/dφ| is the arclength increment. Beginning with the guess ϕ ≈ φ, fixed-point (Picard) iteration converges quickly. The sign of G 0 (i.e. whether B points towards increasing or decreasing ϕ) is a free input.
Next we solve the equation for σ , equation (7.7), using Newton's method. This solution procedure is similar to the one for quasi-symmetry described in § 3 of (Landreman et al. 2019), but with a few modifications. The discrete unknowns include values of σ on a uniform grid of N φ points in the domain φ ∈ [0, 2π/n fp ], where n fp is the number of identical field periods. The dσ /dϕ term in (7.7) is discretized using the pseudospectral differentiation matrix. For computing omnigenous solutions, it is convenient if none of the grid points lie exactly where the curvature vanishes; otherwise (7.7) would require evaluating d/κ = 0/0. To avoid points of vanishing curvature at both φ = 0 and φ = π/n fp (half-period), the grid points are shifted by one third of the grid spacing: φ j = ( j − 2/3)2π/n fp for j = 1 . . . N φ .
In addition to the unknowns σ (φ j ) there is one more unknown: ι. Corresponding to this additional unknown is one additional equation, reflecting the freedom to specify σ (0) (as discussed in the Appendix of Landreman et al. (2019)). In the common case of stellarator symmetry, this extra condition is σ (0) = 0. While ϕ = 0 is not one of the grid points, this condition can nonetheless be imposed by interpolating σ from the grid points φ j (using pseudospectral interpolation).
To apply Newton's method, the Jacobian is needed. One block of the Jacobian corresponds to the derivative of (7.7) with respect to σ , which is straightforward. Another block corresponds to the derivative of (7.7) with respect to ι, and in contrast to the quasi-symmetric case, here we must account for the fact that α depends on ι. Fortunately, in both the central region and buffer regions, α depends on ι as α(ϕ, ι) = ια ι (ϕ) + α 0 (ϕ), (8.2) for some functions α ι (ϕ) and α 0 (ϕ). Therefore the Jacobian block corresponding to the derivative of (7.7) with respect to ι is given by (1 − α ι )(σ 2 + P). Finally, once σ with self-consistent ι has been found, the result can be converted to cylindrical coordinates and a finite-aspect-ratio configuration can be generated using any of the methods described in § 4 of Landreman et al. (2019). For results shown below, we use the method of § 4.1. The resulting toroidal boundary shape in cylindrical coordinates can then be supplied to an equilibrium code such as VMEC (Hirshman & Whitson 1983).
Instead of solving equation (7.7) for σ , it is also possible to directly solve the equations for the near-axis flux surface shape in cylindrical coordinates derived in Landreman & Sengupta (2018). This approach is conceptually valuable since it makes no use of the Frenet frame, so one need not worry about discontinuities of the Frenet representation. The numerical solution can be obtained using Newton's method, as detailed in § 4.3 of Landreman et al. (2019). In contrast to the quasi-symmetric case, for the omnigenous case B 1 depends on ι through α. The block of the Jacobian corresponding to the derivative of the residual with respect to ι can again be evaluated by noting (8.2). We have implemented both this cylindrical coordinate approach and the Frenet (σ ) approach, and verified the results from the two methods converge towards each other as N φ → ∞. For instance, in the example of the next section with N φ = 101 grid points, the two approaches yield the same value of ι through 9 digits.

Example
An example of an omnigenous non-quasi-symmetric configuration constructed using this procedure is shown in figure 2-5. We begin by choosing the axis shape (8.3a,b) shown in figure 2(a), which has vanishing curvature at two points: φ = 0 and π. The Frenet normal and binormal vectors both display a discontinuous reversal in direction at these points. When viewed from above, e.g. from a viewpoint with R = 0 and z > 0, the axis has the shape of a racetrack oval, with the points of vanishing curvature at the middle of each straightaway. The oval is twisted out of the z = 0 plane so it has net torsion. We choose the on-axis field strength to be B 0 (ϕ) = 1 + 0.1 cos ϕ. Note that while the axis shape is symmetric under rotation by π, as in a device with two field periods, the field strength does not have this symmetry, so the number of field periods is one. where the coefficients were chosen to keep the elongation down at tolerable levels, ∼ 5. Further tailoring of the d(ϕ) function might yield lower values of elongation. We choose α = −3π/2 at ϕ = 0 and α = π/2 at ϕ = 2π. In region II, α = −π/2 + (ϕ − π)ι. We allocate the first 10 % and last 10 % of the toroidal domain to the buffer regions: α I occupies ϕ ∈ [0, π/5] and α III occupies ϕ ∈ [9π/5, 2π]. In the buffer regions we choose α to be a fourth-order polynomial in ϕ, enforcing continuity of α and its first two derivatives at the domain boundaries ϕ = 0, π/5, and 9π/5. (When α does not have a continuous derivative at these boundaries, the VMEC solution exhibits numerical oscillations near these points.) The shape of the resulting configuration is shown in figure 3, for aspect ratio 20. It can be seen that the shape resembles a Möbius strip. There is a pronounced twist in the shape near the region of maximum field strength. The toroidal extent of this twist corresponds directly to the width of the buffer regions. The constructed boundary shape is provided as input to the VMEC equilibrium code (Hirshman & Whitson 1983). According to the near-axis construction, the rotational transform is ι = 0.717. The rotational transform computed by VMEC is similar (0.70 on axis, 0.72 at the edge), and it converges to the value predicted by the construction as the aspect ratio is increased.
Given a VMEC solution, we then evaluate B as a function of Boozer coordinates using the code BOOZ_XFORM (Sanchez et al. 2000), to compare the achieved B to the B predicted by the near-axis construction. We find that B for the numerical equilibrium inside the constructed boundary (according to BOOZ_XFORM) converges to the desired function B(r, θ, ϕ) as the aspect ratio A increases. One aspect of this convergence can be seen in figure 4, which shows the convergence of the on-axis B to the target function 1 + 0.1 cos ϕ. For A 80, differences from the target function are barely discernible on the scale of the figure. Furthermore, the convergence of B at the boundary can be seen in figure 5. The total B is shown in the left column, with the target B 0 subtracted in the right column, and the three rows show three increasing values of aspect ratio. As A increases, the total B converges to the desired function, and B − B 0 converges to the desired B 1 . Finally, figure 6 shows how the difference between the target and achieved magnetic field strength scales with A. The difference between the target and achieved B is measured by the root-mean-square (r.m.s.) difference [ dθ dϕ(B VMEC − B construction ) 2 ] 1/2 . In this formula, B at the boundary is used. This r.m.s. difference is found to scale as 1/A 2 , as expected since the construction is done here through O( ).
8.3. Measuring deviation from omnigenity via 1/ν transport The collisionless confinement of trapped particle orbits also has a direct effect on neoclassical transport, which can be observed in the so-called 1/ν transport, determined by the effective helical ripple, eff (Nemov et al. 1999), , (8.5) FIGURE 4. As the aspect ratio A used for the construction increases, B on the axis of the numerical VMEC equilibrium inside the constructed boundary (solid coloured curves) converges to the desired target function (dotted grey curve).
where the summation of the magnetic well index j includes all wells in the interval [0, L s ] containing points where B = xB r is satisfied, R is a reference major radius, B r is a reference magnetic field strength, and Here we again encounter the factor Y of (2.5) that arises in the calculation of the bounce-averaged radial excursion ψ. This expression is complicated, but we note that it is essentially the square of the average of γ γ Y. For a perfectly omnigenous field, we therefore expect eff = 0. To test the quality of one of our constructed solutions, we generate an 'exact' numerical solution by using the magnetic surface shape at a finite radial position as an input for the VMEC code. Because we expect omnigenity to be satisfied only at first order (and only in the limit that the buffer regions are small), we expect γ γ Y ∼ O( 2 ). Noting the factor of |∇ψ| −2 ∼ O( −2 ) in (8.5), we find 3/2 eff ∼ O( 2 ). This predicted scaling is borne out numerically, as shown in figure 7. There, the numerical construction is carried out for several values of the buffer region size δ and the boundary aspect ratio A. For each case, the equilibrium is computed using the VMEC code, and then the radial profile of 3/2 eff is evaluated using the NEO code (Nemov et al. 1999). The numerical results show a scaling 3/2 eff ∝ ψ ∝ 2 as expected. Figure 8 demonstrates that the construction for omnigenity results in reduced eff compared to non-optimized configurations of otherwise similar geometry. In particular, we compare the configuration of § 8.2 to configurations with the same magnetic axis shape but circular cross-section in the plane perpendicular to the axis. We consider two types of these latter configurations. In the first, shown in green in figure 8, the radius of the circular cross-sections is independent of toroidal angle, leading to (e) (f) FIGURE 5. As the aspect ratio A used for the construction increases, B for the numerical VMEC equilibrium inside the constructed boundary (solid curves) converges to the desired target function (dotted curves). Panels (a,c,e) shows the total B at the boundary; (b,d,f ) shows B − (1 + 0.1 cos ϕ) at the boundary.
(nearly) constant B along the axis. In the second type of non-optimized configuration, shown in blue in figure 8, the radius of the circular cross-sections is made to vary with toroidal angle as ∝ 1/ √ 1 + 0.1 cos ϕ, so B 0 (ϕ) is matched to that of the constructed omnigenous configurations. Results are shown for two values of aspect ratio A, 10 (solid curves) and 80 (dashed). For each configuration, a numerical equilibrium is computed with the VMEC code and 3/2 eff is then computed using the NEO code (Nemov et al. 1999). At each value of aspect ratio, the constructed omnigenous configuration has smaller 3/2 eff than either of the non-optimized configurations. Thus, the procedure of § 8 does appear to be a practical way to generate finite-aspect-ratio configurations with reduced 1/ν transport. ] 1/2 , scales as A −2 . This scaling is consistent with the fact that the construction here is carried out through O( ).
FIGURE 7. For sufficiently large aspect ratio A and small buffer region width δ, the 1/ν transport magnitude 3/2 eff for constructed configurations is found numerically to be proportional to toroidal flux, as expected from the analytic calculation in § 8.3.

Conclusion
We have demonstrated that it is possible to directly construct approximately quasi-isodynamic magnetic equilibria near the magnetic axis, with low computational cost, as compared to conventional optimization. These solutions are valid to first order in the distance from the magnetic axis, and also satisfy omnigenity (zero bounce-averaged radial drift) at that order for all particle orbits except a small fraction that have bounce points in the neighbourhood of the point of maximum  . For given aspect ratio A, the omnigenous construction (red) results in lower 1/ν transport magnitude 3/2 eff compared to configurations with the same magnetic axis shape but circular cross-section (green and blue). magnetic field strength. This unconfined fraction, f no , can, in principle, be made arbitrarily small, at the cost of introducing sharp behaviour in the magnetic field. It is however unnecessary to make f no much smaller than the square root of the plasma collisionality, since the effective scattering frequency into and out of the unconfined region in velocity space is proportional to f 2 no . Our findings imply that quasi-isodynamic fields have the only possible magneticfield-strength topology that can be achieved near the magnetic axis that satisfies omnigenity while breaking quasi-symmetry. The present work therefore naturally complements the quasi-axial and quasi-helical cases explored in the two previous papers of this series (Landreman & Sengupta 2018;Landreman et al. 2019), giving a comprehensive set of tools for constructing stellarator equilibria optimized for collisionless particle confinement near the magnetic axis -recall that quasi-poloidal symmetry is not possible. A noteworthy advantage of quasi-isodynamic construction is the additional freedom, affording a much bigger space of possible configurations than can be achieved with quasi-symmetric construction. With the latter case, the magnetic field strength must be constant on the magnetic axis, and the main freedom is in the shape of the magnetic axis. With a quasi-isodynamic construction, the on-axis field strength is a free function, and there are two additional free functions of the toroidal angle, corresponding (roughly speaking) to the angle of poloidal rotation of the elliptical cross section (α(ϕ)) and elongation of the ellipse (d(ϕ)), which must only satisfy certain symmetry requirements.
We have found that the case of constant magnetic field strength is theoretically forbidden for quasi-isodynamic fields. Correspondingly, in our numerical constructions, we encountered a limit to how small the magnetic mirror amplitude could be made. This demonstrates a certain separation between optimization lines, i.e. local optimization would not likely stumble upon a quasi-axisymmetric configuration, while searching in the neighbourhood of a quasi-isodynamic one.
We studied the 1/ν neoclassical transport associated with some examples of equilibria obtained numerically, and confirmed the expected theoretical scaling of that transport in the distance from the magnetic axis. We noted that quasi-symmetry here seems to have an advantage due to the trapped particle fraction tending to zero on the magnetic axis -the magnetic field cannot vary in ϕ there -so that 1/ν transport (determined solely by trapped particles) tends more sharply to zero toward the magnetic axis. Both quasi-symmetric and quasi-isodynamic solutions, however, can be constructed with sufficiently small transport to give good (fusion relevant) stellarator design candidates.
To satisfy a certain periodicity condition in our solutions, it was necessary to introduce locations where the geometric condition of omnigenity is broken. This was done at locations of maximum magnetic field strength, to ensure that all but the marginally trapped particles remain well confined. We note however that the perturbation in the magnetic field strength goes to zero at these locations, mitigating the effect of the non-omnigenous component of the magnetic field on marginally trapped particles. Note that, generally, there exist very weakly trapped particles that drift a macroscopic distance during a bounce time, spending disproportionate time in the neighbourhood of the maximum magnetic field, but such particles cannot benefit from the cancellation of radial drift at the two ends of the magnetic well, afforded by the condition omnigenity as applied here. Perfectly confining them therefore requires a different strategy, namely satisfying zero radial drift locally, i.e. at points close to the location of maximum B (note that v d · ∇ψ = 0 exactly at the maximum). However, as discussed previously, it is unnecessary to perfectly confine these particles. We note that it appears possible to achieve smallness of the regions of unconfined orbits without incurring a cost in the smoothness of the magnetic field, if the rotational transform is close to an integer. It is a curious coincidence that Wendelstein 7-X stellarator does indeed have a near-unity rotational transform, though it was motivated by a different design principle (the island divertor concept).
Possible future continuation of work includes a stellarator design study, where traditional optimization methods are applied with initial states given by our directly constructed solutions; such an approach has the advantage of drastically reducing the parameter space that needs to be searched. It may also be possible to extend the expansion to higher order in the distance from the magnetic axis, though this would also require extension of the expansion of the CS map, as performed in § 5.