Magnetic Guiding with Permanent Magnets: Concept, Realization and Applications to Nanoparticles and Cells

The idea of remote magnetic guiding is developed from the underlying physics of a concept that allows for bijective force generation over the inner volume of magnet systems. This concept can equally be implemented by electro- or permanent magnets. Here, permanent magnets are in the focus because they offer many advantages. The equations of magnetic fields and forces as well as velocities are derived in detail and physical limits are discussed. The special hydrodynamics of nanoparticle dispersions under these circumstances is reviewed and related to technical constraints. The possibility of 3D guiding and magnetic imaging techniques are discussed. Finally, the first results in guiding macroscopic objects, superparamagnetic nanoparticles, and cells with incorporated nanoparticles are presented. The constructed magnet systems allow for orientation, movement, and acceleration of magnetic objects and, in principle, can be scaled up to human size.


Introduction
In this review, the meaning of magnetic guidance is understood as a remote, untethered and contact-free control of the movements of an object via magnetic interactions. The movements should happen on arbitrary trajectories inside a container caused by an external device.
Typical examples of such magnetically guided objects are endoscopic capsules for inspection of the gastrointestinal tract or superparamagnetic nanoparticles suggested for local therapy, which therefore have to be moved through blood vessels. There are numerous reviews on the subject because this research area is very diverse and the problem has been tackled from different directions. The following reviews on magnetically guided medical devices [1][2][3]; miniature robots [4]; nanoparticles in microfluidics and nanomechanics [5] for drug delivery [6][7][8], hyperthermia, and alternative local magnetic therapeutic effects [9,10]; tissue engineering [11][12][13]; as well as magnet systems for this purpose [14] are some of the most recent (or a book [15] treating most of these topics). There are many more applications of magnets in biomedicine, e.g., permanent magnets are also used for the separation of superparamagnetic nanoparticles from solution. If the nanoparticles are functionalized, specific substances can be removed from the solution. However, this is not guiding in the sense of the initial definition because the direction of motion of the particles is not controllable.
It is not the intention of this review to summarize this very active, vast, and diverse field of research, but rather to discuss a simple and very general concept of magnetic guiding that borrows ideas from the treatment of magnetic fields in magnetic resonance imaging (MRI). To avoid confusion, this comparison does not imply that the magnetic fields in MRI are particularly useful for guiding (although possible [16]), because the typical gradient fields are too weak. It is rather the physical principle that is similar. Both techniques use a projection of a small deflection or encoding magnetic field tensor on a much stronger and homogeneous field (component), which generates spatial bijection. In the case of MRI, the unavoidable concomitant gradient components of the coil systems can be ignored if the strength of the homogeneous field is much higher (a concept which fails at low magnetic fields). This physical statement and how magnetic guiding of paramagnetic objects can be implemented analogously will be explained in the next section. From this perspective, it does not matter if the magnetic fields for guiding are generated by electro-, permanent, or hybrid magnets. However, since permanent magnets have so many advantages over electromagnets, only realizations using exclusively permanent magnets are discussed in Section 3. The described bijective guiding concept relies on the experimental condition that the homogeneous field is much stronger than the deflection field, and Section 4 describes what happens if this is violated. While guiding macroscopic objects does not require particularly strong magnetic fields, doing alike with superparamagnetic nanoparticles is a challenge. It is almost unavoidable that their mutual magnetic interactions induce cluster formation. This changes not only the magnetic force but also the hydrodynamics as discussed in Section 5. Section 6 then covers possible 3D realizations of such guiding instruments and magnetic imaging schemes. Finally, some first applications of the technique are shown before this article concludes. These first applications demonstrate that the proposed concepts work nicely in two dimensions by guiding macroscopic objects as well as suspended superparamagnetic nanoparticles or cells with incorporated nanoparticles.
At this point, a few general remarks need to be made. The following line of arguments will consider paramagnetic materials only, i.e., materials with a relative permeability bigger than one (µ r > 1) or positive magnetic susceptibilities (χ = µ r − 1), hence including ferri-, ferro-, and superparamagnetic materials. In principle, diamagnetic (0 ≤ µ r < 1) substances can be guided with the same instrument as well. Essentially, it would just reverse the sign in the force equations. However, since the only substances with a diamagnetic permeability significantly different from 1 are superconductors (with µ r = 0) and most applications of magnetic guiding are typically in biological systems, they will be ignored in the following.
Since most of this article deals with concepts, the problem is that most of the time these concepts are idealized to the task of guiding a magnetic dipole with a magnetic moment m [Am 2 ] by an applied magnetic flux density B [ T]. Deviations when concerned with real bulk materials are discussed in Appendix A. At this point, the author wants to apologize for not always using the completely correct terminology concerning magnetic flux density, B [T], which in the following is often termed as magnetic field or induction field to improve readability. Wherever a physical magnetic field, H [A/m], is meant, it is labelled as such. For most of this conceptual presentation, B = µ 0 H is valid with µ 0 ≈ 4π × 10 −7 N/A 2 is the vacuum permeability.
To further improve readability, highly technical or mathematical details were separated in seven appendices, which are found at the end of this article. They might be particularly useful for readers who want to design their own systems or follow the derivation of equations.
The author wants to conclude this introduction with a statement about names. The first system of this kind was nicknamed "MagGuider" (for Magnetic Guiding and Scanner) [17], but this name should not be used here, because this article rather deals with a concept than with a particular instrument.

