A complete topological invariant for braided magnetic fields

A topological flux function is introduced to quantify the topology of magnetic braids: non-zero line-tied magnetic fields whose field lines all connect between two boundaries. This scalar function is an ideal invariant defined on a cross-section of the magnetic field, whose integral over the cross-section yields the relative magnetic helicity. Recognising that the topological flux function is an action in the Hamiltonian formulation of the field line equations, a simple formula for its differential is obtained. We use this to prove that the topological flux function uniquely characterises the field line mapping and hence the magnetic topology. A simple example is presented.


Introduction
In this paper we present a complete topological invariant for so-called magnetic braids: magnetic fields in a flux tube with monotone guide field. Such magnetic fields arise, for example in coronal loops in the Sun's atmosphere (Reale, 2010), or in toroidal fusion devices (Morrison, 2000). In both cases, the magnetic field is embedded in a highly-conducting plasma so that the magnetic topology-or linking and connectivity of magnetic field lines-is approximately preserved. As such, topological invariants typically play a significant role in the dynamics of the plasma and its magnetic field (Woltjer, 1958;Taylor, 1986;Brown et al., 1999;Yeates et al., 2010;Candelaresi & Brandenburg, 2011). Figure 1 shows our simply connected "flux tube" V , with a set (ρ, ψ, z) of orthogonal curvilinear coordinates satisfying ∇z · (∇ρ × ∇ψ) = 0. The magnetic field B is assumed to satisfy B z > 0 everywhere in V , so that ∇z aligns with the "axis" of the flux tube. We take ψ to be an angular coordinate and ρ to be a radial coordinate in each plane of constant z. On the side boundaries of the tube, we require B · n = 0, so that all magnetic field lines stretch from one end D 0 of the flux tube to the other end D 1 . We can then define the field line mapping F : D 0 → D 1 by F (x 0 ) = f (x 0 ; 1), where f (x 0 ; z) denotes the magnetic field line rooted at x 0 ∈ D 0 . Two magnetic braids B, B are topologically equivalent if and only if one can be reached from the other by an ideal evolution with v| ∂V = 0 throughout. We shall assume that their respective field line mappings match on the side boundary, F | ∂D 0 = F | ∂D 0 , with the same winding number. In that case, B and B are  topologically equivalent if and only if F = F . Notice that F has two components. Our main result is to prove that a single scalar function, which we call a "topological flux function" is both necessary and sufficient to determine the topology. This we state in the following theorem.
Theorem 1. Let B, B be two magnetic braids on V , with respective field line mappings F , F that agree on ∂D 0 , with the same winding number. Let A, A be their respective topological flux functions with the same reference field It is well-known (Berger & Field, 1984;Brown et al., 1999) that having the same total magnetic helicity H r (which will be defined below) is a necessary condition for topological equivalence but not a sufficient one (two magnetic braids can have the same H r but different F ). Indeed there are an infinity of other ideal invariants. For example, if θ x 0 ,y 0 (z) denotes the orientation of the line at height z between a pair of field lines f (x 0 ; z) and f (y 0 ; z), then their pairwise linking number is an invariant (Berger, 1986;Berger & Prior, 2006). So are analogous higher-order measures of the linking between triplets, 4-tuplets, etc., of field lines. Theorem 1 asserts that all of these ideal invariants are contained in A because, mathematically speaking, it is a complete invariant. It is the most economical description of field topology equivalence classes that is sought by Berger (1986). In future, the topological flux function should provide a useful tool not just to recognise but also to quantify changes in magnetic topology during non-ideal evolutions. For an initial application to measuring magnetic reconnection, see Yeates & Hornig (2011). For the alternative geometry of a half-space, Berger (1988) introduces A as the helicity of an infinitesimal flux tube around a single field line. Indeed, Taylor (1986) points out that each closed field line yields such an invariant in a perfectly-conducting plasma. This paper aims to interpret these constraints in a different light. We show that Theorem 1 is a consequence of A being the action the Hamiltonian system of the magnetic field lines (Cary & Littlejohn, 1983). The Hamiltonian theory suggests an elegant expression for A in terms of differential forms that we exploit.
A less general form of Theorem 1 has recently appeared in Yeates & Hornig (2013). Here we present the results for a more general shape of flux tube with more general boundary conditions, and elaborate further on the Hamiltonian theory. We begin in Section 2 with the basic definition of A, before discussing the Hamiltonian interpretation in Section 3. The proof of Theorem 1 is given in Section 4 and two explicit examples in Section 5.

