Spherical winding and helicity

In ideal magnetohydrodynamics, magnetic helicity is a conserved dynamical quantity and a topological invariant closely related to Gauss linking numbers. However, for open magnetic fields with non-zero boundary components, the latter geometrical interpretation is complicated by the fact that helicity varies with non-unique choices of a field’s vector potential or gauge. Evaluated in a particular gauge called the winding gauge, open-field helicity in Cartesian slab domains has been shown to be the average flux-weighted pairwise winding numbers of field lines, a measure constructed solely from field configurations that manifest its topological origin. In this paper, we derive the spherical analogue of the winding gauge and the corresponding winding interpretation of helicity, in which we formally define the concept of spherical winding of curves. Using a series of examples, we demonstrate novel properties of spherical winding and the validity of spherical winding helicity. We further argue for the canonical status of the winding gauge choice among all vector potentials for magnetic helicity by exhibiting equivalences between local coordinate changes and gauge transformations.

In ideal magnetohydrodynamics, magnetic helicity is a conserved dynamical quantity and a topological invariant closely related to Gauss linking numbers.
However, for open magnetic fields with non-zero boundary components, the latter geometrical interpretation is complicated by the fact that helicity varies with non-unique choices of a field's vector potential or gauge. Evaluated in a particular gauge called the winding gauge, open-field helicity in Cartesian slab domains has been shown to be the average flux-weighted pairwise winding numbers of field lines, a measure constructed solely from field configurations that manifest its topological origin. In this paper, we derive the spherical analogue of the winding gauge and the corresponding winding interpretation of helicity, in which we formally define the concept of spherical winding of curves. Using a series of examples, we demonstrate novel properties of spherical winding and the validity of spherical winding helicity. We further argue for the canonical status of the winding gauge choice among all vector potentials for magnetic helicity by exhibiting equivalences between local coordinate changes and gauge transformations.
Keywords: helicity, fluid dynamics, magnetic fields, topology, gauge theory, winding number (Some figures may appear in colour only in the online journal) * Author to whom any correspondence should be addressed.
Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

Introduction
Given a magnetic field B in a simply-connected volume V, the fact that it is divergencefree (∇·B = 0) implies that there exists, at least locally, some vector potential A such that B = ∇×A. Integrating their dot product over V leads to a quantity called magnetic helicity, H(B) =´V A · BdV, which is conserved in ideal magnetohydrodynamics [42] and in nonideal evolutions to a good approximation [3]. A finer-grained invariant, the field line heli-city´γ A · ds, is obtained by integrating A along integral curves γ of B, and is of increasing theoretical interest [28,36,38,43,44]. Similar invariants in hydrodynamics are the kinetic helicity H k (u) =´V u · ωdV of an incompressible, ideal fluid with velocity u and vorticity ω = ∇×u [25,29], and the kinetic streamline helicity´γ u · ds [11] for integral curves γ of ω. More generally, magnetic helicity is a special case of the Chern-Simons action [14],´V A ∧ dA written in the three-dimensional Euclidean metric, where A =  [4,5,18,33].
In order to render open-field helicity H(B) meaningful, it is crucial to obtain a canonical definition that depends only on the magnetic field B, especially for the open-field case when helicity is gauge-dependent. This has been achieved either by fixing a (gauge) choice of A (e.g. [20,34,46]), or by defining gauge-invariant quantities related to H(B). For the latter, the most common alternative is the relative helicity proposed by Berger and Field [5] computed from the given field B and some reference field B r sharing the same boundary components. In [34,35], it is shown that choosing B r is equivalent to fixing A, which suggests the inevitability that some gauge choice must be made, analogous to the necessary choice of reference frames in classical physics.
In Cartesian domains, Prior and Yeates [34,35] proposed a gauge choice called the winding gauge A W using which open-field helicity is equivalent to the average flux-weighted pairwise winding of (open) field lines. This choice makes the topology of magnetic fields solely responsible for helicity. It was inspired by the works of Moffatt [29] and Arnold [1] who demonstrated that the closed-field helicity is the average pairwise linking, or Gauss linking, of field linesan invariant from the field configuration. Pioneering work on the winding interpretation of open-field helicity was done for fields rooted in a single planar boundary [2,17]. Both point to the prospect of a geometrical (re-)definition of magnetic helicity based on curve winding.
In many applications, the domain of interest is inherently spherical, which invalidates the Cartesian winding interpretation of the open-field helicity aforementioned. Nevertheless, spherical open-field helicity remains well-defined and invariant given that the net normal flux is zero across boundaries-the condition required for the (global) existence of a vector potential [12]. An important example is data-driven modelling of the solar atmosphere, where magnetic fields are open and the build-up of magnetic helicity is proposed as a cause of solar flares and coronal mass ejections [31]. It would therefore be desirable to have an analogous, intrinsic interpretation for spherical open-field helicity that is based only on field configurations. This task is known to be non-trivial because, unlike planes, spheres are closed surfaces and have non-zero intrinsic curvature (e.g. [6,10,16]), which leads to the current lack of a canonical definition for pairwise winding of open spherical curves. Figure 1 illustrates key differences between the spherical and the existing Cartesian measures. Figure 1(a) shows a curve (in blue) helically winding around a radial line (in red). When the angular radius of the Topological intricacies of spherical curve entanglement that are not present in Cartesian domains. In (a), a radial line (in red) appears to transition from being wound by the helical curves (in blue) of increasing angular radii (with increasing transparency) to being disentangled. In (b) we see an isotopic 'belt-trick' type deformation that appears to entangle two initially parallel curves without moving their endpoints. helix increases, it becomes less clear whether the two curves remain entangled. Indeed, one might argue that the line is outside the region enclosed by the faintest helix. Such ambiguity would not be present in Cartesian domains. Furthermore, as figure 1(b) shows, there exists a deformation of a pair of spherical curves such that they can shed winding without crossing, even if they are initially not entangled, known as the Dirac belt-trick [8,40].
Despite these issues, we will nevertheless show in this paper that one can generalise the winding-based interpretation of open-field helicity to spherical domains by: (a) fixing a specific vector potential-the (redefined) winding gauge A W -suggested by the orthogonal, toroidalpoloidal decomposition [6,26]; and (b) proposing a definition of spherical winding of any pair of curves. This yields the desired geometrical form of open-field helicity in both Cartesian and spherical geometries, namely, where the double integral is taken over pairs of magnetic field lines x and x ′ crossing the surface S (a plane or a sphere). The integrand L B (x, x ′ ) measures the flux-weighted pairwise winding number, or mutual rotation, of the field lines-a geometrical quantity defined from the field itself without requiring a vector potential. While the Cartesian expression of L B (x, x ′ ) is well known, little is known about its spherical counterpart. Here, we will present a rigorous derivation in spherical domains using local coordinate systems. Note that the newly defined pairwise winding number of (open) spherical curves does not in general remain constant under isotopic changes, e.g. the belt-trick deformation, but when averaged over all field lines and weighted by magnetic flux, it yields an invariant which is precisely the open-field helicity H W (B) evaluated in winding gauge A W . We will also argue that using a different choice of vector potential or gauge is equivalent to measuring field line winding from different local frames of reference (see [34] for the Cartesian case). The winding gauge A W corresponds to the most 'natural' frame, reflecting the link between (spherical) winding and helicity.
The layout of this paper is as follows. In section 2, we fix notations and review the concept of magnetic helicity H(B). In section 3, we introduce the toroidal-poloidal decomposition from which we define the winding gauge A W and winding helicity H W (B). In section 4, we re-derive key results for Cartesian winding and helicity using a new formalism, preparing readers for the spherical case. Section 5 is central to this paper where we define spherical winding of curves and generalise the winding-based, intrinsic interpretation to spherical openfield helicity. In section 6, we demonstrate novel properties of spherical winding using a helixline pair and a belt-trick pair. We also include a sample calculation of winding helicity using bipolar magnetic regions (BMRs). Finally, in section 7, we exhibit equivalence between gauge transformations and local coordinate changes in the context of winding and helicity, providing further arguments for the canonical status of the winding gauge.