Concept of Magnetic Guiding
Magnetic guiding has been an established technique since 1897 [18], when Ferdinand Braun invented magnetic guidance of charged particles (electrons or ions) by cathode ray tubes where the electrons are emitted from a cathode into an evacuated tube, accelerated by an anode, and deflected by magnetic fields (used en masse in analogue oscilloscopes and television screens). The magnetic deflection is based on the Lorentz force F L = q v × B, which is perpendicular to the direction of the magnetic flux density B and the flight direction of the particles with charge q and velocity v . However, the situation is very different if an electrically neutral paramagnetic material is exposed to magnetic fields. The force is then the gradient ∇ = [∂/∂x, ∂/∂y, ∂/∂z ] of the magnetic field acting on the object with a magnetic moment m The right simplified term is usually correct for the applications discussed here, however, it is not generally the case. Particularly, it assumes that m is not dependent on B, which depends on the material and the range of B (see Appendix A for a discussion).
So what happens to a small paramagnetic object in an inhomogeneous magnetic field? It is hard to imagine that an object that should be guided through space is not freely movable (at least in two dimensions). If the object has an intrinsic fixed direction of m (e.g., remanent magnetization), it is rotated by the magnetic torque until the cross-product becomes zero or m is parallel to B. If the object has initially (at B = 0) no preferred direction of m, the actual field will magnetize it (orient the electron spins) along B. Either way, as a result, m points along B, which is very unfortunate with respect to guiding, because the dot-product in Equation (1) will lose its sign for two parallel vectors and the material will always move towards higher magnetic fields (cf. Figure 1a,b). This is an everyday observation, as e.g., paper clips are attracted equally by the north and south pole of a permanent magnet. For steering this is like using a clipper without a sail. Almost independently of what one tries with the rudder, the boat will go to where the winds or currents move it. In electrodynamics, this is also known as Earnshaw's theorem [19], and it is the reason why permanent magnets were originally not considered as being useful for magnetic guidance, because as their name suggests they are permanent and cannot be switched on or off. Now the question arises why guiding charged particles is so straightforward, while it is so difficult to control the collective spin of electrons in materials magnetically? The reason is the bijective direction ( v ) of the electron beam, which is just slightly deflected by steering fields. This suggests that a preferred direction would also be beneficial for steering paramagnetic objects. This is tantamount to a magnetic field that just orients (polarizes) the particles without exerting a force on them. For static magnetic fields, this request can be fulfilled by applying a strong but homogeneous magnetic flux density, B hom , which magnetizes the object along its direction. An additional, small, and spatially-dependent steering or deflecting field can then act as a perturbation but with full directional control (cf. Figure 1c,d). Ideally, this deflecting field will have a linear spatial dependence, i.e., a constant gradient (The fact that G is a tensor is ignored for the moment), ∇ B = G, and the total field in such an experiment is then With the reasonable assumption that there is no strong spatial variation of the magnetic moment over the sample, one could conclude that F m = mG (because ∇ B hom = 0). Under certain limits this is correct, but unfortunately magnetism is not quite that simple. Things become a bit more complicated due to Maxwell's (or Gauss') law The black lines are field lines. A zoom of the region around the object is shown on the inserts. The top rows (a,b) just show the field generated by the deflection magnet, while in (c,d) a strong and homogeneous field is superimposed to the scenario above. The difference between the columns is the orientation (south-and north-pole) of the deflection magnet. (a,b) Changing the magnet's orientation has no effect on the movement of the object (white arrow), because the object is magnetized in opposite directions as well and just moves to the highest flux density. The additional homogeneous field in (c,d) essentially keeps the magnetization direction of the object along its horizontal direction. The field of the deflecting magnet now causes the opposite magnetic "landscape" around the object and hence it moves in opposite directions. The data were generated using FEMM (www.femm.info) but should serve for illustration purposes only.
Hence, there cannot be a single gradient field at any point. Either the field has to be homogeneous or the sum of all its spatial derivatives have to cancel. For the simple case of a perfect quadrupolar field (see Appendix B), this could be for instance ∂B x /∂x = +G and ∂B y /∂y = −G, consequently Equation (4) dictates ∂B z /∂z = 0. Then a more detailed representation of Equation (3) will be The deflecting field is written here in the most general form as a gradient tensor (G, see Appendix F), which will be needed later. As discussed above, the magnetic moment of an object at r = [x, y, z] T will be oriented parallel to B ( r ) (with unit vectorê B ) The last approximation was already motivated in the discussion of Figure 1 and is the origin of bijection, namely that the homogeneous field must be much stronger than the local deflection field, so that its tensorial properties can be reduced to a vector via projection. The condition for this prerequisite is then A full treatment will follow but to clarify the concept, it is instructive to continue with the approximation from Equation (6). Then the magnetic force in Equation (1) simplifies to or more generally only the field component of the deflection field, which is parallel to B hom , determines the direction and amplitude of the magnetic force. It is a very beneficial feature of this concept that there is no spatial dependence of the force vector in Equation (8), hence the guiding force is homogeneous or constant over that region where Equation (7) is fulfilled (cf. also Figure 5). This is an important issue because other systems which guide an object by moving permanent magnets around the outside of the container (e.g., [20]) or use electromagnets on opposing ends of the container, also have to consider the non-linear drop of the magnetic field with distance (depending on their dimensions, the far-field of permanent magnets drops with an exponent between −2 and −3, and hence the force with −3 to −4). This can extremely complicate the control because the position of the object has to be known precisely to estimate speed and direction of motion. This is a problem that does not exist in the presented concept. Additionally, the movements are also not limited to the direction of B. In the following section and Appendix C it is explained how any direction can be addressed by rotating the gradient field relative to B hom .

Permanent Magnets with Adjustable Fields
As already said in the introduction, this conceptual idea of magnetic guiding can of course be implemented with any magnet system consisting of either electro-, permanent magnets, or hybrids. While Equation (8) motivates this concept, real guiding of objects along arbitrary paths needs deflection fields, which must become time-dependent in orientation and amplitude [21]. Since permanent magnets are not typically associated with these properties, they are often excluded from considerations, although they offer some important advantages over electromagnets. Particularly, if the devices need to be scaled up, the enormous power consumption of resistive electromagnets becomes a real problem. For example, to generate roughly the magnetic field produced by 1 cm 3 of modern rare-earth magnets, several kW of electrical power are already needed and additionally the generated heat must be removed by cooling. This can be estimated from the Amperian loop model, where a loop of current, I, produces a magnetic moment m = IA, with A as the surface of the loop. Using Equation (A3) (see Appendix A), this can be rearranged for a cylinder of height h to I = B R h/µ 0 . Hence, a cylinder of rare earth material with a remanence B R = 1.3 T and h = 1 cm height is equivalent to a current of ca. 10 kA. Additionally, the time-dependence of large coils is very nonlinear, as the inductance scales with the square of the number of windings and the coil cross-section. Large inductances then result in long delays for discharging and charging the coil. Together with the temperature and hence resistance changes associated with time-dependent currents, the resulting magnetic fields are difficult to calculate and control [22,23]. Superconducting magnets are not an acceptable option either because they cannot be switched fast. So what about permanent magnets? As the name suggests, the orientation and strength of a permanent magnet are time-independent, however, many of them can be arranged to systems such that the direction and strength of their resulting magnetic fields can be changed by simple mechanical rotation [24].
The most suitable arrangements for this purpose are so-called Halbach cylinders [25]. Their concept, construction, and field calculation is discussed in Appendix B. In order to implement the concept of magnetic guidance from Section 2, the homogeneous field will be generated by a Halbach (inner) dipole (see Figure 2a), while the constant gradients can readily be provided by a Halbach (inner) quadrupole (see Figure 2b). In the following, the discussion will be limited to ideal systems. Hence, it is sufficient to treat this as a two-dimensional problem (infinite length in the third dimension, see Appendix B). (b) Inner quadrupole with a circular modulus field, which can be decomposed into two linear field components B x = Gx in (c) and B y = −Gy in (d). The hollow cylinders consist of permanent magnet material with continuously changing magnetization direction (arrows). The poles are encircled. In (a,b), the magnetic field is represented by field lines, while in (c,d), the arrows are field vectors (the different colors are only for better contrast). Note that the magnetic fields are only inside the hollow cylinders and that there are no stray fields.
The first advantage of such Halbach cylinders is that they provide ideal homogeneous and graded fields (as are assumed for Equation (8)) with simple geometric relations to calculate their field dipole : where R i is the inner and R o the outer radius of the hollow cylinders, and B R [T] is the remanence of the used permanent magnet material. The strength of the homogeneous field, B D = B hom , of the dipole and the strength of the gradient, G Q , produced by the quadrupole, are now indexed by the type of Halbach magnet they originate from. This will help to retain an overview when nesting multiple rings. The second great advantage is the absence of stray fields, so that they are "no magnets" when approached from the outside. Therefore, the cylinders can be concentrically arranged or nested and mutually rotated without much torque [24]. If two Halbach cylinders of the same type are nested and the geometries are chosen such that they both produce the same field or gradient strength, their combined field can then be varied between zero and twice the value of a single cylinder. This allows to scale the field or force or eventually even switch it off. This principle is illustrated in Figure 3. shown in (f,g) for two nested quadrupoles that produce the same field gradient (i.e., the derivative of the field. The red arrow shows the horizontal component only). (h-j) Same representation as above. Note that the gradient rotates at twice the angle of the quadrupole (cf. Appendix C). (k) The angular dependence of the combined field of both dipoles, ; (l) angular dependence of the gradient strength of the two quadrupoles Σ = α  2 cos G G .
If the example from Equation (5) is put into effect by a Halbach dipole and a Halbach quadrupole, and the quadrupole is rotated by an angle α relative to the dipole, the magnetic field in such a structure is (cf. Appendix C and Figure 3l) By using the arguments of Equations (5) and (6), the field component that is not along BD (i.e., By) can be ignored and the magnetic force is given by (l) angular dependence of the gradient strength of the two quadrupoles G Σ = 2 G |cos α|.
If the example from Equation (5) is put into effect by a Halbach dipole and a Halbach quadrupole, and the quadrupole is rotated by an angle α relative to the dipole, the magnetic field in such a structure is (cf. Appendix C and Figure 3l) By using the arguments of Equations (5) and (6), the field component that is not along B D (i.e., B y ) can be ignored and the magnetic force is given by This means that the force has a constant strength of m G Q and rotates with 2α over the entire volume where the prerequisite of Equation (7) is fulfilled. Although it is a bit counterintuitive that the object moves at twice the angle of which its actuator is rotated, this concept gives complete control over the direction of a magnetically guided object in such a magnet system [17].
In order to completely control the movements of such a guided object, not only the direction but also the amplitude of the force must be controlled. This can easily be done by using a second quadrupole, ideally of a size that produces the same gradient strength in the internal volume as already provided by the first quadrupole (cf. Appendix B). The direction of the force shall be determined by α and shall not be altered by scaling the force; one quadrupole must be rotated by an angle (α + β/2) and the other by (α − β/2) This generates a force (again only taking the direction of B D into account) From Figure 3l it can clearly be seen that the angle β between the quadrupoles only scales the force by 2|cos β|, i.e., from twice the gradient generated by one quadrupole at β = 0 • and 180 • and zero at β = 90 • and 270 • . At the same time, the direction of the force is kept constant at 2α. In this way, it is possible to accelerate, decelerate, stop, or move the object at very sharp angles. This is best illustrated by a video in which a small steel ball (in very a highly viscous medium to slow down its speed) was used in such a system to write letters ( Figure 9a). A complete guiding system that allows not only changing the direction and strength of the magnetic force but also the direction and strength of B hom will then consist of two dipoles and two quadrupoles. With such an instrument, all magnetic fields can then be cancelled in the inner volume, so that also aggregates of nanoparticles might disintegrate (see Section 5). Such a system is treated in a very general way in Appendix D. The resulting equations may look complicated at first glance, however, they contain only simple trigonometric functions that can easily be calculated. This is a fact that should not be underestimated, because there are neither time-dependent nor interdependent terms, nor non-linearities in these equations. Even if the magnetic fields cannot be made as ideal as assumed here, they can be measured and tabulated for each ring and used for the calculation of the local force with high precision.
There is no torque if nested ideal Halbach systems are rotated with respect to each other [26]. However, the necessary segmentation and truncation to a certain length (see Appendix B) also introduces a torque τ m ∼sin(kα) [27] whose amplitude very much depends on the geometry and has its main contributions due to cogging at the edges of the segments. Especially for quadrupoles constructed from polygonal magnets, the torque can become significant.
It may be useful to evaluate the range or dimensions of magnetic fields, gradients and instruments sizes. One limit is the demagnetization field, which limits the local magnetic fields inside the magnet structure. If exceeded, the magnetic material will alter its magnetization like in the initial polarization process (to some extent, this is discussed in Appendix B and in [28,29]). However, this process is ignored and a simple guiding system made from one Halbach quadrupole (R i = r 1 , R o = r 2 ) surrounded by a Halbach dipole (R i = r 2 , R o = r 3 ) is straightforwardly calculated from Equation (9). Then the field strength, B D , of an ideal Halbach-dipole and the gradient strength, G Q , of a quadrupole are given by Equation (9) and combined with Equation (7) From this set of equations, the following relations can be equated: The dependency of this equation and the resulting homogeneous and graded fields are shown in Figure 4 assuming r 1 and B R are given and the relation in Equation (15) is treated as an equation. Although using the equations for ideal Halbach-magnets in Equation (14) is somewhat naïve (see Appendix B), Figure 4 gives a good estimate for the magnitudes of the geometric dimensions, magnetic fields, and gradients, which are important to estimate the achievable magnetic forces on nanoparticles in Section 5. . Estimation of the achievable magnetic fields and gradient strengths for a simple guiding system consisting of an inner Halbach-quadrupole (red) and an outer Halbach-dipole (green) (see sketch of the geometry inserted in (a)). Shown is the dependence of the homogeneous field, B D (green line), produced by the dipole and the gradient, G Q (dashed red line), of the quadrupole versus the inner radius of the dipole r 2 . Both have the same functional dependence but scale with r 1 . Therefore, there are two axes on the left in the respective colors. In (a), the internal radius is set to r 1 = 5 cm, which could allow for guiding objects inside a rodent. The innermost radius in (b) of r 1 = 40 cm was chosen to host a human. A remanence B R = 1.3 T was used in both cases. The outermost radius, r 3 , B D , and G Q are then given by Equation (15).

Deviation from Constant Forces
The key requirement for obtaining a constant force over the internal volume of radius R is given by Equation (7). This defines a prerequisite for ignoring the unavoidable additional components of the deflection field. In magnetic resonance imaging (MRI), these components are also named concomitant gradients [30]. Figure 5 gives a visual explanation of what happens to the force field if the gradients become too strong. The deviations are of course strongest at large distances from the center and that central line, which is perpendicular to the anticipated force direction (vertical central line in Figure 5). This is because the other concomitant gradient field has a zero here as well (cf. Figure 2c,d).  (7). Shown is the force over the internal area with a radius R for different ratios B/(GR), cf. Equation (7). The magenta-colored arrows ignore the local field and m always points along B (as in Equation (6), while the blue arrows account for the full field. This shows the increasing deviation from a homogeneous force direction with increasing gradient and/or distance from the center. Nevertheless, the guiding equation can still easily be solved by using Equation (6) without the approximation of Equation (7) (see also Appendix D for a full treatment). For instance, the magnetic field, B, in Equation (10) for a dipole with rotated quadrupole gives then the following orientation for the local magnetic moment and the force becomes The deviation between the ideal and real case can be described by a deviation angle (i.e., the angle between the magenta and blue arrows in Figure 5). Its maximum, δ max , is derived in [17] as From this equation, it is obvious that absolute angular precision (δ max = 0) implies G = 0 and hence no force or deflection, except for the line where the concomitant gradient is zero. For an angular error of δ max ≤ 1 • , a ratio B/(GR) ≈ 60 must be achieved. However, the situation is not as bad as it seems, because there are simple analytical expressions of this deviation for every spatial coordinate so that the error can easily be accounted for (see Appendix D) and usually the real challenge is to guide deep inside (center, or small R) the body where the precision is naturally higher.

Magnetic Force and Velocity
The magnetic force, F m , on a single particle in such magnet systems with a magnetic field B ( r ), which has a gradient G( r ) at the spot, r , of the particle, is given by Equation (1) or (8).
where the magnetic moment is expressed by the more commonly used magnetization, M [A/m], and the particle's volume, V. However, the magnetization is the volume integral of all magnetic moments in the object, which do not necessarily all align with the external magnetic flux density, and consequently, M is a function of B ( r ). If all magnetic moments are oriented, the material is saturated with a magnetization, M s . This is assumed to happen for the last term in Equation (19) and is usually a valid assumption for most magnetic materials in nanoparticle synthesis (e.g., for magnetite, Fe 3 O 4 : M m s := M s /ρ ≈ 4-80 Am 2 /kg with a density ρ = 1000-5200 kg/m 3 , depending on if the particle composition has a saturation induction field of B < 10 mT).
In the following it is further assumed that the particle has the shape of a sphere and is embedded in a medium of dynamic viscosity, η [Pa s]. Then the medium will exert a Stokes friction or drag of on the particle, so that in equilibrium it will move with constant velocity The hydrodynamic radius of the particle, R h , does not have to be identical to the geometric radius (as assumed for the last approximation) of the magnetic part(icle) of the spherical object, because many nanoparticles consist of a magnetite core and some biocompatible shell [31]. However, in most applications of magnetic guiding of nanoparticles, more than just one of such particles is administered. Therefore, it is very likely that neighboring particles will form chains, because they are all magnetized in the same direction and will experience dipolar interaction (cf. Figure 6a-d, this clustering can only be avoided with low concentrations or large R h together with low M s so that the interaction energy is lower than the thermal energy).
From the perspective of transportation, such clustering is advantageous, because a cluster of n particles experiences an up to n-fold increase in force [32]. Associated with the clustering is obviously a change of the shape of the guided object, and hence Equation (21) is no longer valid. If a cloud of superparamagnetic nanoparticles is injected inside a magnet system designed as suggested above, the strong and homogeneous magnetic field magnetizes all particles along its direction. If no gradient (=neither force nor velocity) is present, cluster-formation will only happen on the time-scale of Brownian motion (i.e., selfdiffusion). Gradients will assist a quick cluster-formation as the particles are all moved in the same direction [33], and hence their inter-distances will become smaller in this direction. As soon as some larger clusters have formed, they will attract neighboring particles with increased force. A self-accelerating process starts in which the particles are mainly attracted to the ends of the forming beaded structure (cf. Figure 6b). This is exactly the same process that forms "field lines" from iron-filings in the stray field of magnets (cf. Figure 6b,c).
To account for this behavior, the shape of such a beaded chain is approximated by a long slender body of length L h = 2nR h (cf. Figure 6a) and its velocity is given by (Equations (7.10) and (7.21) in [34]) The last approximation assumes that the radius of the magnetic sphere is identical to its hydrodynamic radius. It is important to realize that both velocity components grow logarithmically with twice the number of particles in the cluster. The geometric details of the slender body are then provided via the constants C and C ⊥ = C + 1 in Equation (23), which are given by (Equations (7.12)-(7.14) in and (7.23) in [34]) Not surprisingly, the velocity parallel to the long axis v = 2(v ⊥ − κ) is roughly twice as big as perpendicular to it [17]. The geometric features in Equation (24) namely cylinder and double cone (spindle) are good matches for the shapes that one finds among the particle aggregates (cf. Figure 6b-d). Such spindle-shaped clusters form at higher local concentrations after a certain length (n ≥ 15) of the initial line-growth of the cluster. This is schematically explained in Figure 6e. If there are sufficiently many particles in the vicinity, such clusters will form in any magnetic field and this behavior is not a particular feature of the suggested instrument. However, they can easily be studied in them macroscopically [17] and microscopically [33].
If some typical numbers are plugged in Equation (21) (M m s = 50 Am 2 /kg, ρ = 2500 kg/m 3 , G = 1 T/m, η = 1 mPas) and the velocity is calculated for various R = R h , however, here the time, T, to travel 1 mm is given as: R = 1 nm → T = 1.1 a, R = 100 nm → T = 1 h, R = 10 µm → T = 0.36 min, the latter is roughly the size of an erythrocyte, which has to fit through all blood vessels. Hence, to travel a biologically relevant distance in decent time, large particles with strong magnetization should be used. However, the size of the particles used inside biological systems is often considered of paramount importance, because larger particles are more likely to be recognized as foreign bodies and will be attacked by the immune system and might cause clotting. In a way, guiding makes this point somewhat less important, because the big particles are injected somewhere and subsequently guided to their target position (like an endoscope). The only processes to worry about are those which could hamper this transport. In this picture, it also does not matter if the big particle is solid or an aggregate from a large number of smaller particles. Although the latter sounds more promising because such agglomerates would be somewhat flexible in shape and can disintegrate at the target site by removing the homogeneous field (using two dipoles of equal strength). In this way, a release process may be triggered. Technically, magnetic field gradients inside humans are limited to 1-10 T/m (cf. Figure 4b), and if all other parameters are optimized, a speed of 1 mm/s still requires particles with sizes from 100 nm to 1 µm.  (1)) in cylindrical coordinates (r, z) around chains of n particles, which are all magnetized in the vertical (+z) direction. For a small number of particles; the "repulsive" part (red) of the force dominates in radial direction. The particles must first overcome this force, to enter the attractive force minima (blue) closer to the chain. This repulsive force vanishes at the center for n ≥ 15. Therefore, particles aggregate at the sides of longer chains in a hexagonal pattern, causing the typical spindle-shapes.
All the above is again valid for ideal Newtonian liquids only. Guiding through a living organism, one will encounter many more problems, as body liquids-foremost blood-show complex rheology because they contain living deformable cells. Additionally, for guiding through blood vessels, the strong, pulsatile flow needs to be overcome. When dealing with 3D systems (see next section), gravitational and buoyancy effects need to be considered as well.

Possible 3D Designs and Imaging
So far, only instrumentation to guide paramagnetic objects across a plane was presented. However, almost all applications need to have 3D-control over the object's trajectory. The most straightforward solution to this is to use Halbach-spheres [35] instead of cylinders (see Figure 7a). These are constructed by rotating the cross-section of a Halbach-cylinder around an axis through opposite poles. One may wonder how a sample can be inserted into a closed sphere, but there are certain angles at which such spheres, likewise cylinders [36], can be opened without a magnetic force [37]. Nonetheless, other problems will arise when using rotating nested spheres. Maybe most challenging will be the fact that the stray field of such Halbach spheres is no longer zero, so that significant torque can be expected. Alternatively, one could think about a system of rotatable cylinders on a spherical gantry to get the additional degree of freedom (see Figure 7b). This might be interesting because it also allows to decouple the force field of a quadrupole from the orientation of a dipole by simple rotation in a plane where both cylinders are orthogonal. Such a device could be a reasonable option to move macroscopic and ferromagnetic objects (e.g., catheters, capsules, or micro-robots) that possess very strong magnetization, so that the guiding fields do not have to be particularly strong. Applications with nanoparticles cannot afford the extra space required for full 3D rotation around an elongated object like a human or most animals, and the magnetic forces between such gimbals will also become significant.
In [17], it was suggested to maximize the field in the center of the machine to keep the guided object just there while moving the container in the third dimension. However, this would generate a rather metastable situation, because in the front and back of these homogeneous regions, the field drops with a strong gradient or force components out of the central plane.
Therefore, a new design is suggested here. The system with all the features described and analyzed in Appendix D is sketched in Figure 7c. Different to Appendix D, all magnets have finite length. To homogenize the dipolar field in the center, the Halbach dipoles are arranged with a gap (calculated in Appendix E) in which the quadrupole pair is inserted to compact the apparatus. If the dipole pairs point in the same direction (Figure 7c), the situation of the ideal system is maintained in a central xy-slice. Here the object can be moved and accelerated via rotation of the quadrupoles (as demonstrated in [17,33]). Now, if the quadrupoles are put in a cancelling position (cf. Figure 3j) and one of the dipole pairs is inverted (see Figure 7d), a gradient ∂B xy /∂z is generated, which is constant in the central plane. This will then move the object in the z-direction with velocity v z , which can be scaled by controlling the strength of the dipole-pairs (cf. Appendix E). In a real system it would be recommendable that the container in which the object is guided is moved by approximately the same speed (e.g., on a stage movable along the axis like in CT-or MRI-scanners), but in opposite direction, to keep the object in the center of the machine.
The instrument in Figure 7c,d then combines 3 degrees of freedom in guiding with velocities v x , v y (via rotating the quadrupoles, cf. Figures 3h-j,l and 7c), and v z (by bringing the dipole pairs in opposite direction, cf. Figure 7d) with 2 degrees of freedom in orientation in x and y, e.g., of nanoparticle chains by co-rotating the dipole pairs (cf. Figure 3c-e,k). Additionally, all these degrees of freedom can be scaled by the apparatus sketched in Figure 7c,d. Orientation along z is not possible because ideally there is no such field component in the center of the machine.
A crucial aspect of guiding is the control of the actual position of the steered object. If the container in which the object is moved is not transparent, like most biological systems, a blindfolded tour will probably not end up at the designated target position and maybe even cause severe inner injuries. Maybe with an exception for some endoscopic or capsules devices with an onboard camera, the position must be continuously monitored by a noninvasive imaging technique. Since the proposed magnet system already possesses strong homogeneous and gradient fields, there are two obvious candidates for this: magnetic resonance imaging (MRI) and magnetic particle imaging (MPI).

Figure 7.
Three-dimensional guiding ideas: (a) A Halbach sphere is made by rotating a Halbach cylinder around the axis through the poles. The magnetic field inside is 4/3 higher than in an ideal Halbach cylinder, but it also produces stray fields (small vertical arrows). (b) Sketch of 3D gimbal gantry. (c) Axial cross-section through a magnet system of two pairs of dipoles (green) and two quadrupoles (red). The dipoles and quadrupoles could for instance be concentric Halbach cylinders, here displayed as axial slices. The dipoles are split in a pair to homogenize the field in the center. If the strength of D1 = D3 and D2 = D4 the system is described in Section 3 and analyzed in Appendix D. In the shown configuration, objects are oriented in the x-direction and moved in the central xy-plane (lilac arrows). (d) Adding one additional degree of freedom to the system in (c) by independently rotating the left and right dipoles. If the quadrupoles are put in a cancelling position and the dipoles are in opposite directions, a gradient along the z-direction (axis) is generated. This system is discussed in Appendix E. If the guided object moves, then with v z the container (e.g., patient) should be moved via a stage with −v z so that the object stays in the center.
Magnetic Resonance Imaging (for excellent introductions see [38,39]) uses the magnetic moments of atomic nuclei (foremost 1 H), which are associated with the spin of the nucleons. To generate an energetic difference between the different orientations of the spin, a very strong and homogeneous (polarizing) magnetic field is needed. Typically, the energy differences between these energy levels correspond to a radiofrequency (e.g., ca. 42 MHz/T for 1 H). To excite transitions between the energy levels, a magnetic field must be irradiated with a frequency that matches the strength of B 0 and is oriented perpendicular to it. This is usually done in the form of short bursts of an AC current of matched frequency in a coil that surrounds the sample. The nuclear spins then induce a much weaker signal in the same coil. The signal strength scales with B 2 0 and therefore magnets must be strong for this technique. Spatial resolution is then introduced by constant gradient fields, G, i.e., a linear variation of the magnetic field component, which is parallel to B 0 along the spatial direction of interest. As said before, the same requirement (B 0 > Gr) as in Equation (7) is necessary to create bijective spatial encoding. Because the frequency of the MRI-signal is directly proportional to the magnetic field, such a gradient generates an integral projection of the sample along the selected gradient direction. Therefore, the instruments presented here possess all requirements for MRI, albeit the gradients discussed so far would be way too strong for MRI (G < 0.01 T/m) and two quadrupoles would be needed to allow for guiding at high G and imaging at low G, also ensuring the objects are no longer moving while being imaged. Since the gradients in the discussed designs can be rotated, projections at various angles can be easily acquired and reconstructed to Cartesian coordinates using an inverse Radon transform, aka "back-projection" as used in CT-scanners [40]. The only extra-equipment would be an rf-coil with an amplifier and the MRI-spectrometer. Because the contrast of MRI in biological systems mainly stems from the magnetic interactions of the nuclear spins in water with the direct environment, superparamagnetic nanoparticles cause a strong disturbing effect and are already standard MRI contrast agents [38,41]. However, this leads the reader to believe that MRI comes for free with the suggested guiding systems. The difficulty lies in the field homogeneity required for MRI. While a guiding system could sufficiently function with a precision of 1%, MRI requires fields that are 2-3 orders of magnitude more homogeneous. Nevertheless, recently great progress was made in building functioning MRI systems using Halbach-magnets [42,43].
Magnetic Particle Imaging [44,45] relies on the presence of superparamagnetic particles to generate a signal. Their magnetization follows a magnetic drive field oscillating at a suitable frequency (typically in the kHz-MHz range depending on the particle relaxation behavior) and its time derivative induces a signal in a receive coil. It can be distinguished from the drive field because the magnetization in such materials does not depend linearly on the applied field (typically M(H) is described by a Langevin-function) and can be identified (e.g., via overtones in the spectrum) or filtered from the induced voltage. This signal is then proportional to the concentration of the particles. Spatial resolution is obtained by applying strong gradient fields, so that the particles magnetization outside the region of zero-crossing is saturated, hence it cannot follow the drive signal and no longer gives a signal. By moving such zero-lines or points through the region of interest, images of the particle concentration can be reconstructed. The latter are typically those magnetic fields that consume most of the energy in electromagnetic MPI-devices, but can be generated with the described apparatus by combining quadrupole and dipole fields as suggested in [46].
Apparently as the title of this section suggests, none of the discussed devices have been built yet. Of course, other tracking possibilities exist as well, especially for larger objects as reviewed in [47].

Applications
So far two types of guiding systems were designed, larger ones with R i ≈ 5 cm (the original MagGuider from [17] and a system with one dipole and two compensated quadrupoles, i.e., system M1 in [33], cf. Figure 8a,b) and several smaller ones with R i ≈ 1.5 cm made to fit light-microscopes (for instance M2, M3 in [33], cf. Figure 8c,d). Appendix G contains some practical suggestions for building such magnet systems.
Several objects were guided in 2D with such systems. Being equipped with two quadrupoles of almost equal strength allows to accelerate the object or even to bring it to a stop. To illustrate this option, a 1-mm steel ball was used to write the initials of the author's employer (cf. Figure 9a or [48]). The steel ball was chosen because it can easily be tracked visually or by a regular camera, however, in order to slow down its movements in the very strong gradients of the device shown in Figure 8b it had to be immersed in an extremely viscous silicon oil. On the other hand, the cobalt ferrite nanoparticles shown in Figure  9b,c had almost 10 times the velocity of that steel ball; however they were immersed in water (with a 50,000 times lower viscosity than the silicon oil used in Figure 9a). They are only visible (average diameter of 75 nm) because they form very long clusters (n = 10 5 -10 6 ). Several other commercial superparamagnetic nanoparticles were compared under identical conditions in [17].
In [33], it was shown that not only bare nanoparticles can be moved but also human and murine cells that have taken up commercial nanoparticles (cf. Figure 9d,e). This might be important for ex-vivo 3D-printing of tissues or entire organs. In-vivo regenerative medicine might make use of this (e.g., lesion of nerves, retina, inner ear, etc.) by transporting specific cells to lesions, building cellular scaffolds, and repairing or engineering tissues with certain textures. The last example is like a micro-robot including actuation, however, on a much smaller scale. In [49], liquid crystalline elastomers, which included iron-oxide particles, were functionalized with thermo-and photoresponsive groups. The long distance transport could then be provided by the suggested magnetic guiding system. At the target site, material properties could then be changed either by heat or light and used for actuation.
For instance, the stickiness of the particles was modified, so they could adhere to some other non-magnetic object, and both could then be moved together magnetically. Bringing the liquid crystalline elastomer to the isotropic phase by heating weakened the adhesion and released the object (cf. Figure 9f). Figure 9. Various applications of the presented guiding systems. (a) A 1-mm steel ball (white arrow) was used to write the letters JGU using the magnet system presented in Figure 8a,b. The yellow arrows indicate the initial motion. (see also Supplementary Video S1 in [33,48]). To slow down the speed of the ball it was immersed in very viscous silicon oil (η = 50 Pas). Nevertheless, it had an average speed of 1.45 mm/s. (b,c) A small cloud (yellow ellipse) of cobalt ferrite nanoparticles with an average diameter of 75 nm was moved in water with a magnet system consisting of one dipole and one quadrupole. The direction of the static B hom = 0.1 T is indicated by a green arrow while the quadrupole with G = 0.2 T/m can be rotated and is marked by a red arrow. The resulting force or velocity (ca. 14 mm/s) is marked by a lilac arrow. The underlying squares have a side length of 5 mm. (c) Image taken 3.5 s after the quadrupole (red arrow) was moved by ca. 45 • (Supplementary Video S2 in [17]). (d) Murine macrophage cells incubated with 100 nm iron oxide particles were guided in a system like in Figure 8c,d while being studied with a light microscope. Due to the strong and homogeneous dipole field, they form long clusters that are reversible when the magnetic field is removed. (e) Close up of (d) the cells arranged around the connected nanoparticles like meat pieces on a shish kebab (for details see [33]). (f) A liquid crystalline elastomer with incorporated iron oxide particles (white arrow) is guided over long distances (not shown) with a system like in Figure 8c,d. When the particles arrive at the target site, actuation can be initialized by a temperature change. A small piece of copper sticks to it at temperatures up to 110 • C (left & middle image) but leaves on the right when 125 • C are exceeded (Supplementary Video S7 of [49]).

Conclusions and Outlook
Magnetic guidance of non-charged objects by combining a strong homogeneous magnetic field with smaller deflection fields is a very general concept that can be put into practice in various ways using resistive or superconducting electromagnets, by permanent magnets or hybrid systems. This article focusses on permanent magnets and in particular in Halbach configuration, because they are inexpensive, stronger, and can directly be scaled up. Of course, there are alternative technical routes to fulfill this task than using nested dipolar and quadrupolar Halbach cylinders in the presented combinations. Alternative arrangements might be more useful and compact for certain applications. For instance, in [50], six permanent magnets are individually rotated to generate the desired fields. This article limited the discussion to Halbach magnets because the author believes that they produce magnetic fields closest to the demanded ideals and are easy to calculate and understand.
If orientation and force velocity do not have to be controlled independently, dipole and quadrupole can also be combined in a single ring and so forth. In the end, the number of degrees of freedom needed for a particular experiment decides upon the complexity of the movable rings of the magnetic device.
The techniques proposed here cannot only be used to guide superparamagnetic nanoparticles. This particular application is probably the most demanding in terms of required forces and hence gradient and field strengths. Much weaker fields would be sufficient to guide objects that contain larger ferromagnetic parts (e.g., endoscopes, minirobots). The necessary magnet systems for this application could therefore be much more spacious than the devices shown in Section 7. It also would not be a problem to power actuation of such robots by additional rf fields. Nevertheless, guiding superparamagnetic nanoparticles is still the grand challenge in this field, and a few routes were shown how this could be accomplished, e.g., by designing larger clusters of nanoparticles. For instance, a "pill" made from differently functionalized particles could be synthesized. It could contain some drug-carriers placed in the core and covered with layers of biocompatible material, all superparamagnetic and weakly cross-linked, such that it decomposes after a certain time at the target site and deploys its therapeutic payload for local treatment. In order to get a step ahead in this direction, Section 5 and Figure 4 provide some clues on the physical limits with today's technology, and what sizes and shapes are needed to make real tools.
Taken together, the author thinks that the proposed guiding system may serve as a general solution to the problem of steering by magnetic fields. It is hoped that this mainly conceptual overview convinces researchers that this methodology has the potential to simplify magnetic guiding, make it more versatile while reducing its costs and allowing for human scale applications. To achieve this, much more efforts are needed in designing proper computer-controlled systems with sufficiently homogeneous fields to implement all the different modalities that were suggested in this article.

Patent
The principle of the presented guiding with permanent magnets is patented in O. Baun, and P. Blümler "Vorrichtung zur Bewegung von magnetischen Partikeln in einem Raum mittels magnetischer Kräfte" DE102016014192A1, 2016.
Funding: This work was funded by the German Research Foundation (DFG) via SFB 1066 "Nanodimensional polymer therapeutics for tumor therapy" and by Inneruniversitäre Forschunsgforderung Stufe I by the Johannes Gutenberg University Mainz. sity of Mainz, Germany)-in this context for physical and mathematical discussions, inspirations, checking, polishing, and cleaning up my sloppy maths.

