Quantifying the Tangling of Trajectories Using the Topological Entropy

We present a simple method to efficiently compute a lower limit of the topological entropy and its spatial distribution for two-dimensional mappings. These mappings could represent either two-dimensional time-periodic fluid flows or three-dimensional magnetic fields, which are periodic in one direction. This method is based on measuring the length of a material line in the flow. Depending on the nature of the flow, the fluid can be mixed very efficiently which causes the line to stretch. Here we study a method that adaptively increases the resolution at locations along the line where folds lead to high curvature. This reduces the computational cost greatly which allows us to study unprecedented parameter regimes. We demonstrate how this efficient implementation allows the computation of the variation of the finite-time topological entropy in the mapping. This measure quantifies spatial variations of the braiding efficiency, important in many practical applications.

We present a simple method to efficiently compute a lower limit of the topological entropy and its spatial distribution for two-dimensional mappings. These mappings could represent either two-dimensional time-periodic fluid fl+ows or three-dimensional magnetic fields, which are periodic in one direction. This method is based on measuring the length of a material line in the flow. Depending on the nature of the flow, the fluid can be mixed very efficiently which causes the line to stretch. Here we study a method that adaptively increases the resolution at locations along the line where folds lead to high curvature. This reduces the computational cost greatly which allows us to study unprecedented parameter regimes. We demonstrate how this efficient implementation allows the computation of the variation of the finite-time topological entropy in the mapping. This measure quantifies spatial variations of the braiding efficiency, important in many practical applications.
Mixing of fluid flows occurs in oceanic flows and industrial production (e.g. concrete mixing and chocolate mixing). For two-dimensional flows we can quantify the degree of mixing using quantities like the Lyapunov exponent or the topological entropy. Here we use a lower bound for the topological entropy and present an efficient and numerically accurate implementation which can be used to study flows, but also tangling of magnetic field lines in e.g. tokamaks. We show that our approach eliminates a large amount of unnecessary calculations while still maintaining a high level of precision. This approach is then used to compute a spatially dependent lower bound of the topological entropy to identify regions of high mixing and contrast them with areas of no mixing.

I. INTRODUCTION
We discuss the concept of the topological entropy 1 as a measure of mixing of fluid particles in a two-dimensional flow, or field line tangling in a three-dimensional vector field. The notion of topological entropy was developed in the context of dynamical systems, and has been used in the field of fluid dynamics to understand fluid mixing 2-4 . Such fluid mixing can be the stirring of a substance (solid or liquid) with applications in engineering and production. However, the need to quantify the mixing or tangling of trajectories appears also in other fields. For example, in plasma physics, particularly for magnetic fields in tokamaks and spheromaks 5 , the tangling of magnetic field lines is crucial for transport processes in the plasma, however, the concept of topological entropy has rarely been used in this context (notable exceptions are e.g. 67 ). In this case the magnetic field lines in a tokamak can be interpreted as world lines of a two-dimensional dynamical system. To make that interpretation complete we need to assume that the field is static and periodic in the direction of the field.
In the following section we will describe three different methods for measuring the topological entropy of a twodimensional flow (or three-dimensional periodic magnetic field). Each of these is based on the interpretation of the entropy as the exponential stretching rate of a material line in the flow. In order to apply the first two methods, one requires knowledge of the mapping at every point in the domain, while the final method deals with the case in which only a finite number of trajectories of the flow or field is known (i.e. the mapping is known only as discrete points).
After discussing the methods for estimating the topological entropy, we use our new method to explore the properties of two mappings that appear in the study of magnetic field dynamics in plasmas. Many laboratory and astrophysical plasmas are characterized by high magnetic and fluid Reynolds numbers, and as a result exhibit turbulent dynamics. This dynamics typically leads to a situation in which the magnetic field is highly disordered, with field lines being tangled or braided in a non-trivial manner. We are motivated to study the topological entropy in the context of these fields because it is now apparent that the nature of the field line tanglingi.e. the detailed magnetic field topology -is crucial in determining the field and plasma dynamics, in particular their relaxed state (e.g. [8][9][10][11][12] ). This is due to the conservation of various topological quantities. If magnetic reconnection is allowed, such fields relax into a state of potentially different field line topology (this topology being preserved in the absence of reconnection). Reconnection changes the field line mapping, which therefore changes the stretching behavior of the above mentioned material line. Typically the field undergoes some simplification which leads to a reduction of the stretching rate. In laboratory plasmas experimentalists are interested in the length of magnetic field lines until they hit the device's divertor plates which helps in estimating the safety factor 13 . Although the methods described here do not measure such lengths, they can be used to distinguish chaotic regions generated by the magnetic field.
At the end of this paper we propose a new measure that allows quantification of the local (in time) tangling of trajectories, important in many applications -the finite-time topological entropy. Finally, we consider the distribution of a passive scalar to demonstrate the efficiency of the mixing which will decrease length scales exponentially, provided the topological entropy is positive.