Topological Flux Function
We define the topological flux function A : D 0 → R as the line integral of A along the magnetic field line rooted at x 0 ∈ D 0 : (3)

As it stands, this definition is gauge dependent. Under a gauge transformation
We impose the gauge condition where A ref is the vector potential of a reference field B ref that matches B · n on ∂V but is otherwise arbitrary. This particular choice of gauge condition is motivated by the relative magnetic helicity (Section 2.1). Although this still leaves some freedom in χ, and consequently in A, it is enough to make A an ideal invariant. To see this, assume an ideal evolution The boundary conditions of v| ∂V = 0 and fixed n × A| ∂V mean that n × ∇Φ| ∂V = 0. Then, using the formula for the rate of change of a line integral over a moving domain (e.g., Frankel, 1997), we find Berger (1988) defines A as a "field line helicity", or limiting magnetic helicity in an infinitesimal flux tube around a single magnetic field line. Since our domain is magnetically open, we define a gauge invariant relative helicity (Berger & Field, 1984;Finn & Antonsen, 1985) relative to the

Relation to Magnetic Helicity
Assuming (4), the relative helicity may be written The last term is a constant (call it H ref ) which depends only on the choice of reference field. For the first term, let x 0 be the footpoint of the field line through x = (ρ, ψ, z), so that x = f (x 0 ; z).

Changing coordinates gives
Thus we see that A represents the helicity per field line.

Hamiltonian Interpretation
We will show in this section that the differential of A has the following succinct formula in terms of differential forms (Frankel, 1997), where h ρ ≡ ||∂(r)/∂ρ||, h ψ ≡ ||∂(r)/∂ψ|| are the coordinate scale factors.
Lemma 2. Let B be a magnetic braid with field line mapping F and topological flux function This formula will be used to prove Theorem 1 in Section 4. It may be understood physically by integrating along a curve γ ∈ D 0 , so that In vector notation, equation (13) reads where x 0 , y 0 ∈ D 0 are the start and end points of γ (see Figure 2). If y 0 = x 0 then γ is an open curve, and (14) expresses the fact that the field lines rooted in γ form a flux surface with A · dl = 0. This is the vertical shaded surface in Figure 2. On the other hand, if y 0 = x 0 then the curve is closed (the curve σ in Figure 2), in which case (14) expresses conservation of (vertical) magnetic flux in the corresponding flux tube.

A as an Action
It is insightful to derive Lemma 2 by interpreting A as an action in a Hamiltonian system. Suppose we parametrise a magnetic field line in terms of its length l as x(l), and think of the topological flux function as a functional, Then Cary & Littlejohn (1983) point out that extremising A for given A and fixed end-points gives the path of the field line x(l) through the domain. To see this, note that the Euler-Lagrange equations are ∂L ∂x j − d dl In our case, the Lagrangian is L = A · (dx/dl), so which is equivalent to Hence dx/dl is everywhere parallel to B, and x(l) is a magnetic field line. In fact, it is well known that the equations of the magnetic field lines are a Hamiltonian system. To show this, we follow Cary & Littlejohn (1983) and change the gauge of A so as to write the action explicitly in the canonical form of a Hamiltonian system. A gauge transformation A → A + ∇χ changes the integrand (the Lagrangian) to L + dχ/dl and also changes the integral (the action A), but leaves the Euler-Lagrange equations unchanged. If we which is a 1 degree-of-freedom Hamiltonian system in canonical form. The generalised coordinate is ψ, the generalised momentum is A ψ h ψ , and the Hamiltonian is −A z h z . Time is the z-direction, so our Hamiltonian is, in general, time dependent. The gauge where A ρ = 0 everywhere may be called a canonical gauge since it renders the Hamiltonian system in canonical form. For Theorem 1 it is sufficient that n × A| ∂V be in canonical gauge, so in practice we restrict the gauge of A ref to be canonical, i.e. A ref ρ = 0. The gauge A ρ = 0 is equivalent to writing B in the form B = ∇(A ψ h ψ ) × ∇ψ + ∇(A z h z ) × ∇z (Boozer, 1983;Yoshida, 1994).