Conflicts of Interest:
The author declares no conflict of interest.

Appendix A. Magnetic Force
For a detailed thermodynamic treatment, see Sections 2.5.4 and 2.5.5 in [51]. For the sake of simplicity, the discussion is kept at a "microscopic level" of a magnetic dipole and non-linear bulk properties (i.e., magnetic field, H, and magnetization, M) are neglected. At constant temperature, the force exerted by an external magnetic field with flux density B on an object with magnetic moment m is given by Now, the advantage of limiting the discussion to a magnetic dipole manifests itself in the fact that ∇ × m = 0 because m (very much in difference to M) is no function of B ( r ).
Furthermore, the discussion is restricted to permanent magnets, hence Ampère's circuital law ∇ × B = 0 because no currents are present. Finally, m has no spatial dependence, which also cancels B · ∇ m = 0 and just leaves an expression known as the Kelvin force This approximation is a good choice for building a magnetic apparatus to manipulate small paramagnetic objects (e.g., superparamagnetic nanoparticles). However, its approximated character has to be kept in mind when strong interactions of the particles need to be considered or bulk ferromagnetic objects with non-linear M(H)-curves have to be analyzed (see [51]). If any anisotropy and non-linear behavior of the used bulk material can be neglected, the magnetic (dipole) moment relates to macroscopic properties as

