Practical Concepts for Design, Construction and Application of Halbach Magnets in Magnetic Resonance

This review is a compilation of relevant concepts in designing Halbach multipoles for magnetic resonance applications. The main focus is on providing practical guidelines to plan, design and build such magnets. Therefore, analytical equations are presented for estimating the magnetic field from ideal to realistic systems. Various strategies of homogenizing magnetic fields are discussed together with concepts of opening such magnets without force or combining them for variable fields. Temperature compensation and other practical aspects are also reviewed. For magnetic resonance two polarities (di- and quadrupole) are of main interest, but higher polarities are also included.


Introduction
The invention of rare-earth magnets (typical properties are summarized in Appendix A) in the 1970s to 80s changed the way magnets could be designed, because they have much higher coercivities (magnetic "hardness") than formerly used AlNiCo or ferrite-permanent magnets.This fact allowed assembling magnetic flux sources similar to "toy blocks", because the magnets hardly impair their magnetic properties.Their high remanence and their low permeability permitted to design very strong but compact permanent magnets using analytical approaches.One of the pioneers in this field was John C. Mallinson, who together with Klaus Halbach invented what nowadays is referred to as "Halbach arrays".Their concept is based on a spatially Prepared for submission to a special issue of Applied Magnetic Resonance dedicated to the 70 th birthday Bernhard Blümich.
oscillating magnetization in rare-earth magnets that produces enhanced magnetic flux only on one of their sides.Generalization then led to cylinders, spheres etc. with extremely strong and homogeneous magnetic fields of variable polarity, which naturally found many applications in various fields.
The properties and uses of Halbach magnets have already been reviewed several times [1][2][3].However, there has been only little focus on practical aspects in magnet construction.It is the aim of this work to show, how the magnetic fields of Halbach multipoles can be estimated and which design criteria are critical, how they can be built and what further options can be implemented.All this is done with emphasis on applications in magnetic resonance.During the last two decades Halbach dipoles have developed from tinkered lab-instruments to full commercial products 1 for benchtop NMR-relaxometry and spectroscopy.They work at magnetic fields from 1 to 3 T with homogeneities in the ppb-regime.Nevertheless, this field is still quite active in research, particular in developing portable MRI-scanners for the human head [4][5][6][7] for point-of-care application and to provide more affordable instrumentation for developing countries [8].On the other hand, they have also been designed for EPR [9,10], and DNP [10][11][12].
For magnetic resonance applications the interest in generating multipolar magnetic fields is typically limited to dipolar (for homogeneous magnetic fields) and quadrupolar (for homogeneous field gradients) arrangements.For completeness, however, higher polarities are touched at some points, but lengthy details are placed in appendices.The design of multipoles is interesting for particle traps in fundamental physics [13,14], accelerators [15][16][17][18], motors [19], bearings [20], and linear machines [21].Recently, they have also found use in techniques to guide magnetic nanoparticles remotely [2,22] and in the emerging field of magnetic particle imaging, MPI [23].
This review is structured as follows: The concept of single-sided flux is introduced with Mallinson's planar array (Sect.2), which is then intuitively generalized to cylindrical Halbach multipoles (Sect.3).After their principal field is introduced, this ideal case is step by step applied to more realistic structures.Each of these steps is accompanied by analytical expressions for the consequences on the magnetic flux inside them.The discussion of possible demagnetization concludes this section, which allows a basic design and choice of suitable materials.Section 4 deals with various strategies to homogenize the field in the plane of the magnet and along its axis using passive, mechanical and active shim strategies.Finally, Sect. 5 introduces concepts to open Halbach multipoles without force, combine them for variable field sources, achieve temperature compensation and give some practical hints for manually assembling such magnets.

Planar Halbach Arrays
In 1973 Mallinson [24] published the idea of what he considered a magnetic curiosity then, a planar permanent magnet with a magnetization pattern that results in single-sided flux.The conceptual idea is illustrated in Fig. 1, in which magnets with quadratic cross sections are arranged such that their flux cancels on one side and increases on the other.An analytical expression for this one-dimensional magnetization pattern along x is also given in the original publication where k ′ is the wave number (spatial frequency) or the wavelength of the pattern (cf.Fig. 2a).The resulting field above the surface (y > 0) of such a structure of thickness d (and infinite length in z) is then where B R is the remanence of the magnetic material (for typical values see Appendix A).The magnetic field components B x and B y are harmonic functions outside the magnet material.As a consequence, the sinusoidal variation in the horizontal direction goes together with an exponential decay in the vertical direction.Nowadays, many household magnets (see Fig. 2b) and magnetic foils have such magnetization patterns.This has the advantage that the holding force is roughly doubled per magnet weight and magnetic foils can be made thinner and more flexible.Other applications of such magnetization patterns are in the inductrack magnetic levitation [21] or wigglers and undulators to generate synchrotron radiation [25].
If half a wavelength of such a pattern is rotated parallel to an offset axis, permanent magnets with axial fields can be generated (cf.Fig. 2c).However, the end effects will be strong and have to be compensated e.g. by material thickness [26,27].Halbach then later generalized this concept to cylindrical [28] and spherical [29] arrangements to create multipolar magnetic fields.Due to his pioneering work in this area, these arrangements are usually all named after him.The pattern shown in Figs. 1 and 2 will typically be referred to as a 1D, linear or planar Halbach array.
(2) The magnetic material (gray) has a magnetization (red arrows) pattern, which varies according to Eq. ( 1) along x and is constant along y over a thickness d, while it is infinite in the third dimension.This produces a recurring magnetic field (blue flux lines) on one side with wavelength .b Photograph of iron filings on a household magnet with ca. 3 illustrating the flux pattern of a.The magnetic flux on the opposite side is negligible.c If a /2 section of such a magnet is rotated around an axis at some distance parallel to its surface, a hollow cylinder with axial field is produced.Under certain conditions this field can be quite homogeneous but is limited to certain aspect ratios.Note that this is NOT a typical Halbach cylinder as discussed in Sect.3, since its field direction points in axial direction (color figure online)