Proof of Lemma 2
Given that A is the action in a Hamiltonian system, we can use known properties of Hamiltonian systems. Let f z be the "height-z" mapping of our field line system, defined by f z (x 0 ) = f (x 0 ; z). This mapping must preserve magnetic flux. In terms of differential forms, f * z ω − ω = 0, where ω = B z h ρ h ψ dρ ∧ dψ. Every Hamiltonian system preserves such a symplectic form ω. But notice that where α = A ψ h ψ dψ + A ρ h ρ dρ. The primitive α is called the canonical/Liouville 1-form. Assume now that A is in canonical gauge as above, so that α = A ψ h ψ dψ. Then Lemma 2 follows from the following argument (Haro, 1998). In canonical coordinates, Hamilton's equations have the formṗ If we define the Hamiltonian vector field x(t) ≡ (x q , x p ) = (q,ṗ), then Hamilton's equations may be succinctly written (Marsden & Ratiu, 1994) in terms of α as By the definition of the Lie derivative (Theorem 4.3.1 of Marsden & Ratiu, 1994), using Cartan's magic formula, and the fact that differentials and pull-backs commute, we have Integrating both sides from s = 0 to s = z yields the desired formula Taking z = 1 in this expression and recognising (19) gives which is Lemma 2.
To show that Lemma 2 holds even in non-canonical gauge, suppose that F * α − α = dA for some A. Under the change of gauge A → A + ∇χ, we find α → α + dχ, so But this is precisely dA in the new gauge (Section 2), so if the Lemma holds in one gauge it holds in any gauge.

Proof of Theorem 1
Lemma 2 allows for an elegant proof of Theorem 1.

Necessity
We already know that A is a necessary condition for topological equivalence, because it is an ideal invariant. But we can also see this from Lemma 2. Assuming F = F , it follows that so that A and A differ by at most an overall constant. But since F | ∂D 0 = F ∂D 0 (with the same winding number) we must have A = A (see Figure 3).