Appendix B. Field Calculation for Cylindrical Halbach Multipole Magnets
In 1973, John C. Mallinson published the idea of flat permanent magnet arrangements which would generate a magnetic field only on one of their sides while it cancels on the other [52]. Many household magnets and magnetic foils have such magnetization patterns nowadays. Later this idea was generalized to cylindrical [25] and spherical [35] arrangements with multipolar magnetic fields. Due to his pioneering work in this area, they are now all named after Klaus Halbach.

Appendix B.1. Ideal Cylindrical Halbach Multipoles
For cylinders, the basic design idea is illustrated in Figure A1a. This idealized magnet is a hollow cylinder of infinite length and continuously varying magnetization direction. The angle of the magnetization direction, ϕ, depends on the position angle, θ, (cf. Figure A1a) as ϕ = (k + 1)θ with k ∈ Z. (A4) Figure A1b-g illustrates 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 inside the cylinder, and for k < 0 exclusively on its outside. The magnetization M [A/m] of the hollow cylinder changes with respect to its position as where B R [T] is the remanence (remanent flux density) of the used permanent magnet material and µ 0 ≈ 4π × 10 −7 kg m/(A s) 2 is the permeability of vacuum. Please note that the vectors in the magnet plane are represented in complex and Cartesian notation, because both notations are used in the literature. 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 to ensure Gauss' law) (Equation (21) in [25]) (A6) 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. Figure A1a). As illustrated in Figure A2, several steps will be introduced in the following to break down these ideal Halbach multipoles to more realistic structures. This will be included in Equation (A6) by extending the amplitude, f, by further factors.
The efficiency of magnets is defined as the ratio of the energy stored in the accessible region to the most storable in the magnetic material (see Equation (13.8) in [51]). Halbach magnets are extremely efficient magnets with a maximum for dipoles with R o = 2.21 R i . Figure A2. Illustration of transferring the ideal Halbach 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 one, homogeneous magnetization direction. (c) The cylinder segments can be replaced by identical magnets that are rotated to the correct magnetization direction. (d) Finally the arrangement is truncated to finite length.