Cylindrical Halbach Multipoles
If a planar Halbach array of length is now wrapped around a cylinder like illustrated in Fig. 3a, the variable x in Eq. ( 1) needs to be replaced by a position angle = 2 x/ or x = /(2 ).However, the fact that the magnetization is now lying on a cylinder at an angle must be taken into account by adding this angle to the magnetization position (cf.Fig. 3a).Hence, the magnetization of a cylindrical magnet with one wavelength, i.e.M( ) = M 0 (sin 2 , cos 2 ) , yields a homogeneous (dipo- lar) field.If two wavelengths of a planar Halbach array are bent to a cylinder (cf.Fig. 3b) the same arguments then result in M( ) = M 0 (sin 3 , cos 3 ) and so forth.
If this concept is generalized in rolling planar Halbach arrays of length k up this way, multipolar fields of polarity p = 2|k| are produced (dipole for |k| = 1 , quad- rupole for |k| = 2, etc.).The basic design idea is illustrated in Fig. 4a, where the coordinate system has been changed in order to have = 0 along the x-axis.It is still an idealized magnet with the shape of a hollow cylinder or ring of infinite length and continuously varying magnetization direction.The angle of the magnetization direction, , depends on the position angle, , (cf.Fig. 4a) as Figure 4b-g illustrate how the modulus of k determines the polarity, p = 2|k| , and its sign the location of the produced magnetic field.For k > 0 the field is exclusively with k ∈ ℤ. inside the ring (as shown in Fig. 3) and for k < 0 exclusively on its outside (that would be the case if in Fig. 3 the planar array is bent down and rolled up).The magnetization M [A/m] of such a hollow cylinder changes with respect to the position angle as Here, the vectors in the magnet plane are represented in complex and cylinder coordinates, because both are used in the literature.It is also more practical to use the remanent flux density (or remanence) of a permanent magnet instead of its magnetization M = B R ∕ 0 with 0 ≈ 4 • 10 -7 kg m/(A s) 2 , the permeability of vacuum.
For this work only magnetic structures are relevant which encase the magnetic flux density, B, they produce.This limits the discussion to k > 0 with the following general expression (the asterisk indicates the complex conjugate) (Eq.( 21) in [28]) ( 4) with r = r exp(i ) = r cos sin . (5) ).If the position makes an angle with the x-axis, M is rotated by an angle .This angle is an integer multiple of depending on the polarity and (inside/ outside) location of the magnetic field of the final arrangement (Eq.( 3)) as given by the index k.The polarity of such rings is then increased from left to right: b, e display dipolar (|k| = 1) , c, f quadrupolar (|k| = 2) , and d, g hexapolar fields (|k| = 3) .The magnetic field is completely inside the cylinder for k > 0, i.e. in b, c, d and zero outside.The opposite is the case for k < 0. For k = 0 the magnetization has radial orientation and no transverse field (only axial, z-direction) field is produced then (color figure online) This results in multipolar magnetic fields of amplitude f(k), which is given by where R i and R o are the inner and the outer radius of the hollow cylinder (cf.Fig. 4a), respectively.This amplitude f(k) is the (k − 1) th derivative of the generated flux, which is constant for each polarity.Hence, an ideal dipole (k = 1) generates a perfectly homogeneous magnetic field and a quadrupole (k = 2) perfectly homogeneous magnetic field gradients, which are orthogonal and have opposite signs.
The fact, that the flux of Halbach rings (k ≥ 1) is concentrated completely inside, makes them extremely efficient magnets.The efficiency of magnets is defined as the ratio of the energy stored in the accessible region to the maximally storable energy in the magnetic material [30,31].Halbach magnets reach a maximum efficiency for dipoles with R o = 2.21 R i .
These equations are only valid for ideal Halbach rings, which implies that they are continuously magnetized and infinitely long.Therefore, several steps have to be undertaken to convert these ideal Halbach multipoles to more realistic structures (cf.Fig. 5).This will be included in the Eq. ( 5) of the ideal system by modifying the amplitude of the generated magnetic flux by additional factors, f.Equation ( 5) describes the entire spatial flux distribution of the magnetic structure, which will be altered by discretizing and truncating it.Depending on the number of discrete parts, their shapes and distances, this will result in much more complicated field patterns, which cannot be generalized.The following simple equations will only be an estimate of the central field amplitude and say nothing about deviations at larger distances, i.e. about homogeneity.However, they are extremely useful at the planning stage of a magnet design and will give a good estimate about the achievable field/gradient strength.

Permeability
Permanent magnets are usually characterized by their B(H) dependence in the second quadrant, where the most prominent features are their remanent induction B(0) = B R , and the coercitivity field strength H c , for which B(H c ) = 0. Typical values in the case of NdFeB permanent magnets are B R = 1.3 T and H c = 1 MA/m.The relative permeability of the magnetic material r is described as the slope of this line, i.e. r = B(H)∕ H. Usually, the structural materials in the construction are diamagnetic or slightly paramagnetic (aluminum, copper) and can be described by the linear relationship B = 0 r H, with values of r differing from unity by only about 10 -5 (which can be also expressed as, r = 1 + , with the magnetic susceptibility).For this reason, these materials can be neglected compared to permanent magnets ("neodymium magnets" or Nd 2 Fe 14 B typically have r = 1.05, and "samarium-cobalt magnets" SmCo 5 or Sm 2 Co 17 have r = 1.03-1.11,cf.Appendix A).In order to estimate the effect of these not quite negligible permeability values we treat a Halbach ring like a continuous shell which shields the field of a larger ring surrounding it.Thus, an ideal Halbach ring can be treated like a cylindrical shield with an inner field reduced by a factor (Eq. ( 72) in [32]) If we imagine the magnetized hollow cylinder as a superposition of very thin cylindrical shells, the field generated by the outermost shell is shielded by all the inner shells, while the innermost is only shielded by the sample volume.The solution for this scenario is given by (Eq.(31) in [33]) Simulations for the relevant range of the permeability show that Eq. ( 8) can be approximated by (with an error smaller than 1% for < 1.35) If more than one Halbach ring is used to construct a (nested) system, the shielding of the field originating from the outer rings by the permeability of the inner rings must also be taken into account (e.g. by using Eq. ( 7)).

Segmented Rings
Unlike for planar Halbach arrays there is no accurate technique available yet to magnetize a hollow cylinder of permanent magnet material with the desired continuous magnetization patterns as demanded by Eq. (4).A real Halbach ring is therefore always an approximation of the ideal Halbach multipole by constructing it from N segments each with a single magnetization direction (cf.Fig. 5b).This type of segmentation reduces the inner field by (Eq.(24b) in [28]) This correction becomes mainly important for small N and high k (e.g. for k = 1 and N = 8, f seg = 0.6366, but for N = 16, f seg = 0.9745).It is trivial that the level of discretization must be at least the number of poles (N ≥ 2 k), an equivalent of Nyquist's theorem of "sampling" the theoretical magnetization wave that defines the multipole (cf.Figs. 2 and 3).At this limit the magnetization vectors of neighboring segments point in opposite radial directions.