Preliminaries and notations
Let B(x) be a smooth, square-integrable (assumed for all functions henceforth) vector field in R 3 that satisfies ∇·B = 0 everywhere and decays sufficiently fast at infinity. We shall call B the magnetic field and define its curl as J ≡ ∇×B. The integral curves x(s) of the magnetic field B are called (magnetic) field lines, defined by By the Poincaré Lemma, there exists a vector field A(x) such that B = ∇×A globally, known as the (magnetic) vector potential. Note that A is not uniquely defined, as for any scalar function χ known as a gauge (field), we have ∇×(A + ∇χ) = B. The process of changing the vector potential given the field, namely, A → A + ∇χ, is called a gauge transformation. A gauge choice means that A or χ takes a particular form. For a simply-connected, orientable domain V ⊂ R 3 , the (magnetic) helicity of the magnetic field B is commonly defined as, see e.g. [26], As H(B) involves the vector potential A that is non-unique, under the gauge transformation A → A + ∇χ, it acquires a boundary term if ∂V = ∅, since wheren is the outward unit normal to ∂V and we used the divergence theorem. If the normal field component B n ≡n · B = 0 identically on ∂V, then the boundary term vanishes. In this case, H(B) is invariant for all gauges, i.e. gauge invariant, and such fields are called closed (with respect to V, same below). Otherwise, fields with B n = 0 are called open and H(B) in general varies with the gauge choice.
In this paper, we will focus on two particular geometries of domains V, namely (i) a Cartesian slab V = S z × (z 1 , z 2 ), with z 2 > z 1 , S z = R 2 as parallel planes labelled by z ∈ (z 1 , z 2 ), and (ii) a spherical shell V = S r × (r 1 , r 2 ), with r 2 > r 1 > 0, S r as concentric spheres labelled by radius r ∈ (r 1 , r 2 ).
Although our main interest is in the spherical case (ii), the Cartesian domain-in which winding and helicity is already well understood-will be important to frame our new formalism. The fact that both domains can be regarded as co dimension-one foliations is fundamental to our derivation. For brevity, we write S for the leaves S z or S r andn for the unit normal on each leaf transversal to the foliation, son =ê z andê r respectively.

Toroidal-poloidal decomposition and the winding gauge A W
In this section, we first review the toroidal-poloidal (or Chandrasekhar-Kendall) decomposition of magnetic fields, e.g. [6,13,26]. We then identify a 'simplest' choice of vector potential A W , which shall be called the winding gauge. This is motivated by Prior and Yeates [34] who proved the equivalence between Cartesian winding and helicity in finite, tubular domains. Similar interpretations in our domains of interest will be proved subsequently.

Toroidal-poloidal decomposition
In Cartesian slabs and spherical shells-seen as the foliation of nested surfaces S as in section 2-any magnetic field B(x) can be uniquely decomposed as where the toroidal component B T (x) and poloidal component B P (x) take the form such that the functions T(x) and P(x), called the toroidal and poloidal flux functions respectively, are defined as solutions to surface Poisson equations on each leaf S: Note that ∇ 2 S is the surface Laplacian or Laplace-Beltrami operator. In the case when S = S r , the existence of solutions should be consistent with the divergence theorem, which yields the following compatibility conditions: Also, to ensure the uniqueness of solutions, we shall impose in both cases the conditions Equations (5)-(9) are collectively known as the toroidal-poloidal decomposition. We present a brief justification of its validity using the Hodge Decomposition Theorem in appendix A, as a similar proof could not be found in the existing literature.
Using the Green's functions G(x; x ′ ) for the surface Laplacian ∇ 2 S when S = S z and S = S r (in the generalised sense) [15,21,22], equation (7) that define flux functions T and P can be explicitly solved as follows: where the relevant Green's functions G(x; x ′ ) are given by Note that the Green's function G(x; x ′ ) encodes the intrinsic metric of the foliating surfaces: |x − x ′ | measures the Euclidean distance for x, x ′ ∈ S z and x · x ′ /r 2 corresponds to the (cosine of the normalised) spherical distance for x, x ′ ∈ S r .