Appendix B.2. Permeability of the Permanent Magnet Material
So far the relative permeability, µ r , of the permanent magnet material was neglected or set to that of vacuum µ r = 1. This is not completely off scale, because modern rare earth permanent magnets have values very close to that ("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).
If this is treated like a cylindrical shield, this should give an inner field reduced by a factor (Equation (72) in [53]) 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 not shielded at all. The solution for this scenario is given by (Equation (31) in [27]) Simulations for the relevant range of the permeability show that Equation (A9) can be approximated by (the error is smaller than 1% for µ r < 1.35) If more than one magnet-cylinder 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 Equation (A8)).

Appendix B.3. Segmented Cylinders
Since permanent magnets with the shape of hollow cylinders with continuously varying magnetization direction as suggested by Equation (A5) cannot be made yet, the typical way to approximate the ideal Halbach multipole is to construct it from N segments with a single magnetization direction (cf. Figure A2b). This reduces the inner field by (Equation (24b) in [25]) 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).

Appendix B.4. Non-Cylindrical Segments (Mandhalas)
It can be advantageous to replace the cylindrical segments of Figure A2b by N identical magnets with a polygonal, round, or trapezoidal footprint (as shown for squares in Figure A2c). This arrangement is also named Mandhalas [54] and densely packed geometries for differently shaped sub-pieces are discussed in [55]. The main advantage of using identically magnetized sub-pieces is to determine their individual strength (remanence), sort, and orient them to optimize the homogeneity of the resulting magnet [56][57][58]. 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 (i.e., π R 2 o − R 2 i ).