II. TOPOLOGICAL ENTROPY: METHODS OF ESTIMATION
A. Interpretation in terms of material line stretching An exact value for the topological entropy of a field or flow can be obtained only in special cases, for instance for some analytically prescribed shearing motions 2 , due to its complicated definition which involves taking the limits of refinements of coverings of a topological space 1 . Thus, for most practical purposes the entropy must be estimated, and there exist different methods by which this estimation may be performed. One such method makes use of symbolic dynamics 14 which computes a lower bound for the topological entropy. In this paper we focus on methods that determine the topological entropy h(f ) of a mapping (homeomorphism) where M is a compact subset of R 2 . This mapping f can be induced, for example, either by a two-dimensional timeperiodic flow or by the mapping of points between two planes connected by a static periodic magnetic field. The topological entropy h(f ) is approximated by the exponent h(f, γ) of the rate of stretching of a material line γ ⊂ M under the flow 15 , (2) Estimations of this stretching rate must be carried out by some computational method. In particular, for chaotic flows this is a numerically demanding task. In general the quality of the approximation of h(f ) by h(f, γ) depends on the choice of γ, and only a supremum over the set of all possible curves γ would yield the exact value of h(f ) 15 . However, for the examples of chaotic flows considered below, the approximation, h(f ) ≈ h(f, γ), is very accurate since under a few iterations of the mapping γ comes close to every point of the chaotic domain.
In our approximation of the topological entropy we measure the length of the line γ after each application of the mapping f . For a continuous, but time-periodic map f (t), f (t + T ) = f (t), we identify the number n with the number of periods T . The quantity we wish to measure is where |f n (γ)| denotes the length of the curve γ under n iterations of the mapping and ln + (x) = max(ln x, 0). For a numerical evaluation of this expression we discretize the initial curve γ using a high number of points x i , i ∈ [1, N ], along the curve and measure the distances δ i 0 , i ∈ [1, N − 1] between those. The corresponding distances under n iterations are called δ i n . For the limit of δ i 0 → 0 the numerical approximation becomes exact: Here the total length of the line after n iterations is i δ i n and its initial length is i δ i 0 . Note that the denominator in the logarithm is bounded and hence does not contribute to the value of the expression in the limit n → ∞.
Before going on below to describe algorithms for estimating the stretching rate, we first note connections with the calculation of the Lyapunov exponent. While in our calculations we compute a lower limit for the topological entropy by measuring the lengthening of a mapped line, the Lyapunov exponent measures the exponential separation of two neighbouring points x 0 and x 1 = x 0 + µm under the mapping f , with the real positive parameter µ and normalized directional vector m. The point separation after the application of the mapping n times is The maximum Lyapunov exponent can then be written as Note that in the standard definition a continuous time t is used instead of a discrete n.
A relation between the so called metric entropy and the Lyapunov exponent was derived by Pesin 16,17 . Using arguments from measure theory, it was shown that the metric entropy is, in general, smaller or equal than the sum of the positive Lyapunov exponents (Ruelle's inequality 18 ). For Riemannian measure on the manifold M the equality between the two quantities could be shown 16 . For a detailed discussion of the relations between the topological entropy, metric entropy, and Lyapunov exponents, the reader is referred to the discussion of Young 17 .
In practice we can only take the limit lim n→∞ for special cases. In all other cases we therefore compute h(f, γ) for a finite number of iterations n, finite line length and finite initial point separations δ i 0 . Since the mappings that we consider herein are dense within the attractor, the particular choice of initial line γ is not critical because for chaotic mappings the mapped curve γ gets arbitrarily close to every point in the domain for sufficiently large iteration n, as long as the initial line intersects the attractor. Since we can identify the iterations n of our mapping with a discrete time of a two-dimensional fluid flow, we call this quantity the finite time topological entropy (FTTE) and write it as with the integer n iter .

B. Direct Method: Adaptive Algorithm
Here we introduce an efficient algorithm for estimating the stretching rate of a material line under a given mapping. For positive values of the topological entropy the length of the material line γ scales exponentially with the number of iterations 15 . Hence, the challenge is to compute the exponential growth rate h of the length l of γ under iterations of f , which is a lower limit for the exact topological entropy 15 . It is worth noting that h will in general depend on the choice of curve γ -to find the tightest lower bound on the topological entropy of the flow we must find the maximal stretching rate for all possible curves γ.
During our computational implementation of the above procedure, an equal resolution everywhere along the curve at all iterations requires an exponentially increasing number of points. Moreover, one requires to analyze the mapping for a significant number of iterations (typically 10-20 for the mappings considered herein, as described below) in order to obtain an accurate estimate of the stretching exponent.
To combat this difficulty we introduce here an adaptive method that directly measures the exponential line stretching rate using a reduced number of points for each iteration of the mapping similar to 19,20 . To understand how this optimization of the resolution of the line works, note first that each iteration typically stretches and folds the material line -see e.g. Figure 2 and Figure 3. At any iteration the curve will be composed primarily of long sections with relatively low curvature, between which are line sections with very high curvature which need to be resolved in order to determine the total length of the curve accurately. For a fixed and initially equidistant distribution of points one requires a very large number of points (trajectories) to resolve the thin folds.
In order to reduce the total computational cost we apply an adaptive method which adds points where the curvature causes the angle between two consecutive line segments to be less than cos(α) = 0.99, where α is the angle. Those two line segments are spanned by three points. If the condition is fulfilled we add one point between the first and second points and another between the second and the third points on the initial line and apply the mapping on those new points. This refinement is repeated as long as there are two consecutive line segments for which cos(α) < 0.99 or until the refinement results only in a relative change of 10 −3 of the line length, which we call the relative length tolerance l tol parameter in our method. We do not add points if the length of the mapped line segment is less than 10 −5 in order to avoid issues related to the machine precision. That cut off number for the is the absolute tolerance l min . While refinement in high curvature segments was already used by 19 , the cut off criteria for not adding points do not seem to appear in the literature. Without them, the number of points can quickly rise well beyond what can be stored in a computer. This is somewhat mitigated by the "contour surgery" in 19 which effectively creates short cuts in folds that are sufficiently close together. However, such folds are an essential part of the advected material line and cannot be discarded for the computation of the topological entropy. In 19 the authors used a cubic spline interpolation that is able to counter such potential inaccuracies.

C. Stretching Rate Methods
An alternative to the direct method discussed above for estimating the line stretching rate is the set of algorithms proposed by Newhouse & Pignataro 15 . These methods estimate the stretching rate without explicitly fully resolving the mapped line. Conceptually, the idea is to estimate the growth of the line by measuring the stretching of tangent vectors to the curve under the mapping. After each iteration these tangent vectors are re-scaled before being mapped forward again, and the overall expansion factor is given by the products of the expansions during each iteration. In this process any mapped vectors that contract (as could occur for example across regions of high curvature) are neglected. The algorithm follows the same conceptual procedure as a common method of calculating Lyapunov exponents 21 .

D. Braid Entropy Estimations
A further method of estimating the topological entropy is described by Thiffeault 22 . This method differs from the two previously presented in that it is based on the assumption that one knows only a fixed number of trajectories (field lines) originating at discrete starting points rather than having access to the full flow information (as is required if one wishes, for example, to add additional points in regions of high curvature). The approach involves constructing a (mathematical) braid from these trajectories, and then finding the minimum length of a material loop that is constrained to wrap around the trajectories. Using the method of Moussafir 23 one can encode such a loop as a set of coordinates, which can then be used to evaluate the minimum possible length of the material loop. As such, the addition of more trajectories in the calculation will in general lead to a longer loop and so the topological entropy of the braid calculated in this way provides a lower bound to the topological entropy of the full flow (corresponding to the limit of infinitely many known trajectories, supposing that the optimal choice of γ has been made). For details of the algorithm and underlying theory the reader is referred to Thiffeault 22 . It is worth noting that in order to obtain an accurate estimation of the entropy with a small number of trajectories using this method one requires either to integrate the trajectories for a very long time or to average over ensembles of trajectories 3,22 , both of which are computationally expensive. The method is implemented in the freely-available braidlab package 24 .

E. Passive Scalar/Density
If we consider mappings, like the ones discussed here, to be world lines in a 2+1 dimensional space (two spatial and one temporal dimension) then we can consider the braiding as mixing of fluid particles. The degree of mixing is then reflected in the power spectrum of a passive scalar c(x). This scalar is constructed such that it initially has a constant gradi-ent profile in R 2 . Its Fourier transform is then simply where the volume V spans the two-dimensional plane. From that we can compute the power spectrum by integrating over k-shells of width δk The power spectrum is easily calculated for every application of the braiding once we know the transformed passive scalar distribution c(F (x)), where F (x) is the mapping. Since we know F (x) analytically we can also compute c(F (x)) analytically.
To test the mixing of this passive scalar under the mapping F (x) we impose an initial profile c(x) = x + y. This corresponds to a simple gradient in both the xand y-direction.

A. Hénon Map
We describe in this section some maps that we use to verify our new algorithm for estimating the topological entropy. We then go on to implement our algorithm to explore the properties of these maps. We first consider the well studied Hénon map 25 , given by with the parameters a and b and the iteration i. Here we will use a = 1.4 and b = 0.3 for which this map exhibits chaotic behavior. (Note that the mapping is not area-preserving and therefore could not be generated by an incompressible flow, except for b = ±1.) Newhouse & Pignataro 15 used this mapping to study their estimates for the topological entropy for different parameters a and b. For a = 1.4, b = 0.3 they estimated the topological entropy to have a value of 0.4640.

B. Blinking Vortex
Building on previous work 10, 26 on topology of magnetic braids we use two very similar maps, which are generated by blinking vortices. The first we call E1, which is defined by: where x i and y i are the coordinates, κ is the twist parameter, φ 1 and φ 2 the twisting angles from the left and right twist, respectively,x andỹ the mapped coordinates after the left twist only and x i+1 and y i+1 the mapped coordinates after the second twist. This formalism is chosen such that there is a twist around the point (−1, 0) with angle φ 1 and then around (1, 0) with angle φ 2 . The second such blinking vortex mapping we call S1 and differs only by the sign of the second angle, i.e. φ 2 = 2 √ 2πκ exp(−((x + 1) 2 +ỹ 2 )/2).

C. Standard Map
The standard map 27,28 (also called the Chirikov-Taylor map) is a mapping that can be derived from a magnetic field on a toroidal surface. It is defined as with θ i , φ i ∈ [0, 1]. By taking mod 1 we make sure that the mapping is periodic. A Poincaré map for the standard map is shown in Figure 1, where we can clearly see locations of periodic orbits. There are also regions of the map (particularly around θ = 0.5, φ = 0) where the Poincaré map appears highly disordered, and indeed Greene 27 demonstrated that for the parameter value chosen these regions are stochastic.

A. Benchmark of the Direct Method: Hénon Map
Since the Hénon map was studied using previous algorithms for estimating the topological entropy, we use it as a starting point to benchmark the new adaptive algorithm (of Section II B). We start with the initial line close to the fixed point at (0.883, 0.883) extending from (0.882, 0.883) to (0.884, 0.883) (this choice being directed by the considerations discussed in Newhouse & Pignataro 15 ). Applying our direct method we obtain an exponential increase in line length (see Figure 2). This is connected to the chaotic nature of the map, which leads to an exponential increase of distance between neighboring points. With increasing iteration step the number of points necessary to resolve the entire mapped interval increases exponentially, and so does the computational cost. Here we are able to reach 25 iterations with limited computation time. Similar to Newhouse & Pignataro 15 we fit the logarithm of the mapped line length using linear fit and find a slope of ca. 0.46275 (see figure Figure 2, lower panel) which is close to the slope of 0.4640 found by Newhouse & Pignataro 15 . This provides a confirmation of the accuracy of the new adaptive algorithm.

B. Direct Method: Blinking Vortex
Moving now to consider the blinking vortex mapping in Eq. (11), we apply the direct method to an initial straight line γ of length 4, starting at point (−2, 0) and ending at (2, 0). In order to gain insights on the stability of our calculations we also perform simulations with not just one initially horizontal line, but with 10 different straight lines of length 2 rotated about the origin. The final length has a minor dependence on the initial line's orientation. For each iteration we compute the mean line length of these 10 initial conditions and the corresponding standard deviation.
Depending on the parameter κ, the line gets highly tangled and shows thin folds (Figure 3, upper panel). Those folds are very frequent and need to be properly resolved in order to measure the length of the line accurately. With the adaptive method we achieve exactly this goal by increasing the number of points at those segments ( Figure 3, lower panel). In order to achieve the same degree of accuracy with a fixed point distribution, the number of points would need to be prohibitively large.
We plot the logarithm of the line length for different parameters κ against the number of iterations n iter (Figure 4). The length clearly follows an exponential law of type where the values of a and h depend on κ. While the length of the stretched line is weakly sensitive on the orientation of the initial line (by a few percent), this has little impact on the estimate of the entropy. For the fits in Figure 4 we use the standard deviation together with the mean values and obtain we see a similar increase with a similar slope, however we observe that the values are consistently below E1, consistent with the theoretical considerations of Boyland 2 .
To compare with the results of our algorithm we also perform calculations of the finite-time braiding exponent (FTBE) for the same test cases using the braidlab package. The results are very similar, as shown in Figure 5 (with a standard deviation of 2 × 10 −3 at h = 1.0419 for κ = 1). For these calculations, we stack 60 copies of the unit braid (E1 or S1), and use 10 samples of N trajectories (from a set of 1200) from this braid. N is increased from 500 to 1000 in steps of 50, and the entropy estimated by an exponential fit to the plot of mean FTBE versus N . Even the step for the S 1 case at κ = 1 matches with the results from the direct method. Although the results are very similar, the computation times are very different. To compare the computational efficiency of the two methods we measure the computation time it takes to converge to a value for h for the E1 braid with κ = 1. For the direct method we use the computed lengths in Figure 4 starting from n iter = 3 to compute h and the linear fit. By varying the total number of points used we obtain values of h that approach an asymptotic limit. We then use the computation time for each n iter and perform a fit of the form h(t) = h(1 − exp(−t/t 0 )), with the computation time t and convergence time t 0 . Similarly, we vary the number of trajectories used in the braidlab calculations from 200 to 1000, compute the value for the FTBE and measure the computation time. We then use the same fitting function as for the direct method. We run both methods for the E1 case with κ = 1 on 4 cores and observe a convergence time of 380s of computing for the braidlab package and 0.83s for the adaptive direct method.
In addition to the computation time, a further important consideration for measuring an exponentially growing curve is the memory efficiency. With increasing line length the number of points is expected to increase as well. To test if that is the case for our adaptive method, we plot the number of final points, after applying the mapping n many times, with the line length for values of κ between 0.1 and 2.5 and n iter between 6 (for higher κ) and 150 (for lower κ) (see Figure 6, h E1 direct E1 braidlab S1 direct S1 braidlab E1, lower bound FIG. 5: Estimate of the topological entropy for the E1 (solid blue line and asterisks) and S1 mapping (dashed green line and circles) in dependence of the parameter κ compared to the bradilab results for E1 (dash dotted red line and crosses) and S1 (dotted cyan line and diamonds). As a yellow hexagon we also plot the exact result for the lower bound for the E3 case for κ = 1.
blue circles). For comparison we also perform calculations with a fixed number of points that are equidistant. We vary that number between 10 2 and 10 8 and measure the length of the stretched line for this range of points. As expected, as the number of points is increased, the length of the line increases (as we obtain a higher resolution and avoid "short cuts"). We fit the logarithm of the line length in dependence of the number of (fixed and equidistant) points using a function of the form l(1 − exp(−λn p fixed )), where n p fixed is the number of points. From this we compute the number of necessary points ( Figure 6, red crosses) to reach a value of l 3% away from its asymptotic value. We clearly see that we obtain a different power law than linear which speaks against the efficiency of such a fixed line approach. Note that the value of 3% can be easily changed. However, the behaviour is the same (the power law becoming steeper for increasing desired accuracy). The fact that with a fixed grid the number of points required grows faster than linearly with the length of the line can be understood from the fact that, as the line length grows exponentially, so the number of folds grows exponentially, and these folds become (on average) tighter. For the adaptive method, the number of final points is clearly proportional to the line length which means that the adaptive algorithm is efficient. A further improvement would be to remove points where they are not needed, i.e. along very straight line segments. However, that would add computational complexity and we have not implemented it here.

V. LOCAL MEASURES OF MIXING EFFICIENCY
So far we dealt solely with estimating the topological entropy, the notion of which implicitly assumes a set of infinite trajectories (possibly within a periodic domain). However, in many applications of interest this condition does not holdthat is in practice we can only follow trajectories for a finite period of time. Indeed, even when trajectories can be followed indefinitely, the finite-time behavior may be more physically relevant. In any fluid mixing process, one would like to determine the effectiveness of the mixing over finite time. If one considers the case of a magnetic field threading a plasma, that magnetic field might not be embedded in a periodic domain. Even if it exists in a periodic domain (for example a tokamak or spheromak) the cases of interest are not stationary. Therefore, any given magnetic field structure exists only for a finite period of time, say t ∼ τ , and within this time period plasma particles can travel some given finite number of times around the device. As such, for a particle located at time t = t 0 on a given trajectory, one might like to know how entangled that trajectory is with neighboring trajectories for t 0 ≤ t ≤ t 0 + τ . The analysis of trajectories over finite time periods to determine their complexity is typically done by calculating, for example, Finite-Time Lyapunov Exponents (FTLEs) 29 , a technique that has been used extensively in characterizing unsteady fluid flows (e.g. 30 ). Such FTLEs measure only local deformation about a single trajectory. Other examples of measures of local stretching or deformation in the mapping include the finite time rotation number (FTRN) 31,32 , the Mean Exponential Growth factor of Nearby Orbits (MEGNO) 33 and the Generalized Alignment Index (GALI) 34 .
One approach that takes into account global (in space and time) changes is the computation of the boundaries of Lagrangian coherent structures 35 , an approach that can be extended to arbitrary dimensions 36 . However, it involves the calculation of spatial derivatives of the flow which makes it computationally less practical.
In additional to the local measures of stretching mentioned above, a topological equivalent (measuring complexity on finite scales), the so-called Finite-Time Braiding Exponent (FTBE), was recently introduced by Budišić & Thiffeault 3 (see also 22 ). A similar notion of finite-time entropy was introduced 37 in the context of the differential entropy, to measure finite-time stretching. Unlike the FTLE this measures (finite-time) non-linear stretching over a finite ǫ-neighbourhood of phase space -though it reduces to the FTLE in the limit ǫ → 0. While this is similar in spirit to the FTTE that we discuss here, there are fundamental mathematical differences between the two quantities; the finite-time entropy of Froyland et al. 37 , being based on the differential entropy, is more directly analogous to the metric entropy rather than the topological entropy. For discussion on how the differential entropy relates to the metric entropy and topological entropy see the review by Lesne 38 .

A. FTTE Distribution
The topological entropy characterizes the tangling of chaotic trajectories by a single number. If we wish to understand finite-time behavior of trajectories (or indeed if we only have finite-time trajectory information), then we would naturally like to characterize the trajectories locally in space as well as time (since we no longer have infinite trajectories that fill (a portion of) the phase plane). In this case, we propose that one may obtain useful information about behavior of the system at hand by analyzing the distribution of tangling within the domain. One would like, for example, to take a grid of initial trajectories and evaluate the local (in space and time) tangling per trajectory. Within the framework presented in Section II, this can be achieved by evaluating the FTTE over different curves γ that cover M . In particular, this distribution can tell us whether the domain is covered by multiple chaotic regions, and whether these are separated or mixed with regions of non-chaotic trajectories. This information is not given by the quantity h which measures the maximum value of the topological entropy on a given curve γ ⊂ M . In order to gain additional information about the structure of the mapping we need to measure h for curves γ which are embedded in distinct chaotic regions.
We first consider the blinking vortex mapping, in which the central portion of the xy-plane is chaotic (for sufficiently large κ), but we know that at large distances from the origin trajectories are not chaotic. From Figure 3 we see that the initial straight line is stretched out over a significant portion of the central part of the plane, although there are also clearly defined "empty" regions that the mapping does not reach. If those areas are invariant for each iteration we should be able to measure a different value of the FTTE in them from the surrounding regions where the stretched and folded line densely fills the space. In fact, we might measure vanishing entropy for some parts of the domain. In order to measure the dependence of the FTTE on the coordinates x and y we select an array of initial curves γ given by small circles located on a rectangular grid. These are then mapped forward as usual, and we monitor the growth of the length of the corresponding curves with the methods described above.
For our experiment we seed 111 × 111 circles within x = [−4, 4] and y = [ −4, 4]. Their radius is chosen such that neighboring circles are sufficiently far apart with radius r = 0.8 × 8/(2 × 110), where 8 is the size of the domain. In order to increase the resolution we also perform computations with circles at x = [ −4, 4] and y = 0 with 1001 circles with radius r = 0.8 × 8/(2 × 1000). We perform 20 iterations of the blinking vortex map (11) with κ = 0.5 and estimate the FTTE using the fitting function for the line length as given in Eq. (14). Since the data is rather fluctuating below n = 6, we discard points below this value when we perform the fit. We find a clear distribution for h with areas of h ≈ 0.6 and areas with h ≈ 0 (Figure 7). It appears that the domain for which h = 0.6 has a fractal like structure and resembles something similar to a Cantor set (compare the middle and lower frames in Figure 7). The same is true for the domain for which h = 0. Increasing the number of iterations improves the fit, and hence the calculation of the entropy. This also leads to a sharper divide with the range at 0 < h < 0.6 decreasingly populated. Similarly with fractals, or the Cantor set, we also observe self-similarity when we shrink the domain boundaries.
We also estimate the entropy distribution for the standard map (13) using the method of the initial circle distribution. Intuitively we expect vanishing entropy at the periodic orbits, and non-zero at chaotic regions. It is not immediately clear, however, if there is any characteristic value for the entropy. From the FTTE distribution we can confirm our intuition, and find vanishing entropy at periodic orbits ( Figure 8).
From the Lemma by Adler et al. 1 we know that for lim niter→∞ the topological entropy of the mapping is given as the maximum in the distribution. This is exactly what we see when we compare Figure 5 (for κ = 0.5) with Figure 7. Intuitively, this is easily understood as the dominance of the largest growth rate.
For a magnetic field in a toroidal plasma the existence of distinct chaotic regions has far reaching implications. Their boundaries determine regions which are not crossed by charged particles. It also implies that, given the connection of h and the finite time Lyapunov exponent, magnetic field line separation behaves differently for different regions. Such distinct regions were already computed in the past using the finite time rotation number 31,32 . They showed that it can be used to clearly distinguish disconnected regions that, in general, have different values of the FTTE.

B. Passive Scalar/Density
To further probe the structure of the blinking vortex map we consider the evolution of a passive scalar under successive iterations of the mapping as discussed in Section II E. We first show that for the blinking vortex motion, the passive scalar evolves identical to the fluid density. If we replaced the passive scalar c(x) by a density ρ(x) the result in equation (8) would be the same, because our mapping F (x) is volume preserving. This can be easily shown by using the pull-back on the volume 2-form dx ∧ dy: where x and y are the coordinates of the initial points. Hence, the mapping F (x) for the blinking vortex motion describes an incompressible flow. Successive iterations strongly mix the initial distribution for the passive scalar c(x) (Figure 9, upper panel). The mixing is, however, not homogeneous. We can identify regions with weak mixing and regions with strong mixing. This is reflected in the power spectrum ( Figure 9, bottom panel) where we clearly see a noisy, but flat spectrum arising, which implies the non-existence of a characteristic length scale. The presence of a characteristic length scale would have shown up in the power spectra. Such a scale should have then decreased with successive applications of the mapping. Its absence shows that the stirring happens on all scales. This is consistent with the identification of a fractal-like structure to the FTTE distribution in the previous section.
It is remarkable that the shortest length scale with some measurable power changes rapidly with the number of iter- ations. In fact, we can see an exponential decrease in the smallest length scale, as illustrated by the exponential function ( Figure 9, lower panel). For a mapping with positive topological entropy, as in this case, we expected such a behavior, since any initial line is being stretched exponentially with the consequence that points on the line move exponentially close to other points on the same line leading to thin structures.

VI. CONCLUSIONS
Here we introduced a direct method to reliably and efficiently calculate the lower limit of the topological entropy for a mapping F : R 2 → R 2 . Such mappings can arise from either two-dimensional time-periodic fluid flows or threedimensional magnetic fields, which are periodic in one direction. The new method simply measures the stretching of a material curve and the topological entropy is estimated as the exponential growth rate of the line length. By employing an adaptive approach we are able to study larger numbers of iterations without loss of precision. However, the direct methods should not be applied without restrictions. For highly tangled fields (highly mixed flows) and for very long iterations the computation time increases exponentially. This is not the case for the braidlab package. However, the braidlab performs significantly worse for the examples tested here for which our method is faster. In case of the E1 configuration with κ = 1 we find a speed up of a factor of ca. 450 in favor of the direct adaptive method on a 2.4 GHz quad-code Intel Xeon with 32 GB RAM.
The stretching of the initial curve, and hence the topological entropy, is not homogeneous in the domain. By measuring the lengthening of a distribution of circles, we show that the finite time topological entropy can exhibit a complex spatial distribution. For one of the maps used here, it shows a Cantor set like distribution, with alternating zero and finite entropy. This is confirmed by the mapping of a passive scalar for which we compute its spatial distribution using a Fourier transform. There we observe an exponential decrease in length scale for the passive scalar. This was expected, since the mapping used exponentially increases any line length.