Non-cylindrical Segments
Replacing the cylindrical segments of Fig. 5b by N identical magnets with a polygonal, round or trapezoidal footprint (as shown in Fig. 5c exemplarily by squares) can be advantageous in terms of costs but also for strategies to optimize homogeneity (see Sect. 4.1).This concept is also named Mandhalas [34] and the pros and cons of differently shaped sub-pieces are discussed in [35].Obviously, the reduction of magnetic volume by this approach reduces the magnetic flux density additionally.If the footprint of the sub-pieces covers an area A M , the strength of the resulting magnet is reduced by the ratio to the area of the ideal Halbach The geometry (calculation of vertices and distances) of dense arrangements of polygonal pieces is described in Appendix B.

Finite Length
So far, the magnets were described only in two dimensions, corresponding to an infinite length in the third or z-dimension.Obviously, a real magnet must be truncated to a certain length, L. Zijlstra gives an analytical expression (Eq.( 49) in [36]) for the reduction factor, f L (k) , of the field in the center of such a truncated Halbach dipole In order to generalize this for multipolar Halbach rings, they are constructed by a continuous distribution of dipoles on the circumference of a circle with radius R c .Then the decay along the third dimension (for k = 1 see Eq. ( 8) in [37]) is given by In order to account for the length, L, of the magnet, Eq. ( 13) is integrated over z 0 = ± L/2 and set in relation to the integral for the infinitely long ideal cylinder (z 0 = ± ∞).The reduction factor, f L , is then found for z = 0.For the two relevant cases (i.e., k = 1 and k = 2) the following simple expressions can be found (for k = 1 see Eq. (A.5) in [23]) at z = 0.
The solutions for higher k values and a general equation are listed in Appendix C. Note that it is still the field components in the xy-plane whose decay in z-direction is described here.The expression in Eq. ( 14) for k = 1 can be found from Eq. ( 12) for a very thin ring by expressing R o = R c + δr and R i = R c −δr as the zeroth order expansion in δr.
In Sect.4.3 it is shown how the decay ~ z −5 for k = 1 along the central axis can be avoided by using multiple rings with gaps in between them [37].
As already mentioned in the introduction, for most magnetic resonance experiments dipolar (k = + 1) and quadrupolar (k = + 2) Halbach magnets are of interest only.Therefore, the effects discussed in the previous sections can be summarized as ( 12) Equations ( 15) and ( 16) are very helpful for first estimations of field strengths of magnet geometries.A table in Appendix D compares the quality of the terms with the more accurate results from FEM simulations.The agreement is very good (discrepancies are less than a percent, except for the last two factors).

Demagnetizing Field
If a certain geometry is found that produces the desired magnetic flux density, B, inside the magnet system one has to check if the chosen material is magnetically hard enough.Inside the magnetic material the magnetic field, H, is not in the same direction as the magnetization, M. If in certain regions the component of H in the direction opposite to M exceeds the coercivity, H c , the local magnetization will be quenched or demagnetized (for Halbach systems [31,38]).Otherwise, permanent magnets could be built that generate virtually any field strength by adding more magnetic material.Hence, simulations that account for the full BH-or MH-curve are needed.Alternatively, calculations of the magnetic field inside the magnetic material can be inspected if the coercivity is exceeded (typical values and their dependence on temperature are listed in Appendix A).The intrinsic coercivity, H c , is the magnetic field, which is needed to reduce the magnetization to zero, but the magnetization starts to deviate from its initial slope even earlier.However, in rare-earth magnets this transition is very steep.The magnetic field, H (see Fig. 6c), can be calculated from the flux density, B (see Fig. 6b), and the magnetization of the material, M (cf.Eq. ( 4) and Fig. 6a) Figure 6 illustrates this effect on a thick-walled Halbach dipole and quadrupole.The internal magnetic field exceeds the coercivity of the chosen material in several (15) regions (marked by black lines in Fig. 6d, e) at the outer and inner rim, which would be demagnetized and hence no longer contribute to the planned magnetization pattern, causing a lower field and homogeneity than predicted.In [31] Bjørk et al. calculated conditions for these inner and outer regions with highest magnetic field.Demagnetization is avoided if At the outer rim these regions are located at the poles (0° and 180° for a dipole) and at the inner rim between them (90° and 270° for a dipole).
However, it may be worth noting that for accelerators Halbach dipoles (R i = 3 mm, R o = 100 mm) have been constructed which reach almost 4 T (homogeneity 0.4%) [17] and recently even 5.16 T in a 2 mm gap [39].The same group also developed extremely strong multipoles [40], e.g.quadrupoles with gradients of ca.300 T/m [39].This was achieved by using various materials with different H c to avoid demagnetization.(18) inner rim: Finally, one should be aware that H c is also strongly temperature dependent (cf.Table 1).

Homogenizing in the Magnet Plane
The magnetic fields of ideal Halbach multipoles are flawless (see Figs. 5a, 6d, e).The inhomogeneities introduced by discretization increase with each step in Fig. 5.At first glance, it is unclear how the concept of Mandhalas [34] (constructing the magnet from the same magnetic parts) might help here.To understand this strategy the main sources which cause field inhomogeneities have to be discussed.Typically, the production and magnetization process of the permanent magnets is outsourced to companies that have specialized in this field.Usually, the quality of these building blocks of the Halbach system is most crucial for the final result, and unfortunately the underlying steps are out of direct control.Figure 7b shows the variation of the field produced at a fixed distance from the surface of some 600 permanent magnets.The variation can easily reach percent ranges, but clearly the numbering provided by the producer reveals two batches in the production by the change in variance.Such variations can have their origin in the production of the magnets and/or the magnetization process.
Another problem arises from the accuracy of the magnetization direction.The cylindrical segments in Fig. 5b for instance need correct individual magnetization angles.It is easy to imagine that this will add another error in the percent range.An easy strategy to circumvent these problems is to order magnets of identical shape and measure their far field.Figure 7a shows how the magnetic field drops off the surface of a cube-shaped magnet in this example.At a distance roughly equal the size of the magnet, a dipolar regime is entered (dashed blue line), which means that shape and local magnetization variations inside the magnet average out and the magnet can be regarded as a spherical magnet of the same volume, or equivalently a point source described as a magnetic dipole.Note that this distance should be not too far away to ensure sufficient accuracy in measuring its stray field.In Appendix E a simple method is described that uses this dipole approach to minimize the error in the center of the arrangement [37].This strategy typically improves the homogeneity by an order of magnitude.However, this strongly depends on the number of magnets to select from, their deviation and the chosen geometry.More evolved methods optimize larger field maps for different arrangements [6,41,42].
Using magnets with a polygonal footprint further reduces the error in misalignments of the magnetization direction because it coincides with a certain edge.However, edges in the magnet shape introduce higher polarities in the resulting field (cf.Fig. 5c, d), which can be reduced by using round magnets (spheres, bullet shaped, cylinders, cf.Fig. 5e).If one uses such round magnets, their correct orientation can be achieved by using a magnetic alignment procedure [35] giving excellent homogeneities.All the described concepts assume that one really uses only the innermost section of the magnet (somewhat like the far field).If the sample space is close to the size of the opening (2R i ) of the ring, the spatial inhomogeneity of the individual magnets can no longer be neglected (cf.Fig. 10a).
For dipoles Tewari et al. showed that the rotation angle i = (k + 1) i (see Fig. 4a) of each magnet is not necessarily the best choice for optimal homogeneity [43].From the same group there is also the suggestion to deviate from a circular arrangement and that arranging magnets on ellipses instead also improves overall homogeneity [44].