. Finite Length
All magnets discussed so far were assumed to be two-dimensional, assuming infinite length in the third or z-dimension. Simplifying the Halbach-multipoles by a ring of dipoles gives the following decay along this third dimension (for k = 1 see Equation (8) in [56]) and for x and y close to zero k+3/2 B xy (x, y, 0) for k ≥ 1 , and for x, y 0 , and with R = R i +R o 2 . (A13) If this expression is integrated over z 0 = ± L/2 (cf. Figure A2d) and set in relation to the integral for the infinitely long ideal cylinder (z 0 = ±∞), the reduction factor for the length L is found, which can be normalized to the value at z = 0. Unfortunately, the general solution of these integrals contains hypergeometric functions, but for the two cases relevant here (k = 1 and k = 2), the following simple expressions can be found (for k = 1 see Equation (A.5) in [46]) An alternative solution is presented in Equation (49) in [59] for Halbach dipoles only The decay~z −5 along this direction can be avoided by placing multiple rings with gaps in between them to homogenize the field in this direction [56] (see Appendix E). Note that it is still the field components in the xy-plane that decay here.

Appendix B.6. Summary and Numerical Example
For this work only the cases k = + 1 (inner dipole, p = 2) and k = +2 (inner quadrupole, p = 4) are of relevance, and the treatment above is summarized for each of them.
Dipole: (k = 1) Equations (A16) and (A17) are very helpful for first estimations of fields of simple geometries. In [60], some program codes can be downloaded to calculate such cylindrical multipoles. Nevertheless, simulations are necessary to fine-tune the design of magnets, estimate their homogeneity, and possible demagnetization effects [28,29], for instance, by checking if inside the magnets the intrinsic coercivity is exceeded. For k = 1 that will be the case for the magnets at θ = 90 • and 270 • towards R o, and at θ = 0 • and 180 • towards R i . For k = 2 the magnets at θ = 45 • ,135 • ,225 • , and 315 • (towards R o ) as well as at θ = 0 • ,90 • ,180 • , and 270 • (towards R i ) are the ones most affected.
The homogeneity of the magnetic field produced by real dipoles (possibly also quadrupoles) can be further improved by using optimized angular distributions, which are slightly off the theoretical positions [58].
If one has to use wires instead of permanent magnets, the field of a Halbach dipole can be produced by a cos θ-coil [61], and that of a quadrupole by a cos 2θ-coil.