The winding gauge A W and winding helicity H W (B)
From B = ∇×A and the toroidal-poloidal decomposition equations (5) and (6), we can identify the general solution of the vector potential A as, see e.g. Moffatt & Dormy [26], where ζ is some scalar function of integration. (Or more precisely as equation (A.11) in appendix A.) In this paper, we shall focus on the 'simplest' vector potential A W with ∇ζ = 0 identically, namely, Note that it is related to equation (13) via a gauge transformation A → A + ∇χ such that ∇χ = −∇ζ, e.g. χ = −ζ, but such a choice is not unique. We shall call A W the winding gauge, as we will show that open-field helicity in this gauge is equivalent to the average flux-weighted pairwise winding of field lines. This name is motivated by Prior and Yeates [34] in which they first proved that such an interpretation holds for openfield helicity in Cartesian tubular domains with finite horizontal extents.
One can check that A W satisfies the property of vanishing surface divergence: for eithern =ê z orê r . This holds also for the original definition of A W in [34]. In addition, one can show that the winding gauge A W enjoys a special variational property: it minimises the surface integral´S |n × A| 2 d 2 S over all vector potentials, analogous to the minimal gauge for finite domains proposed by Yeates and Page [46]. Magnetic helicity defined using the winding gauge A W , whether the field is open or closed, will be called winding helicity, denoted H W (B), as In appendix B, we show that in the Cartesian case equation (16) may be written as while in the spherical case, In both cases the winding helicity density H(B; x, x ′ ) has the same form where B S = B −n(n · B) is the surface field component, ∇ S = ∇ −n · ∇ is the surface gradient operator, and G(x, x ′ ) is the relevant Green's function (12). For the Cartesian case, equation (19) is exactly the (flux-weighted) Gauss linking integral [27]. The definitions of spherical winding in section 5 will show how this expression is related to the linking integral in spherical domains.

Geometrical interpretation for Cartesian winding helicity H W (B)
For the case of finite Cartesian tubular domains, Prior and Yeates [34] showed that Cartesian winding helicity H W (B) is equivalent to the average flux-weighted pairwise winding of field lines, and thus interpreting helicity from a purely geometrical ground.
In this section, we will re-derive their result in Cartesian slab domains with infinite horizontal extent, i.e. V = S z × (z 1 , z 2 ), from a new perspective which shall be called the 'winding formalism' that will later be generalised to spherical domains in section 5. Let B to be an (open) magnetic field in V that in general B n = 0 on S z1 and S z2 .

Cartesian winding coordinates
The concept of winding originated from complex analysis, see e.g. [41] and as a relative quantity, winding is measured as the angular changes seen from some reference point along some reference direction. This description coincides with that of moving polar coordinate systems, prompting the following definitions of Cartesian winding coordinates in which a curve measures winding with respect to another. For We define Cartesian winding coordinates for this pair of curves by the right-handed, orthonormal basis vectors This is illustrated in figure (2) and may be called the Cartesian winding basis. The radial coordinates ξ = ξ ′ = |x − x ′ | corresponds to the Euclidean distance between x and x ′ , and the angular coordinates χ and χ ′ measures winding as curves entangle. Note thatê ′ ξ = −ê ξ andê ′ χ = −ê χ , so they were not separately treated in previous works, e.g. [34]. Nevertheless, we find it necessary to distinguish them, to prepare readers for the generalisation to spheres on which vectors must be locally defined and such a simple relationship no longer holds.
Using the winding basis, the Cartesian Green's function (12) for the surface Laplacian may be written as G(x, Cartesian winding helicity density H(B; x, x ′ ) in equation (19) then becomes: This strongly suggests that winding helicity H W (B) originates from 'relative turning effects', or mutual winding, of magnetic fields. We will next show how to interpret H(B; x, x ′ ) in terms of winding numbers of field lines using winding coordinates.