Axial Homogenization
The truncation of an ideal Halbach multipole to a certain length or height introduces an additional inhomogeneity of B xy along the z-axis.This decay can be approximated by Eq. ( 14), and as already stated in Sect.3.4 it is advantageous to separate the Halbach cylinders into differently spaced rings.This approach is very much like in Helmholtz coils or solenoids with denser pitch towards their ends to improve the homogeneity along their axis [37].To homogenize the central field, B Σ xy , produced by two dipole rings placed at distances ± s 1 , the second derivative has to become zero at the center z = 0.
with the second derivative In the center (z = 0) this has to become zero for a flat maximum (cf.Fig. 8a) the optimal distances for up to 12 rings (cf.Fig. 8c) for k = 1-6.
Figure 8b shows a differential arrangement, which generates a constant gradient B Δ xy ∕ z .For this the optimal distance is s 1 = ±R c ∕ √ 2 with a gradient of in the center.
Again, these distances are first starting points, which need refinement via simulations.The very homogeneous regions in Fig. 8a, c are, of course, limited to the axis.Farther away from the axis the gaps between the magnets will cause inhomogeneities increasing with radial distance (cf.Fig. 10b).Strategies to remove them will be discussed in the next section.An alternative to stacks of rings of the same length is to change the thickness of the individual rings [45] and remove/reduce the gaps in between them as shown in Fig. 8d.Nevertheless, the use of only one magnet size has to be sacrificed for this approach and the presented solutions in Appendix E are no longer valid because they were obtained for infinitesimal thin rings.However, the density distribution presented by them can be used as a starting point to optimize the ring thicknesses.
Another possibility to build Halbach arrays without end effects by truncation would be to use Halbach spheres [18].This is more of a theoretical concept because the authors are not aware that anyone ever built such a demanding structure for magnetic resonance (in [46] a sphere has been roughly approximated). Figure 9a shows the principle layout of such a Halbach sphere generated by rotating the cross section of an ideal Halbach dipole around the axis of its poles [29,47].A Halbach sphere has 4/3 more internal flux than an ideal ring with the and same shell thickness and additionally a strong stray field.At first glance it looks a bit foolish to wall an apparatus inside a hollow sphere, but there are certain angles where such spheres can be opened without force [1] to provide access to the inner volume (see also Sect.5.1).This inner space can be extended by using Halbach hemispheres as endcaps of a Halbach ring (cf.Fig. 9b) [48].The field strength of such a hemisphere is then half of that of the complete sphere, and the Halbach cylinder outer radius has to be adopted to match this by being of the hemispheres.Again, no one, to our knowledge, has ever built such a device.

Passive Shimming by Iron Pole Plates
Figure 10a shows the magnetic flux density measured close to the pole surface of eight magnets.Quite strikingly each of them shows a pronounced flux distribution over its surface.Although the methods described in Sect.4.1 can compensate their overall strength at a distance, there are situations where one has to use as much of the inner volume of a magnet as possible.In [4] it was found that flat sheets of iron almost completely cancel this inhomogeneity out (cf.Fig. 10b, c).The iron plates (or other soft magnetic material with high permeability) act like a pole piece, and by bringing the various spatial magnetic field contributions to a similar magnetic potential smooths out the biggest inhomogeneities.Below about 1.5 T saturation effects are not expected in iron or low-carbon steels, but as it clearly can be seen in Fig. 10c, they also reduce the magnetic flux.
Recently, it has been reported that magnetic filaments for 3D-printers can be used to easily create arbitrarily shaped pole pieces or be already embedded in the support for magnets [49], however their low permeability ( r < 10) may become a problem.

Mechanical Shimming
Due to the variation in the magnetic materials, production and positioning tolerances it is hard to imagine building Halbach magnets with homogeneities much less than 100 ppm deviation of the magnetic flux over a larger part of the inner accessible volume, which is a comparable value for superconducting magnets before cryoshimming.Typically, the last mechanical correction steps have to take spatial field information into account to find the optimal configuration for an individual magnet (a step which may already require the incorporation of ambient field distortions).
For permanent magnets this correction can be done by individually position either additional magnets or materials of high permeability [50].Such a semi-permanent correction of course is best planned from detailed spatially resolved field maps.The corrective material can be inserted at suitable positions and/or mechanically moved (e.g. by set screws) for fine adjustments [51][52][53] or being rotated [54][55][56].One major aspect is that not too much of the available sample space should be sacrificed by this additional equipment.A very elegant and space preserving concept is shown in Fig. 11 [57].The very small magnet produces a field of 0.7 T and allows simple spectroscopy shown on the 1 H-spectrum of toluene acquired in a 5 mm standard NMR tube (inset Fig. 11a).The resolution measured for a water sample was 4.5 Hz or 0.15 ppm at half height.This homogeneity was achieved first by shifting the rectangular sections to suitable positions and finally using additional coils for finer field adjustment of the first-order terms only.In the meantime this idea has been further developed and successfully commercialized [58].
Another idea for simple, adjustable and stationary shims is presented in Fig. 12.It makes use of a pair of permanent magnets both with the shape of a hollow cylinder and transverse magnetization, which are aligned coaxially (cf.Fig. 12 top row).They will have the same stray field if both have the same height and their geometry and remanences are chosen such that they both have the same product of remanence times their area, i.e.