Appendix C. Rotation of Vectors and Vector Fields
The discussion can be limited to two dimensions and therefore rotation by a single angle, α. Then the rotation matrix is given by If the magnetic field, B, can be described by a single vector over the entire region of interest (e.g., like the field of a dipole), its rotation by α is described by However, the situation becomes quite different if a spatially-dependent magnetic field is rotated (e.g., the field of multipoles, which depends on r , see Equation (A6)). This is because both field-and space-coordinates have to be turned. The rotation of such a vector field is then given by x cos α + y sin α −x sin α + y cos α = G cos α(x cos α + y sin α) + sin α(−x sin α + y cos α) sin α(x cos α + y sin α) − cos α(−x sin α + y cos α) = G x cos 2 α − sin 2 α + y(2 sin α cos α) x(2 sin α cos α) − y cos 2 α − sin 2 α = G x cos 2α + y sin 2α x sin 2α − y cos 2α . (A20) If the magnetic dipole field of strength, B D , is combined with a the gradient field of a quadrupole with gradient strength, G Q , the local magnetic field is Now the quadrupole is rotated by an angle α relative to the dipole, Equation (A20) gives The gradient of both components of this resultant field is then given by calculating its tensor (see Appendix F) This means that by a rotation of the quadrupole by an angle α, the resulting field gradient and thus the magnetic force is rotated by 2α, see also Equation (A36).
From simple symmetry considerations, it is clear that the magnetic field of any Halbach multipole (see Appendix B) must rotate by k-times the angle at which the multipole itself is rotated, because after rotation by 360 • /k every multipole is mapped on itself.