Cartesian winding angles
Cartesian winding basis as in equation (20) and letv ′ (t) =v ′ on x ′ (t) be an arbitrary but constant unit vector that serves as a reference direction.
We (implicitly) define the (instantaneous) winding angle of x(t) against x ′ (t) alongv ′ , denoted ωv′(x; x ′ ), as follows: where we decomposedv ′ in the x ′ -centred winding basis aŝ To eliminate multivaluedness, we further require ωv′(x; x ′ ) to be continuous, measured in the right-handed sense seen from the current North ('positively'), and such that ωv′(x; Combining with the fact that |v ′ | 2 = 1, we have

Cartesian winding rates
The exact value of the winding angle ωv′(x; x ′ ) depends on both the (instantaneous) reference point x ′ and directionv ′ . To obtain a winding measure that only depends on the former, consider differentiating equation (23) with respect to t while fixing x ′ (t), usingv ′ is constant in the second equality. One can check by computation that where dχ/dt is given by the decomposition of dx/dt in the x ′ -centred winding basis: Substituting equations (24), (26) and (28) into equation (27) gives which can be expressed explicitly in terms of both curves as Note that the rate of change of winding angle ωv′(x; x ′ ), i.e. dωv′/dt, is now independent of the reference directionv ′ . This implies that it is a more intrinsic measure of winding. With subscript dropped, we shall call dω/dt the (instantaneous) winding rate of x(t) against x ′ (t).
One could similarly have defined the winding angle ωv(x ′ ; x) of x ′ against x along (fixed) v on x and obtained the direction-independent rate dω ′ /dt ≡ dωv/dt as with dχ ′ dt similarly defined in x-centred winding basis as in equation (29). Note that both the Green's function G(x, x ′ ) and the winding helicity density H(B; x, x ′ ) are symmetric about x and x ′ , but neither equation (31) nor (32) are. To restore this symmetry, we further define their arithmetic average as the pairwise winding rate of curves x and x ′ , namely, 1 2 (dω/dt + dω ′ /dt).

Cartesian pairwise winding number
The integral of the winding rate (with respect to t) gives the cumulative change of winding angles, which is called the winding number. The individual winding number L(x; The factor (2π) −1 is conventional so that L(x; x ′ ) is an integer when both curves are closed [7]. Also, we define the pairwise winding number of curves x and x ′ as and it is symmetric about x and x ′ . By definition, all three measures are independent of the choice of the reference direction (provided it is fixed) on either curve.

Cartesian winding helicity H W (B) as flux-weighted winding
To interpret Cartesian winding helicity H W (B) in (22) using the pairwise winding number (34), consider an open magnetic field B in V = S z × (z 1 , z 2 ) whose field lines are z-monotonic curves and are thus z-parameterised without loss of generality. Let x, x ′ : [z 1 , z 2 ] → V be a pair of such curves, then the defining equation for field line x(z) can be written in the x-centred winding basis as with an analogous expression for dχ ′ /dz. Substituting into equation (34), we have where ξ = ξ ′ and equation (22) is used. From this we see that redefining the winding number to include the magnetic flux weighting, will give a density for winding helicity, so that This is the geometrical formula for Cartesian winding helicity H W (B) that was originally derived in Prior and Yeates [34] by explicit computation. Here, the double surface integral is taken over all possible pairs of field lines rooted at the base plane S = S z1 . Equation (39) links winding helicity to a quantity defined purely from the B itself without using a vector potential. It also gives H W (B) a computational advantage, recently exploited in the wavelet analysis by Prior et al [32]. Such a geometrical interpretation for H W (B) generalises the case of gauge-invariant, closedfield helicity as the average flux-weighted pairwise field line linking [1,29]. Indeed, one could use results proven in [7] to show that H W (B) reduces to its closed-field counterpart for closed field lines. This suggests that equations (38) and (39) should be considered as a more intrinsic (re-)definition for magnetic helicity in Cartesian domains.
For the general case when magnetic field lines are not z-monotonic, Berger and Prior [7] defined the pairwise winding number as the sum of pairwise winding numbers evaluated in z-monotonic subsections. They also showed that L(x, x ′ ) is a topological invariant under isotopy which extends to the winding helicity H W (B).

Geometrical interpretation for spherical winding helicity H W (B)
In this section, we extend the Cartesian winding formalism to spherical geometry, proving the equivalence between winding helicity H W (B) and spherical pairwise winding. The latter will be constructed and be of interest as a mathematical result.
Throughout, we take V = S r × (r 1 , r 2 ) to be a spherical shell and B to be an (open) magnetic field that in general B n = 0 on S r1 and S r2 . Recall that on each leaf S r , the (generalised) spherical Green's function G(x, x ′ ) for the surface Laplacian is given by On spheres, vectors must be defined locally in tangent spaces and vectors at different points cannot be compared directly. In contrast, it is common to treat vectors in Euclidean spaces as globally defined, as tangent spaces can be canonically identified. In this work, this distinction is emphasised by the use of different notations: Gothic letters, e.g. v, w, will be used for the local, surface vectors on spheres while the usual Italic letters, e.g. v, w, will be used for the global, Cartesian vectors in R 3 .

Spherical winding coordinates
non-antipodal points on the sphere S r0 for all r 0 ∈ (r 1 , r 2 ). We define two sets of (local) spherical winding coordinates: one set gives the position of x in spherical polar coordinates (r, ξ, χ) with x ′ as the North pole (we will call these 'x ′ -Northed'), while the other gives the position of x ′ in corresponding 'x-Northed' coordinates (r ′ , ξ ′ , χ ′ ) where x is the North pole. The corresponding right-handed, orthonormal basis vectors are These are illustrated in figure 3 and may together be called the spherical winding basis. While C.2 provides detailed derivations of equation (42), the polar coordinates ξ = ξ ′ represent the intrinsic, spherical distance (41) between x and x ′ along the great circle, whereas the azimuthal coordinates χ and χ ′ are used to measure spherical winding. The corresponding North pole in each basis assumes the role of the 'origin'.
Using the spherical winding basis, we can compute the surface gradients of the spherical Green's function (40) as Spherical winding helicity density H(B; x, x ′ ) in equation (19) then becomes The almost identical form of this result to the Cartesian one (22) suggests the existence of a similar interpretation based on winding of curves, which will be presented next. Nevertheless, the two expressions differ by the factor (up to constant scaling) As discussed in section 1, the lack of a canonical definition of pairwise winding of (open) spherical curves is the main obstacle for this generalisation. Before we propose the definition of spherical winding quantities analogous to those in section 4, we first discuss the geometrical nature of the factor Γ(ξ).

Stereographic projection and Cartesian reduction
The factor Γ(ξ) originated from the use of the stereographic map σ when deriving the (generalised) spherical Green's function (12), as shown in [22]. The map σ is a bijection from the unit sphere S 2 to the extended complex plane C ∞ ≡ C ∪ {∞} while being conformal or where (R, Θ) are the plane polar coordinates on C ∞ . In particular, σ(x ′ ) = 0 is the origin on C ∞ . Figure 4 illustrates its effect using colour schemes where it shows that regions further away from x ′ are 'stretched' more. From this perspective, spherical winding helicity (44) behaves precisely like the Cartesian version (22), if the magnetic field is scaled according to where x C (or x S ) corresponds to the coordinates on the foliated planes (or spheres). This gives a practical method to compute spherical winding helicity using a Cartesian setting, which we shall call 'Cartesian reduction'. However, if the Cartesian formula for helicity (22) is used naively for magnetic structures in spherical domains, the error can be significant. Consider the Laurent expansion of Γ(ξ) about ξ = 0, i.e. when curvature effects are small, we have The leading term recovers the Cartesian result (22) (by recognising r 0 ξ as the Euclidean distance between x and x ′ ), as the sphere is locally flat. As the angular separation ξ increases, the percentage error directly from (48) is approximately 2% for ξ = 30 • , 10% for ξ = 60 • and 20% for ξ = 90 • . While this is a very crude estimate, it shows curvature effect cannot be ignored for fields that exhibit global behaviour on spheres. As before, we first (implicitly) define the (instantaneous) spherical winding angle of

Spherical winding angles
where the last equality follows from the x-Northed decomposition ofv We again require ωv′(x; x ′ ) to be continuous, measured positively, and such that ωv′(x; x ′ ) = 0 whenê ′ ξ =v ′ . This allows us to obtain the expression of ωv′(x; x ′ ) modulo 2π, which is identical to the Cartesian version (25).

Spherical winding rates
We see in the Cartesian setting that it is possible to obtain a winding measure that only depends on the (instantaneous) reference point x ′ (t) but not the reference directionv ′ (t). We similarly consider differentiating equation (49) with respect to t while fixing x ′ (t), We notice that it is the second term on the right that distinguishes spherical winding from the Cartesian result (26). Spheres have non-zero curvature so that the reference directionv ′ (t) undergoes non-trivial parallel transport to stay covariantly constant on x ′ (t). This term can be computed from the parallel transport equation (C.16): where we identify The minus signs indicate thatê ′ ξ is defined in the direction of decreasing ξ ′ , opposite to that in C.3. Also, dχ ′ /dt is defined by the projections of dx ′ /dt in the x ′ -centred winding basis at x ′ , To conclude, this measures the winding contribution from the changing (though covariantly constant) reference directionv ′ (t) on x ′ (t) due to the curvature of the sphere.
For the other term in (52), we use the Cartesian expression (42) ofê ′ ξ while fixing x ′ (t), so that (using ξ ≡ ξ ′ and treating vectors as Cartesian) One can check that x ′ · dê ′ ξ /dt = 0 andê ′ ξ · dê ′ ξ /dt = 0, so dê ′ ξ /dt lies in the local tangent plane of x ′ and aligns entirely withê ′ χ . Then its magnitude can be computed from where dχ/dt is defined by the decomposition of dx/dt in the x-centred (or Choosing the sign that matches the Cartesian counterpart equation (28), which can be checked by computation, the first term on the right of equation (52) This measures the winding contribution of as the curve x ′ (t) entangles about x(t), as in the Cartesian case (30). Substituting both terms into equation (52): The spherical winding rate of x against x ′ , dω/dt ≡ dωv′/dt, is therefore manifestly independent of the reference directionv ′ (provided it is covariantly constant on x ′ (t)). An explicit expression in terms of Cartesian position vectors of both curves is Seen from x(t), the spherical winding angle ωv(x ′ ; x) of x ′ (t) along covariantly constantv(t) on x(t) and winding rate dω ′ /dt ≡ dωv/dt of x ′ (t) can be similarly defined. However, one can check that swapping x ↔ x ′ in dω/dt does not yield dω ′ /dt. This asymmetry between individual rates can be overcome by defining the spherical pairwise winding rate as the average of the two individual measures, namely, 1 2 (dω/dt + dω ′ /dt). This restores the symmetry present in the (generalised) spherical Green's function G(x, x ′ ) and spherical winding helicity density H(B; x, x ′ ).

Spherical pairwise winding number
Integrating the winding rate with respect to t gives the cumulative change of winding angle, which we shall call the spherical winding number. The individual spherical winding number The spherical pairwise winding number L(x, x ′ ) of curves x(t) and x ′ (t) is given by By definition, L(x, x ′ ) is symmetric about both curves and independent of the choice of reference directions on either curve. Also, the factor (1 + cos ξ) resolves the isolated case when x and x ′ are antipodal, i.e. when cos ξ = −1, for which we initially excluded. Hence, the spherical pairwise winding number L(x, x ′ ) generalises the Cartesian version (34), providing an intrinsic measure of winding for any pair of spherical curves. Similar results are not found, at least not in our explicit form, in the existing literature, so equation (64) should be of general mathematical merit.

Spherical winding helicity H W (B) as flux-weighted winding
Having derived the spherical measure of pairwise winding, the geometrical interpretation of open-field helicity can now be extended from the Cartesian to the spherical geometry.
Consider an open magnetic field B in a spherical shell V = S r × (r 1 , r 2 ) whose field lines are r-monotonic and without loss of generality r-parameterised. For a pair of such field lines x, x ′ : (r 1 , r 2 ) → V, the defining equation for x(r) can be written in the local or x-centred spherical winding basis as and similarly for x ′ . It then follows that Substituting into the spherical pairwise winding number L(x, x ′ ), we have where (1 + cos ξ)/ sin ξ = sin ξ/(1 − cos ξ) = Γ(ξ) is exactly the factor discussed in section 5.2. This then allows us to express helicity (density) in spherical domains as fluxweighted winding numbers defined by so that the geometrical form for spherical winding helicity H W (B) can be written as where the double surface integral sums over contributions from all pairs of field lines rooted on the base sphere S = S r1 . This is a significant generalisation of the Cartesian formalism in section 4, since spherical surfaces have non-zero intrinsic curvature. This again suggests that the average, flux-weighted winding of field lines should be adopted as a more intrinsic definition of open-field helicity. In general, field lines are not globally r-monotonic, but they can be split into r-monotonic subsections in which pairwise winding numbers can be individually defined and their sum yields the total pairwise winding of spherical curves, as explained by Berger and Prior [7].

Examples
In this section, we illustrate novel properties of the newly constructed spherical winding measures, compared with the Cartesian case. We will use the examples of a helix-line pair and a belt-trick pair (responding to the issues discussed in the Introduction), as well as a toy model of interacting magnetic active regions on the solar surface.
We work in the spherical shell V = S r × (r 1 = 1, r 2 = 3), with some fixed, spherical polar coordinates (r, θ, ϕ) with polar angle θ ∈ [0, π] and azimuthal angle ϕ ∈ [0, 2π). The choices of the radial extent and reference coordinates are merely for the convenience of description, as we have shown in section 5 that spherical winding and helicity are intrinsic to field configurations and not coordinate-specific.
Meanwhile, we calculate not only the symmetric, pairwise winding number L(x, x ′ ) for spherical curves x(t) and x ′ (t) as in equation (67) but also the individual winding numbers L(x; x ′ ) and L(x ′ ; x) as in equation (63). Both provide insight into how winding is acquired during curve entanglement.

Spherical winding of a helix-line pair
Consider a pair of (r-monotonic) curves shown in figure 1(a) where x L (r) (in red) is a radial line (r, θ L , ϕ L ), and x H (r) (in blue) is a spherical helix centred at (r, θ H , ϕ H ) starting from ϕ H = π with angular radius r h ∈ (0, π) (radians) and angular velocity ω > 0 (radians per unit parameter, right-handed seen from the North). This is the simplest, non-trivial configuration which shall be called a helix-line pair. All three winding quantities are positive and increase linearly, as the helix x H rotates righthandedly at a uniform speed. In particular, L(x H ; x L ) measures the (full or partial) number of turns completed by x H in the reference frame.
However, due to the asymmetry in the individual winding number equation (63) which arises from the intrinsic curvature of spheres, L(x L ; x H ) is not equal to L(x H ; x L ). In fact, as pointed out by Campbell and Berger [10], L(x L ; x H ) can be computed directly by the Gauss-Bonnet theorem, where κ g = cos r h / sin r h is the geodesic curvature of the helix x H with angular radius r h (as projections on the unit sphere). This agrees with our theory, but we have generalised this computation to any pair of spherical curves, not just the simple example.

Inside or outside?.
We return to the first example mentioned in the Introduction, as shown in figure 1(a), which is a helix-line pair fixed at North while the angular radius r h of the helix increases from 0 to π. In figure 5(b), we plotted the final (evaluated at r = r 2 ) spherical winding numbers, both individual and pairwise. We observe that the final individual winding number L(x H ; x L ) (in blue), representing the accumulated winding of the helix x H seen from the line x L , is independent on r h . This corresponds exactly to the total number of (full) rotations of x H in reference coordinates.
However, the pairwise winding number L(x L , x H ) (in black) does have an r h -dependence. As we parallel transport the reference direction on x H , the individual winding L(x L ; x H ) (in red) of x L seen from x H varies significantly. Indeed, its sinusoidal variation against r h is explained by equation (70) as The fact that L(x L ; x H ) changes sign as r h varies can also be understood by the changes in the sign of winding seen from the North and the transition for the line to reside 'inside' to 'outside' of the helix, both indicating the chiral nature of helicity. These observations are summarised in the  curves. Next, we will demonstrate another advantage of the pairwise measure using a different helix-line pair, shown in figure 6(a). Here the helix x H is again fixed at the North, i.e. (θ H , ϕ H ) = (0, 0), with r h = π/4 and ω = 2π. The radial line x L is moved continuously along (half-)circles ϕ = 0 and ϕ = π such that its polar angle θ L = θ when ϕ L = 0 and θ L = 2π − θ when ϕ L = π. We observe that in figure 6(b) there are discontinuities separating regions of constant winding. Discontinuities at θ L = 45 • , 315 • that are present in all three are topologically significant. Their occurrences indicate the transitions of the line from being 'inside' to 'outside' of the helix which are changes in the topology of the configuration.
However, the jumps in the individual winding numbers (in red and blue) at θ L = 135 • and 225 • are fictitious. They are recorded when the line crosses the 'mirror' helix (as shown in figure 5(a)), i.e. the antipodal image of the actual helix, where individual measures are illdefined. Fundamentally, this is associated with the well-known failure of a single coordinate system covering the entire sphere.
The pairwise winding number (in black), as the average of individual quantities, remains continuous at θ L = 135 • and 225 • , since both curves 'sense' this jump in an equal and opposite way. This also can be explained from the vanishing values of the factors Γ(ξ) in equation (44) and (1 + cos ξ) in equation (64) when ξ = π. Namely, no winding is recorded at antipodal points. This further demonstrates the superiority of the pairwise winding number over individual ones.

Spherical winding of a 'belt-trick' pair
The helix-line example highlighted some topological properties of spherical winding due to the non-zero curvature, as opposed to its Cartesian counterpart. Another difference between both geometries is the existence of the Dirac belt-trick or plate-trick, as mentioned in the Introduction in figure 1(b) and shown again in figure 7.  In this continuous deformation, the blue curve x B that is initially not entangled (a) to the radial line x L (in red) is taken behind the sphere (b)-(e) until back to a position where it winds around x L almost once. Figure 8 plots the changes in the spherical winding numbers as this occurs for the parameterisation shown in figure 7.
We observe that in figure 8(a) there is a continuous increase of the pairwise winding number L from approximately 0 to 1 during the isotopic, Dirac belt-trick. While in the Cartesian case, the (pairwise) winding number is a topological invariant under isotopy [7]. This illustrates the inherent impossibility to define a spherical winding measure that depends only on the footpoints of curves on bounding surfaces.

Spherical winding helicity of two BMRs in a dipole field
In the preceding examples, we considered spherical winding of curves not necessarily as integral curves of any field. When curves do originate from a divergence-free field, e.g. magnetic field B, then spherical winding helicity H W (B)-a flux-weighted average of all pairwise winding according to equation (69) -is known to be a topological invariant under ideal evolution if field line end-points on S r1 and S r2 remain fixed [46].
Here, we perform helicity calculations on a simple model of two BMR's that describe magnetic active regions on the solar surface. Our configuration consists of two localised BMR's centred on the equator, embedded within a (current-free) global dipole field aligned with the polar axis.
The two BMR's have the mathematical form used by [24,45], with in particular a negative twist parameter giving them negative 'self' helicity, in addition to any mutual helicity they have with each other or with the overlying dipole field. They are structurally identical but their strengths, denoted B 1 and B 2 , are varied. For example, when B 1 = B 2 two BMR's are the exactly same, and when B 1 = −B 2 the two BMR's are identical in shape but with reverse polarity. The latter case is shown in figure 9(a) with field lines (in white) and surface magnetic strengths (in greyscale).
For an independent verification of our formalism, we used a spherical implementation of the numerical method of Yeates and Page [46] which calculates the 'minimal helicity' of a discretised spherical magnetic field, namely imposing ∇ S · A W = 0 on S r1 and S r2 . As mentioned in section 3.2, the corresponding helicity is equivalent to spherical winding helicity H W (B). The solid lines in figure 9(b) show this calculated H W (B) for three different cases against the (equatorial) angular separation ξ of the centres of BMR's.
The main theoretical prediction from our spherical winding formalism is the asymptotics shown by dotted lines in figure 9(b). These were computed by scaling and translating the function to fit far-field values, where R(ξ) is the distance between BMR's in the projected plane from equation (46). The different asymptotic contributions in each case arise both from the differing values of B 2 and also from the differing winding of the BMR field lines with respect to the overlying dipole (see [43]). The reason for including two factors of 1/R(ξ) is as follows. Using the reduction equation (47) to 'flatten' a spherical field to an equivalent Cartesian field contributes 1/R. The other 1/R arises from the decay of the usual Cartesian winding helicity between two localised magnetic sources. This illustrates how the curvature can have a 'localising' effect: the 'mutual' winding helicity between two regions falls off more strongly with distance than would be the case in a Cartesian model.

Gauge transformations with respect to the winding gauge A W
In this section, we investigate how open-field helicity H(B) in the winding gauge A W , i.e. openfield winding helicity H W (B), is geometrically related to that in other gauges. We focus on the spherical case which includes the Cartesian case as a local version.
It is worth recalling that winding is a relative, or observer-dependent, quantity that needs to be measured from some reference point and direction. This manifests, as in section 5.4, in the definition of the spherical winding angle ωv′(x; x ′ ) of a curve x(t) seen from another curve x ′ (t) measured against a local, reference directionv ′ (t). For the winding interpretation to be bestowed on helicity H W (B), we definedv ′ (t) such that it is covariantly constant on the (moving) frame of reference x ′ (t), i.e. an initial choicev ′ 0 fixes all subsequent values by parallel transport.
However, one might argue for the degree of freedom of arbitrarily assigningv at every point provided the resulting winding is smooth. This is equivalent to replacing the covariantly constantv ′ (t) with another unit surface vectorŵ ′ (t) given bŷ wherev ′ Ψ (t) is not necessarily covariantly constant on x ′ (t). We can write the modified spherical winding rate of x(t) seen from x ′ (t) alongŵ ′ (t) as where dψ/dt is defined as the extra winding generated byv ′ Ψ (t). In contrast, dω/dt is directionindependent. This further leads to a change in equation (64) for spherical pairwise winding number L(x, x ′ ): where dψ ′ /dt similarly represents the additional winding of x ′ (t) as seen from x(t) due to a choice of a constant reference directionŵ(t) on x(t) that is not covariantly constant. We denote the second integral on the right by ∆L(x, x ′ ;ŵ,ŵ ′ ), which allows us to write the general expression for the spherical open-field helicity H(B) (in any gauge) respect to H W (B) The (spherical) winding angles ω are reminiscent of the phase angles of wavefunctions in quantum physics. This degree of freedom corresponds to rotations in the winding-measure directions, which is a particular form of local coordinate changes. Mathematically, smooth choices of reference directions everywhere in the domain are described by connections on a principal U(1)-fibre bundle used in the quantum formulation of electromagnetism. This is precisely associated with gauge transformations. Interested readers are referred to e.g. Naber [30] for an introduction.
Here we present an explicit proof of the equivalence of gauge transformations with local coordinate changes in the context of spherical open-field helicity. Consider an arbitrary gauge transformation A W → A W + ∇χ with respect to the winding gauge A W , this results in a change in winding helicity If we choose, for example, then substituting into equation (77), Comparing with equation (76), we conclude that the helicity change from the gauge transformation is induced by the changes in local coordinate changes of the type (73). The choice of χ is however not unique, e.g. any functionχ = χ + ∆χ satisfying ∆χ(r 1 ) = 0 and´S r 2 B r ∆χ dS = 0 is also valid.
Conversely, for a given gauge choice χ for the transformation A → A + ∇χ, we can recover the helicity change in equation (77) by performing local coordinate changes. For example, this can be achieved by for every pair of field lines x and x ′ . By symmetry, this corresponds to an extra rotation of constant rate in the local reference direction everywhere in the domain as in equations (75) and (76). Hence, we explicitly proved a correspondence principle between gauges and local (internal) rotations. Back to the winding gauge A W , we see that it corresponds to the only case (up to integration) for which ∆L = 0, i.e. no extra winding is generated from rotations of reference directions on each field line. This is the winding solely determined by the field. Formally, this is equivalent to the trivial case when the identity element of U(1), i.e. no rotation, is chosen everywhere in the domain (i.e. a trivial section on the U(1)-fibre bundle). Both facts can be used to argue that the winding gauge A W is a canonical choice for open-field helicity in spherical domains, as well as in Cartesian domains.

Summary and discussion
In this paper, by proposing a new definition for spherical pairwise winding of curves, we successfully extended the winding-based, geometrical interpretation for open-field magnetic helicity from Cartesian to spherical shell domains. We have proven that, in both geometries, the magnetic helicity in a certain gauge is equal to the average flux-weighted pairwise winding of all magnetic field lines. This generalises the fact that closed-field helicity can be understood as Gauss linking numbers. Since this particular helicity is intrinsically defined from the magnetic field itself, it sidesteps the issue of gauge dependence and defines a physically and mathematically meaningful quantity.
It is interesting to note that this winding gauge A W is a particular case of the gauge that arises naturally from the toroidal-poloidal decomposition of B in spherical (or Cartesian slab) geometry. Because the corresponding helicity has the interpretation as a mutual linking between the toroidal and poloidal fields, such a gauge has previously been suggested as appropriate for calculating open field helicity in spherical shells [6]. As discussed in [6], this helicity may also be interpreted as the relative helicity with respect to a potential reference field. Our work provides yet further physical justification for this choice, by providing an alternative interpretation in terms of winding numbers.
We have effectively elevated the winding gauge A W to a canonical status among all vector potentials via an argument using local frame choices for 'winding observers' following field lines. Frame-dependent quantities are ubiquitous in classical physics. For example, the relativistic energy E of a moving point mass depends on the observer's frame choice, namely, E 2 = (m 0 c 2 ) 2 + (pc) 2 , where m 0 and p are the rest-mass and three-momentum and c is the speed of light in vacuum. Among all inertial frames, the rest frame of the moving particle (with p = 0) measures rest energy E 0 = m 0 c 2 , which has an intrinsic meaning. This in turn grants the rest frame a privileged status.
The role of the winding gauge A W for open-field helicity is similar to that of the rest frame of a moving mass. When evaluated in A W (at least in Cartesian and spherical geometries), each field line measures flux-weighted winding contributions from surrounding field lines in its (covariantly constant) 'rest frame' and open-field helicity is nothing but the integrated average of all such contributions.
Gauge transformations with respect to A W correspond precisely to local changes in the winding-measuring reference, i.e. observers on each field line now measure 'fictitious' winding from other field lines in a 'moving frame', analogous to the concept of 'motional energy' in the above example. This degree of freedom in the winding-measuring reference directions is formally a local U(1)-symmetry, recovering links to the quantum formulation of electromagnetism from where macroscopic helicity originates.
Future investigations can be directed into the following aspects. Firstly, one can generalise the winding formalism of open-field helicity by defining meaningful winding quantities for more complicated domains. Examples include toroidal surfaces and perturbations to planes and spheres. Secondly, in the numerical modelling of the global evolution of magnetic fields on the solar surface, winding helicity can be calculated using the proper spherical formula. Thirdly, one can extend the wavelet analysis of spatial scales of magnetic structures using the Cartesian winding helicity [32] to the spherical geometry in search of cross-scale interactions of different magnetically active regions.

Data availability statement
No new data were created or analysed in this study.

Appendix A. Derivation of the toroidal-poloidal decomposition
Here we justify the claim that any (suitably smooth) magnetic field in a Cartesian slab or spherical shell may be decomposed as in equation (5). We will show that this is a consequence of the Hodge Decomposition Theorem for vector fields; a version that suffices our needs can be stated as follows [19,37,39]: Theorem 1 (Hodge Decomposition Theorem). Any finite, square-integrable vector field f(x) on a C 2 surface S ⊂ R 3 (assumed henceforth) may be uniquely decomposed as a normal component f n = τn and a tangential component f S which is a sum of divergence-free, lamellar and harmonic components: Heren is the outward unit normal to S. Relevant fields may be determined from ) For simply-connected surfaces, e.g. planes or spheres, one must have Ω S ≡ 0 [37]. For reference, we define relevant surface differential operators for any vector field g and scalar field h on S as follows: For our needs, let V = S t × (t 1 , t 2 ) be a foliation of S t continuously parameterised by t ∈ (t 1 , t 2 ) as parallel planes (withn =ê z ) or concentric spheres (withn =ê r ). Also, let B(x) be a magnetic field in V and suppose there exists some choice of vector potential or gauge field A(x) such that ∇×A = B. Applying theorem 1 to A for each S t gives existence of the unique decomposition where, according to (A.2)-(A.6), Taking the curl of equation (A.11), and simplifying the equations using thatn =ê z orê r gives Taking T ≡ τ − ∂ψ ∂n and P ≡ −ϕ gives the toroidal-poloidal form (5). To verify equation (7), note that (A.12) already gives ∇ 2 S P = −B n . Forn =ê z orê r , takinĝ n · ∇× (A.13) leads to ∇ 2 S T = −J n = −n · (∇ × B). Furthermore, adding functions of t to either T or P will not affect B in our choices of foliating surfaces, so we are free to arrange that P S ≡ˆS t Pd 2 x = 0 , and T S ≡ˆS t Td 2 x = 0 , ∀t ∈ (t 1 , t 2 ) . (A.14) letters, e.g. x, y, . . ., are used for surface vectors on S 2 which will be defined below. The main references for this appendix are Lee [23] and Brannan et al [9].

C.1. Tangent spaces and vectors
Suppose a point p ∈ S 2 has position vector x p which is also the local (outwards) normal vector on S 2 , then there is a unique, two-dimensional tangent space T p normal to x p , i.e.
which is isomorphic to R 2 . Surface vectors at x p on S 2 can only be defined in T p as tangent vectors; namely, a Cartesian vector v ∈ R 3 is regarded as a surface vector v p ∈ S 2 at p, if and only if v · x p = 0. It is therefore crucial to distinguish whether the vector is defined in R 3 or on S 2 . A smooth (surface) vector field v on S 2 is a smooth assignment of surface vectors everywhere on S 2 . For example, a magnetic field B consists of a normal component B r = (B · x p )x p , and an in-plane component B S = B − B r . Only the latter is a vector field on S r since B S · x p = 0, by definition.

C.2. Great circles, geodesic distances and separation vectors
Suppose A, B are distinct points on S 2 with position vectors x A and x B , respectively. They are called antipodal if x A = −x B . When they are not, there exists a unique great circle γ AB : [0, 1] → S 2 through A and B, which can be defined as the intersection of the plane OAB with S 2 .
Any arc of a great circle on S 2 is a geodesic, or length-extremising curve, between the endpoints and vice versa with respect to the (induced) metric on S 2 . It is the spherical analogue of a straight line on Cartesian planes. Using great circles, we define the spherical distance or geodesic distance between points A, B, denoted ξ(x A , x B ), as the Euclidean length of the shorter arc ⌢ AB of the great circle through them, given by ξ(x A , x B ) = arccos(x A · x B ) ∈ (0, π] . (C.2) Note that the case of antipodal points, i.e. when ξ = π, is included in equation (C.2) as it can be obtained from any great circle through both points. We define ξ(x, x) = 0 for all x ∈ S 2 . Indeed, one can prove that the geodesic distance provides a metric on S 2 . Surface vectors on S 2 arise as tangent vectors to curves. Given that A, B are non-antipodal with γ AB being the great circle through them, it is natural to define the mutually-pointing, unit tangent vectorê ξ,A (orê ξ,B ) to γ AB at A (or B), namely, where t is used to parameterise γ AB and both vectors are defined up to an undetermined choice of signs such that they point along the shorter arc. Bothê ξ,A andê ξ,B are called (geodesic) separation vectors.

C.3. Parallel transport and covariant derivatives
As surface vectors are locally defined on spheres, they cannot be directly compared like Euclidean ones so differentiation is ill-defined. Let (r, θ, ϕ) be a spherical polar coordinate system with polar angle θ ∈ [0, π] and azimuthal angle ϕ ∈ [0, 2π]. The coordinate basis vectors e θ , e ϕ can be defined as e θ = r(cos θ cos ϕê x + cos θ sin ϕê y − sin θê z ), e ϕ = r sin θ (− sin ϕê x + cos ϕê y ) , (C.11) in terms of Euclidean basis vectorsê x ,ê y ,ê z , and the orthonormal basis vectors are given as e θ = rê θ , e ϕ = r sin θê ϕ . (C.12) Consider a parameterised curve C : x(t) = (r, θ(t), ϕ(t)) on the sphere of radius r and a surface vector field f = f θ e θ + f ϕ e ϕ . The directional or covariant derivative of f along C is given as Using equation (C.11), we have, by explicit computations, ∂e θ ∂θ = −rê r , ∂e θ ∂ϕ = cot θ e ϕ ; ∂e ϕ ∂θ = cot θ e θ , ∂e ϕ ∂ϕ = − sin θ(cos θ e θ + sin θê r ) , (C.14) whereê r is the unit radial vector. Writingθ = dθ/dt and f θ ,θ = ∂f θ /∂θ etc we have df dt C = df θ dt C − f ϕ sin θ cos θφ e θ + df ϕ dt C + cot θ(f θφ + f ϕθ ) e ϕ . (C. 15) A vector field f is called parallel transported along the curve x if df dt C = 0 . (C. 16) This is known as the parallel transport equation, which can be used to determine the field parallel transported on the curve x given an initial value. Such a field is also called covariantly constant on x.