(22)
where A/B indicates the inner or outer cylinder (R Ao/i = outer/inner radius of cylinder A).Their fields add up when both point in the same direction.Their vector sum is minimal (vanishes if Eq. ( 22) is fulfilled) for antiparallel orientation as illustrated in Fig. 12.If a set of K such units is mounted on a circle with radius R s and their geometry is chosen small compared to the rest of the magnet system, their influence in the center is approximately that of a dipole and the additional flux at a point p = [x, y] close to the center is given by Fig. 11 Halbach dipole built from fixed trapezoidal and movable rectangular units: a Picture of the 0.7 T magnet next to a standard 5 mm tube for the liquid sample.Inserted is the 1 H-NMR spectrum of toluene of the homogenized system.b Demonstration how the movement of the rectangular magnets can generate magnetic fields of third order (top) and fourth order (bottom).Below each magnet arrangement is the resulting field map to illustrate the effect.Reproduced from [57] with permission from the Royal Society of Chemistry (color figure online) where j is the angle at which the j th shim cylinder-pair is positioned, whose outer and inner cylinders are rotated by angles A j and B j .The last equation is given if both cylinders with total volume V are made from the same material with remanence B R .
The correction field can then rather simply be calculated by the superposition of K individual dipoles of individual strength and angle to homogenize the original magnetic field.From that the angles of each cylinder pair are determined using Eq. ( 23).This approach has the advantage that it only uses components on a fixed axis.The method was successfully tested but needs further refinement [59].
If the instrument is going to be used for NMR spectroscopy the final fine adjustment ("active shimming") of homogeneity is typically and reasonably done by a set of coils charged by finely regulated and stabilized currents.However, these coils deviate from the standard shim-coil designs used in superconducting magnets with axial fields.Due to the transverse field in Halbach magnets, the coil geometry has to be adapted (e.g. using cosine-coils [60]).

Force-Free Openable Magnets
For some applications it can be useful to open Halbach rings and particularly spheres, e.g. to clamp them around a tube or plant or to insert samples (cf.Fig. 13).Following the discussion in [4] Halbach multipoles can be opened without forces at angles, opt j , which are solutions to (see Appendix G, Eq. ( 42)) resulting in Again, these are theoretically derived values for a dipole model.However, there are always clear minima in Halbach arrangements, but the optimal position to open such a magnet system depends also on the degree of discretization (see Appendix G).The optimal angle for k = 1 is opt 0 ≈ ±35.26 • and for k = 2, opt 0 ≈ ±17.63 • .This variation of mutual forces can actually be experienced when building a Halbach dipole.Whereas the magnets close to = 0 repel each other, they attract each other around = 90°.

Nested Magnets with Adjustable Fields via Rotation
One of the most interesting ideas of using Halbach rings is to align them coaxially and rotate them to change the amplitude of the generated magnetic flux density in the center [61,62].Due to the fact that Halbach inner multipoles (k ≥ 1) have no stray fields they are not a magnet from the outside.Consequently, there is only negligible torque if they are rotated in the homogeneous field of another outer dipole [63].The situation changes for multipoles which produce spatial field changes, but still the torque is relatively small, yet with some unavoidable cogging [33].
If B is a constant vector field over the entire sample region (i.e. a dipole, k = 1), its rotation by an angle is given by where B′ is the rotated field by applying the rotation matrix R( ).
For k > 1, however, the magnetic field depends on r (cf.Eq. ( 5)), and a real vector field rotation must be applied, e.g. for the gradients of a quadrupole (k = 2, see Eq. ( 16) and [2,64]) Hence, the gradient rotates by 2 when the quadrupole is rotated by an angle [64] (or generally the k th derivative of the magnetic field of a Halbach multipole with k ≥ 1, rotates with k when the multipole is rotated by ).
The great advantage here is the possibility to change field and gradient strength when using nested magnets with the same polarity k.If, for instance, two dipoles are combined coaxially with radii chosen such that they produce the same flux, their combined field can be changed from twice that of a single one (parallel dipoles) to zero (antiparallel dipoles) as shown for dipoles and quadrupoles in Fig. 14.
This not only allows to adjust homogeneous fields for DNP [11,12] or do field sweeps for EPR [9], but can also be used for imaging with gradients adjustable in strength and direction [64] (this will need a dipole and two rotating quadrupoles).
In this way very strong fields and gradients can be changed in less than a second, which may even be an alternative to electromagnets (considering their large inductance).In [65] a counter-rotating pair of dipoles generated an AC field of 150 mT with frequencies of about one Hz, a concept that may be also interesting for diffusion NMR on highly viscous melts.

Temperature Compensation
All sources of magnetic fields are temperature dependent and stable magnetic fields always require temperature control.While for superconducting magnets the boiling ( 26) temperature of the cryogen depends only on ambient pressure, resistive electro-and permanent-magnets typically need active temperature control or locking systems [66].However, Halbach systems can be constructed in a temperature compensated way.This very clever concept was proposed by Danieli et al. [67].It uses the fact that the two main materials for rare-earth magnets (neodymium and samarium-cobalt) have temperature coefficients, , of their remanence, which are different by a factor 2-4 (see Appendix A).They are defined via The original publication also takes thermal expansion into account, which was neglected here for the sake of simplicity.
Temperature stabilization by this approach is a quite general concept, which can be adapted to various magnet geometries.In [67] it was also discussed for quadrupolar Halbach rings and planar Halbach arrays as used in undulators.However, the concept reduces the field by a factor of (1 − B / A ).Recently new Sm 2 Co 17 materials have become available which are completely temperature insensitive at RT.Although they have only remanence values in the regime of 0.8-0.9T, this may still allow to generate higher fields than the approach discussed above [68].
Fig. 15 Temperature compensated Halbach dipole with the same construction principle as in Fig. 11.However, the system is combined now from two antiparallel dipoles.They are sketched on the right (cyan: NdFeB and yellow: SmCo) next to a measurement of the change of the magnetic field, ΔB, with temperature for the three magnet configurations.The dashed line corresponds to the magnet made only from trapezoidal SmCo blocks, while the dotted line represents the array built from rectangular NdFeB pieces.
The continuous line shows the temperature compensated magnet.Adapted from [67] and reproduced with permission of the American Physical Society (color figure online)