Appendix D. Two Dipoles and Two Quadrupoles
A magnet system, which can serve all possible requirements in magnetic guiding, consists of two (Halbach) dipoles and two (Halbach) quadrupoles. Each of them is part of a nested, concentric structure, and rotated by an individual angle. Then the total field is given by where B 1 is the field strength (cf. Equation (A16)) of the first dipole, which is rotated by an angle α, and B 2 is the second dipole at an angle β (both point alongê x the unit vector in x-direction when not rotated). Then G 1 and G 2 are the gradient strengths of the quadrupoles as given by Equation (A17); they are rotated by γ and δ respectively. This can then be written as (using Equations (A19) and (A23)) B tot = B 1 cos α + B 2 cos β + G 1 (x cos(2γ) + y sin(2γ)) + G 2 (x cos(2δ) + y sin(2δ)) −B 1 sin α − B 2 sin β + G 1 (x sin(2γ) − y cos(2γ)) + G 2 (x sin(2δ) − y cos(2δ)) . (A25) A magnetic dipole with moment m orients then along the direction of this local field and in this case with X = B 1 cos α + B 2 cos β + x(G 1 cos(2γ) + G 2 cos(2δ)) + y(G 1 sin(2γ) + G 2 sin(2δ)) and Y = B 1 sin α + B 2 sin β − x(G 1 sin(2γ) + G 2 sin(2δ)) + y(G 1 cos(2γ) + G 2 cos(2δ)).

(A28)
A lengthy equation but general and easy to compute (cf. Figure 5).

Appendix E. Gradient in the Third Dimension
As already stated at the end of Appendix B, it is advantageous to separate the Halbachcylinders into differently spaced rings. Very much like in Helmholtz coils or solenoids with denser pitch towards their ends, this improves the homogeneity in the third (z) dimension [56]. The field of a Halbach-dipole in this direction is given by Equation (A13). To homogenize the central field produced by two dipole rings placed at distances ± z 0 , the second derivative has to become zero at the center z = 0. Later different strength of the dipoles will become important, so the ring at -z 0 should have a strength B(0, 0, −z 0 ) = [B 1 x , 0, 0] T and the one at +z 0 also produces a homogeneous field in x-direction with a strength B 2 x , then the field along the z-axis is given by which has the first derivate (later of importance) and the second derivative In the center (z = 0) and initially for B 1 x = B 2 x both derivatives have to become zero for a flat maximum. ∂B x 2 (0) Generally this is fulfilled at z 0 = ±R/ √ 2k + 4 for k ≥ 1. This is the distance where no gradient ∂B x /∂z is present and hence ideal working conditions are provided to move the object in the central xy-plane by using the quadrupole(s) as described above.
As suggested by Figure 7d, a gradient of this x-component of the magnetic field along the third dimension must be introduced to move the object truly in three dimensions. This is achieved by changing the sign of one of the two rings (cf. Figure 7c,d). Then Equation (A29) reads and the first derivative (cf. Equation (A30) now both terms are positive) at z = 0 is given by Hence, the gradient in the z-direction in the center of the apparatus in Figure 7c,d is proportional to the sum of the field strength of the two dipoles with opposite direction. If these fields can be made adjustable, so can the gradient strength and velocity in z-direction.

Appendix F. Some Mathematical Definitions
The gradient tensor is a second rank tensor given by

Appendix G. Some Practical Considerations for Building Such Magnet Systems
To plan the construction of such a magnetic guiding instrument, the author suggests to start with an estimation of the necessary gradient strength using the equations in Section 5. The overall size together with Equation (7) then determines the necessary strength for the homogeneous field. The size of the various magnets should then be estimated from the equations in Appendix B (some general programming code for this purpose is found here [60]) before optimizing them by finite element or boundary software packages.
When planning the size of the apparatus, it is the strong belief of the author that one should first build a small mockup system (cf. Figure 8c,d) to investigate if the magnetic forces are sufficient to move the object with the desired speed. Such a mockup system can easily be constructed on a centimeter-scale using 3D-printed supports and inexpensive magnets, which are available from manifold sources on the internet. It is good advice to keep the magnets as small as possible for the desired effect, because (a) even with such a small system, the hydrodynamics can readily be tested; (b) magneto-mechanical forces can be estimated, which might become a real problem during construction or operation; and (c) the magnets are less expensive and much safer to handle! Scaling the system to the application size, the designer should always be aware that the force between two magnets (each with a surface A) scales as [36] for small distances and is in the range of 100 N for ca. 1 cm 2 and already 1000 N for 10 cm 2 size FeNdB magnets. This is just the force between two small magnets; two completely assembled rings can easily generate forces of about 10 kN. Therefore, scaling such magnetic designs up often becomes an engineering problem in calculating and managing forces, using suitable materials of sufficient thickness, constructing tailored tools, and establishing safe procedures for placing and fixing the permanent magnets. A process which requires a lot of experience, which one can only acquire safely by first tinkering with smaller systems.