Sufficiency
To prove the converse-that A is a sufficient condition for topological equivalence-assume that A = A and define the mapping G = F • F −1 . Then, using Lemma 2, Now we determine the possible mappings G : D 1 → D 1 satisfying G * α = α, which Haro (1998Haro ( , 2000 calls "actionmorphisms". If α is in the canonical gauge A ref ρ = 0, then the possible mappings G that preserve α are known (Marsden & Ratiu, 1994, Proposition 6.3.2) to take the form of cotangent lifts where T is a diffeomorphism. Since ∂D 0 is not a line of constant q(≡ ψ), it follows from our assumption F | ∂D 0 = F | ∂D 0 that T (q) = q and hence that G q = q, G p = p. We see that G ψ = ψ.
Recalling that p = A ref ψ h ψ , we note in canonical gauge that B z > 0 implies that ∂p/∂ρ > 0. It follows that the coordinate transformation from (ρ, ψ) to (p, q) has non-zero Jacobian, and hence that G ρ = ρ. So G = id and therefore F = F .

Remarks
(i) If α is not in the canonical gauge, then G need not take the form of a cotangent lift. Indeed, the nature of the actionmorphisms appears to depend on the gauge of α. For suppose that G * α − α = 0 for some α. Then after a gauge transformation α → α + dχ we find so that G is no longer an actionmorphism in the new gauge. (ii) Notice that the property of whether or not two magnetic braids are topologically equivalent does not depend on the choice of reference field. This choice is arbitrary; all that matters is that the same reference field is used to compute both A and A. On the other hand, the nature of differences in A between two inequivalent braids may depend on the choice of reference: this is an issue for future investigation.

Examples: Magnetic Braids on a Cylinder
We conclude with two simple examples on the cylinder V = {(r, φ, z) : 0 ≤ r ≤ 4, −8 ≤ z ≤ 8}. The first serves to illustrate the theory with a simple magnetic braid where A may be calculated analytically, and the second to illustrate an important topological interpretation of A introduced by Yeates & Hornig (2013) for magnetic braids in the cylinder.

Centred Flux Ring
Take standard cylindrical coordinates ρ = r and ψ = φ, so that the scale factors are h ρ = h z = 1, h ψ = r. Consider the magnetic braid which consists of a localised toroidal "flux ring" in a uniform background field (Wilmot-Smith et al., 2009). For this field the field lines are and taking z 0 → −∞, z → ∞ in (37), the field line mapping is A vector potential in the appropriate gauge is Since A z ≈ 0 on all boundaries to high accuracy, the corresponding reference is A ref = (r/2)e φ , giving B ref = e z . One can then compute the topological flux function analytically, finding Notice that ∂A/∂r = − √ 2πr 3 e −r 2 /2 and ∂A/∂φ = 0. In this case α = (r 2 /2) dφ and we can verify that so that indeed F * α − α = dA.

Displaced Flux Ring
Suppose now that the flux ring is displaced from the origin and centred at (r = 1, φ = 0). Then the new vector potential is This is not topologically equivalent to the original example, so A must differ. One might expect that the A distribution would simply be translated, but Figure 5(a) shows that this is not the case: the profile of A within the disturbed region is no longer symmetric about the ring centre. This reflects the fact that A is a global quantity: it counts not just the horizontal flux of the ring itself, but how it is linked with the reference field B ref = e z . In (43), the reference field is asymmetrical with respect to the position of the flux ring.
This may be understood using the following alternative formula for A on the cylinder. Yeates & Hornig (2013) show that A(x 0 ) is the average pairwise linking number between the field line f (x 0 ; z) and all other field lines f (y 0 ; z). The linking number in this context (Berger, 1988) is the integral where θ x 0 ,y 0 (z) is the orientation of the line connecting f (x 0 ; z) and f (y 0 ; z) in the plane at height z. It is proved by Yeates & Hornig (2013) that As an aside, notice that equation (45) gives a formula to compute A directly from B without needing to know A. The asymmetry in Figure 5(a) arises due to differing c x 0 ,y 0 for different field lines f (x 0 ; z) through the flux ring. To see this, consider two field lines f (x 0 ; z) passing through the ring, but starting on opposite sides (Figures 5b and 5c). The contours show c x 0 ,y 0 as a function of y 0 for each of these x 0 . For y 0 within the ring itself, the c x 0 ,y 0 contours are the same in each case up to rotation, so these points make the same contribution to the integral (45). But for most y 0 outside the ring, c x 0 ,y 0 has the opposite sign in Figure 5(b) compared to Figure 5(c), because of the field line direction f y (x 0 ; z) < 0 in Figure 5(b) while f y (x 0 ; z) > 0 in Figure 5(c). Furthermore, since c x 0 ,y 0 is opposite in sign on the left and right of the ring, and since there is a larger area to the left of the ring, the net contributions to (45) from y 0 outside the ring differ in each case. This explains the asymmetry. In Section 5.1, the area to the left and right of the ring was the same, hence the symmetric A profile.