Some Practical Considerations for Construction
The design of a Halbach array should start with an estimation of the necessary field and/or gradient strength needed for the planned experiment.Naturally, the necessary boundary conditions like size, homogeneity, temperature variations, and possible costs have to be determined as well.Then the equations in Sect. 3 should be used to estimate the sizes and the shapes of the magnets.Usually there are conditions that request compromises in field, homogeneity, space, and costs.The necessary equations are easy to program or can be copied from [69].When a geometry seems to be suitable, the next step is a fine-tuning using some software that considers the actual magnet shapes (and not only their effect on the central field).This can be a simulation package that uses finite-element (e.g.COMSOL Multiphysics) or boundary-element methods (e.g.Amperes, IES, Winnipeg, Canada).If the design includes materials with non-linear magnetization (e.g.iron), the material properties must be properly included in the simulation.Quite often one has to request BH-curves from producers.However, there is also very useful freeware available, e.g.FEMM (https:// www.femm.info/) which is limited to two dimensions, but includes the use of BH-curves.Another great package is magpylib (https:// magpy lib.readt hedocs.io) [70], which is 3D and uses analytical solutions of a set of geometries, hence it is very fast, but needs some elementary skills in Python programming (it also does not include permeabilities and non-linear magnetic behavior).Regardless of which software package is used one should always predetermine the necessary accuracy up to which the geometric optimization is reasonable.Typically, this is limited by the precision to which magnets can be produced and supports machined (normally not better than 100 µm).
After optimizing the geometry and position of the magnets, the support needs some thought, ideally together with strategies on the procedure of mounting the magnets.
Mounting rare-earth magnets of sizes larger than ca. 10 cm 3 can already become dangerous, as the forces roughly scale as [4] (for small distances to the surface of two magnets with surface area, A) Several of the software packages also allow the calculation of the forces, but the direction must be also considered, because a repelled magnet needs some support and fixture to keep it at the position.A good advice is therefore a test run on a scaled down mockup system (e.g. using inexpensive magnets from internet stock and 3D-printed plastic supports).This helps tremendously to figure out if the procedures are feasible before ordering expensive custom-made magnets.
For instance, Eq. ( 30) predicts a force in the range of 100 N for ca. 1 cm 2 , while it amounts already to 1000 N for 10 cm 2 sized FeNdB magnets.This is just the force between two magnets, two completely assembled rings can easily generate forces that exceed 10 kN.Therefore, upscaling of such magnetic designs quickly becomes an engineering problem in calculating and managing forces, using suitable materials of sufficient thickness and safe procedures for placing and fixing the permanent magnets.This is a process, which requires a lot of experience that can only be acquired safely by starting and tinkering with smaller systems.For the construction a magnetic set of tools is more useful than expensive nonmagnetic instruments.This is because in a well-planned construction iron plates underneath the support for the permanent magnets can work as a yoke and help to hold the magnets in place while the glue is setting.The same holds for magnetic pliers or clamps which can be placed over the poles of a magnet to shield it from the others during positioning, thus significantly reducing mutual forces [34].Nevertheless, a good magnet manufacturer also has a larger supply of wooden blocks, plates and wedges (and some band-aid).The handiest tool of all though is a 3D-compass or pole-finder to quickly check the polarity of a magnet or entire arrangements.
Since magnetic resonance does not only require magnets, readers, who are interested in developing or building equipment (amplifiers, coils, magnets, software, etc.) are referred to the webpage [71] of the Open Source Imaging (OSI 2 ) initiative [72].

Conclusion
The intention of this review on Halbach magnets for applications in magnetic resonance was to compile the necessary knowledge to plan, design and construct such arrays.Special emphasis was given to simple, analytical estimations of magnetic field strength or their gradients.Another focus was to summarize various strategies to homogenize the fields as this is of paramount importance for NMR.As to the topic of homogeneity, to provide a sufficiently homogeneous field in a given space is a difficult task, especially with permanent magnets, because their physical properties usually vary in the percent range, as has been shown here.Thus, without further measures, it would be a matter of coincidence if a homogeneity requirement is met, based only on an even perfect numerical design of the magnet arrangement.Several such measures have been mentioned in this publication, they comprise the appropriate placement of the permanent magnets in the arrangement such that their magnetic property variations cancel, the adaptive placement of shim magnets or steel disks/ sheets on the poles and even the active shimming by adjustable coil currents.Homogeneity is difficult to achieve if space restrictions force the magnetic arrangement to be small, the homogeneous region scales with the size of the arrangement, but the size of the permanent magnets and the forces between them scale more than linearly, which may become a safety issue.In the end, it may only be possible to achieve a required homogeneity with a combination of all these measures.A good numerical design, as described in many publications, can only be the starting point for further experimental optimization.
Table 1 Typical values for neodymium and samarium-cobalt magnetic materials: the temperature coefficients, , for the remanence and coercivity are typical values in the temperature range around room temperature (ca.0-80 °C) The maximal temperature of use is not the Curie temperature, which is above 300 °C for neodymium and 700 °C for samarium-cobalt magnets.Please be aware that particularly for SmCo magnets the range of properties is very large.The values given here are taken from the fraction with high remanences This is a less determined set, but very useful for fitting a magnet system between inner and outer limits.
From Eq. ( 12) , and for circular footprints this gives a diameter d = R o − R i − g∕2, while for polygons with K vertices the long diagonal is given by d = 2R o − 2R i − g sin ( ∕K).
Note that for an ill-chosen set, overlapping structures are possible.The overlapping must then by avoided by adjusting for N 2 odd

Appendix E: Optimal Arrangement of Individual Magnets in a Halbach Ring
We start from a set of K magnets each with an individual magnetic moment, m j , and an average of m = 1∕K ∑ K j=1 m j (cf.Fig. 7b).The indi- vidual deviation of each magnet from the mean is then a deviation vector Δm j = m x − m xj , m y − m yj , m z − m zj = Δm xj , Δm yj , Δm zj to include angu- lar misalignments (however, the polarization directions of the magnets remain in the xy-plane).If an arbitrarily chosen ensemble of N magnets is then arranged to a Halbach multipole each magnet and hence Δm j must be rotated according to Eq. ( 4) by the following rotation matrix, R where r j is the position vector and the magnet is situated at a position z in axial direction.When treated as a magnetic dipole it produces a "deviation" field in the center given by (cf.Eq. ( 23)) In a ring made from N (≤ K) magnets an ideal arrangement is then found if the erroneous contributions to the magnetic field due to the deviations Δm j cancel for each direction and each power of z.Hence, one gets 8 sums, which must be minimized numerically (symbolized by min {…}).
The best arrangement of magnets is then the one for which all these sums are minimal.There are different strategies to compute this, e.g. using a Monte Carlo approach [73] or arrange N − 1 magnets and then look for a close to perfect match among the rest of magnets.
In the calculations above a magnetic moment vector was used to characterize the magnets or their deviations, respectively.Practically, this can be achieved by determining a value that scales with the magnetic moment, e.g., the magnetic flux at an arbitrarily chosen but fixed distance sampled by a 3D-Hall probe as suggested in Fig. 7a.However, this experiment has to be very reproducible.Great care has to be taken to avoid geometric misalignments or temperature drifts (even from keeping a magnet in the hands for too long).Such values can then be used to optimize one or several rings by minimizing Eq. (35).If a set of rings should be stacked like in Sect.4.2, it must be checked if they have slightly different central field strengths.To optimize homogeneity in the center of a stack of these rings one strategy is to place the rings with highest homogeneity in the xy-plane in the center of that stack and optimize their position along z according to the concept discussed in Sect.4.2.For instance, searching for a numerical minimum of a sum of equations of the type of Eq. (20).

Appendix F: Optimized Stack Distances
Table 5 gives the optimized distances s j of stacked Halbach multipoles for k = 1-6.All optimized to an accuracy better than 10 -3 and relative to R c (cf. [37] and Fig. 8).For instance, the optimal distance between two ring centers is then 2s 1 R c = 0.824 R c for k = 1.The last but one column gives the increase of the field (or its (k-1) th derivative) by the factor, f zs , in the center of the stack relative to that of a single ring.The last column gives the central region, Δz hom , on the axis where the field (or its (k-1) th derivative) does not vary more than 10 -3 from the central value.
( If this formula is to be applied to real magnets, their magnetic moments should be related to their respective volumes V via where the absolute value of the magnetization M is given by M = B R 0 . To put the calculated torques into perspective, the maximum torque τ in a Mandhala ring can be estimated by using the amplitude factor in Eq. ( 38) and applying some simplifications in order to translate from dipoles to real magnets.The calculated torque values would be best reproduced, if the magnets had the shape of spheres, because homogeneously magnetized spheres generate an exact dipolar field on their outside.For the usual case of cylindrical magnets, the results will be transferable if their height L is chosen such that they have the same volume as their spherical counterparts with the same cross-sectional area, which is fulfilled for the height L = 2/3 d.For higher magnets the torque, τ, must be scaled in these units, thus we find for the torque amplitude, cyl , for cylindrical magnets (39) m = MV, Fig. 17 a Sketch of opening a Mandhala of N = 16 cylinders at a possible (not the optimal) angle between two magnets, using a hinge (blue).The green arrow indicates the calculated torque, τ.The red spheres in the centers of each cylinder should remind that the calculation was done for dipoles at a distance d to each other.b The difference between the optimal angle, opt from Eq. ( 25 The angular dependence, Ξ, of the torque given in the underbrace in Eq. ( 38) can be evaluated for two neighboring magnets in the ring with indices j and j + 1 (see Eq. ( 32)), respectively, in order to identify the set of magnet numbers N in a ring which lend themselves best for force-free opening.This gives Figure 17d shows this dependence for several values of N. The maximum contribution of this angular expression to the torque is a factor of 1. Obviously, angles with close to vanishing torque can be realized (e. g. for N = 14).Higher values of N may also give interesting configurations, but it must be kept in mind that an increase in N means a reduction of the magnet size and a reduced field in the center.To give an example for the order of magnitude of a typical range of torque in a Mandhala dipole made from N = 16 cylindrical magnets with B R = 1.4 T arranged on a circle with R c = 5 cm (d = 1.95 cm, L = 1.3 cm) Eq. ( 40) yields a torque amplitude of τ cyl = 7.77 Nm.The angular dependence yields the torque closest to zero τ min = − 0.86 Nm [− 1. 13 Nm] (at j = 1, 6, 9, 14) and a maximal value of τ max = + 6.76 Nm [+ 8. 47 Nm] (at j = 3, 4, 11, 12).For comparison, the values obtained by a numerical simulation are shown in square brackets.
The magnetization directions of two consecutive magnets (dipoles) in a Mandhala ring with many magnets differ very little.If their common angle with their connecting line is denoted by , which is also their common angle with respect to the origin, see Fig. 13 a, the angular dependence of the torque according to Eq. ( 41) becomes This expression vanishes for the values, opt , given in Eq. (25), where the Mandhala ring can be opened without force in the limit of many dipoles forming the ring.
High torque values are not a real issue for small magnets but can become considerable for larger systems.Therefore, it is easier to tilt the magnetization pattern or the magnet orientation (given by Eq. ( 4)) by a phase = opt − , as explained in Fig. 17b, c.This rotates the flux pattern by but causes the geometrically determined angle = opt to allow opening the structure without force.A specific phase angle is = 1 2 2 N , which puts the magnets in the intermediate positions and leads to another symmetric, "conjugate" arrangement.In any case, a nonzero phase angle , will lead to different positions of the markers in Fig. 17d.

Fig. 1
Fig. 1 Schematic illustration of how magnets can be arranged to result in single-sided flux.a A single magnet with its magnetization direction downwards (indicated by the white arrow or the red and green color specifying north and south pole).The resulting dipolar magnetic field is represented by two field lines for the same field strength but different directions (blue = clockwise and gold = counterclockwise).b Several of the magnets from a arranged with a gap of the same size and alternating vertical magnetizations.c Same as b but now with alternating magnetization in horizontal direction.d Combination of the two arrangements in b and c gives a simplified planar Halbach array.It can clearly be seen how the flux cancels below the array and doubles on the other side (color figure online)

Fig. 2
Fig. 2 Linear, one-dimensional Halbach arrays: a a continuous version of the discrete scheme of Fig. 1d.The magnetic material (gray) has a magnetization (red arrows) pattern, which varies according to Eq. (1) along x and is constant along y over a thickness d, while it is infinite in the third dimension.This produces a recurring magnetic field (blue flux lines) on one side with wavelength .b Photograph of iron filings on a household magnet with ca. 3 illustrating the flux pattern of a.The magnetic flux on the opposite side is negligible.c If a /2 section of such a magnet is rotated around an axis at some distance parallel to its surface, a hollow cylinder with axial field is produced.Under certain conditions this field can be quite homogeneous but is limited to certain aspect ratios.Note that this is NOT a typical Halbach cylinder as discussed in Sect.3, since its field direction points in axial direction (color figure online)

Fig. 3
Fig. 3 Sketch on how the planar Halbach magnet is converted into a Halbach ring by rolling it up.a If one wavelength, , is wrapped around an imaginary cylinder of radius ∕2 , one gets a dipole with homogeneous field.b Wrapping 2 gives a quadrupole.See text for more details (color figure online)

Fig. 4
Fig. 4 Conceptual construction of cylindrical ideal Halbach multipoles: a the magnet (gray) consists of a hollow cylinder.Its magnetization M (red arrow) continuously changes with position R c (defined on a central circle with radius || R c | | = R c = (R o + R i )∕2).If the position makes an angle with the x-axis, M is rotated by an angle .This angle is an integer multiple of depending on the polarity and (inside/ outside) location of the magnetic field of the final arrangement (Eq.(3)) as given by the index k.The polarity of such rings is then increased from left to right: b, e display dipolar (|k| = 1) , c, f quadrupolar (|k| = 2) , and d, g hexapolar fields (|k| = 3) .The magnetic field is completely inside the cylinder for k > 0, i.e. in b, c, d and zero outside.The opposite is the case for k < 0. For k = 0 the magnetization has radial orientation and no transverse field (only axial, z-direction) field is produced then (color figure online)

Fig. 5
Fig. 5 Illustration of discretizing the ideal Halbach ring in a which has continuously changing magnetization and is infinitely long, into a real system.b First the magnet is discretized into N cylinder-segments with a single homogeneous magnetization direction (here N = 16).c The cylinder segments can be replaced by identical magnets (here squares) which are rotated to the appropriate magnetization direction.d Finally, the arrangement is truncated to finite length.e Shows another version of d using cylindrical magnets.In the top row a sketch of the geometry is displayed, while the central row shows FEM simulations for B R = 1.4 T, the length of the N magnets in d and e is twice the size.The bottom row is identical to the central one but using a logarithmic color scale to improve the visibility of the inner field distribution (color figure online)

Fig. 6
Fig. 6 Illustration of the effect of demagnetization on a thick-walled Halbach dipole (a-d) and a quadrupole (e) with identical dimensions (dashed white lines).a The magnetization as requested by Eq. (4), b shows the magnetic flux density produced by a. c Combining M and B according to Eq. (17) gives the magnetic field H. d Images of the magnitude H for the same dipole and e for a quadrupole.The material properties were chosen from the FeNdB-material N54 with B R = 1.47 T, H c = 880 kA/m (black lines in d/e) in Appendix A, R o /R i = 3.A coordinate system is shown on the lower left (color figure online)

Fig. 7 a
Fig. 7 a dipole approximation for characterizing magnets by their far field: double log-plot of the magnetic field, B, (red line) produced outside a cube-shaped magnet in magnetization direction, x.The blue dashed line shows the expected slope for a dipole (x −3 ).The gray dashed line indicates the size of the magnet.The purple shaded region suggests a region for measurements of "dipole-like" behavior.The B-field of the cubic magnet was simulated for B R = 1.4 T, hence corresponds to a magnetic moment m = B R V/µ 0 = 17.4 Am 2 .Note that an ideal spherical magnet of the same volume would generate a dipolar field everywhere beyond its surface.b Result of such measurements: The individual deviation, ΔB, of 620 FeNdB-magnets from the mean.The numbering was provided by the producer.The shaded regions identify two different batches by significantly different variances of unknown origin (color figure online)

Fig. 8
Fig. 8 Illustration of stacking Halbach multipoles with optimized gaps along their axis.Dark blue: resulting combined magnetic field, B Σ xy , of the arrangement.Cyan: magnetic field of each individual Halbach cylinder (gray rectangle).a Two dipole cylinders at the distance calculated in Eq. (21), b two antiparallel dipoles generating a constant gradient of B xy along z. c 8 stacked rings (see Appendix E).For all: k = 1, R c = 12.5 mm, L = 3 mm, B R = 1.4 T. d Instead of identical rings stacked at different distances one can also use rings of various L and different thickness (here R i was kept constant and R o adapted to homogenize the field) (color figure online)

Fig. 9 aFig. 10 a
Fig. 9 a Halbach dipole sphere, b using Halbach hemispheres as endcaps of a Halbach cylinder.In both drawings a quarter is cut away.Red arrows sketch the magnetization direction and the big yellow arrow the resulting flux (color figure online)

Fig. 12
Fig.12 Shimming using a pair of hollow cylinders with transverse magnetization (blue and purple arrows in top row).If their size and strength are matched according to Eq. (22) and if both can be rotated around a common concentric axis they produce the flux depicted in the lower row.To illustrate this principle, the inner cylinder stays at the same position and the outer one is rotated from a parallel, b perpendicular to c antiparallel, where the combined field of both vanishes.The field maps in the lower row show the magnitude of the field (colors limited to the lower half of the full range) with an overlaid vector plot, nicely showing the dipole characteristics of the magnetic field (color figure online)

Fig. 13 a
Fig. 13 a Geometry of a Halbach dipole that opens without force at an angle opt 0 ≈ ±35.3 • relative to the poles.b Photograph of a prototype (NMR-CUFF) comprising four magnet stacks (of 8 magnets each, cf.Fig. 10, generating a magnetic field of 0.57 T), which opens at = 45°.Furthermore, it is equipped with gradient coils to image a stem of a plant in vivo.The resulting MRI is shown in c.For details see [4] (color figure online)

Fig. 14
Fig. 14 Coaxial arrangement and rotation of Halbach dipoles (green, left column) and quadrupoles (red, right column).Their magnetization is indicated only by their poles (white or black encircled arrows): a, b two Halbach di-and quadrupoles which produce the same field strength, B, (central green arrow) in case of the quadrupoles the same gradient strength, G.Note that only the horizontal component of B Q is displayed by a red arrow and that this is the derivative of the field (small blue arrows in the center).In the following figures (c-e) a and b are coaxially nested and the outer ring is rotated by an angle .c For = 0° the fields are parallel and the two dipole fields add to 2B. d For = 90° the fields are orthogonal and the two dipole field vectors add to √ 2B at an angle of 45°.e For = 180° the fields are antiparallel and cancel each other.The same holds for the gradient in the right column at half the angles, because the gradient rotates at twice the angle of the quadrupole (cf.Eq. (27)).f The angular dependence of the combined field magnitude of both dipoles, B Σ = 2B cos ( ∕2) (green line) and the two quadrupoles G Σ = 2G cos (red line) (color figure online)

N 2 16 d 2 sin 4 N 8 d 2 sin 2 K 2
NK This notation means that it is rounded to the next smaller integer value.
Fig.17a Sketch of opening a Mandhala of N = 16 cylinders at a possible (not the optimal) angle between two magnets, using a hinge (blue).The green arrow indicates the calculated torque, τ.The red spheres in the centers of each cylinder should remind that the calculation was done for dipoles at a distance d to each other.b The difference between the optimal angle, opt from Eq. (25), for force-free opening and as the angle of a possible opening angle close to opt .Shown for k = 1 and N = 8 where this difference is pronounced.c The same situation but now the magnets are arranged with an additional phase = opt − such that = opt but now the magnetic field (yellow arrow) is tilted by .d Illustration of the angular term, Ξ(1, j, N), of the torque (Eq.(41)) for various values of N. The markers indicate the possible opening angles j between magnets in the ring (j = 0,1…, N).All the curves are continuous expressions (j → ∞ in Eq. (41)) for different N to guide the eye.The thick red line shows the limit for N → ∞.Negative values of Ξ correspond to a force that opens (repelling force) the two halves of the Mandhala, positive values bring them together (attracting force) (color figure online)

Table 4
Comparison of the analytically obtained estimations of the magnetic flux density in the center of a Halbach dipole and quadrupole ('theory' from Sect. 3) to values obtained from a FEM simulation (COMSOL Multiphysics 5.5) for R i = 10 mm, R o = 15 mm, B R = 1 T

Table 5
Optimized distances s j of Halbach multipoles (k ranging from 1 to 6) stacked from n = 2 to 12 rings