Schematic cross-sections and architecture of a Halbach magnet compatible for microscope systems. (A) An ideal Halbach dipole cylinder (black) providing a homogeneous magnetic field, B0 (magnetic field amplitude is sketched by shades of blue and yellow field lines); (B) An ideal Halbach quadrupole (red) generating a constant radial magnetic field gradient. (C) In a combined Halbach dipole and quadrupole, only the gradient component along B0 is relevant to generate the magnetic force (Fmag), on particles inside the innermost cylinder (Fmag is homogeneous in strength and direction in a distance r from the center if B0 ≫ Gr is fulfilled). The angle of Fmag changes by 2α if the quadrupole is rotated by α relative to the dipole. For details see.22 (D–G) Effect on some magnetic particles in the inner volume. Here it is assumed that the particles have some remnant magnetization, hence they always possess a magnetic moment. (D) In the absence of any magnetic field the particles point in arbitrary directions. (E) In a homogeneous field they align with the field, but in the absence of a gradient there is no force on them. (F) In the gradient field of a quadrupole, the force (blue arrows) is radial, ie, zero in the centre and increasing with the distance from it. (G) the combination of homogeneous and gradient field results in a constant force in one direction. (H–J) Magnetic guiding system for microscopes. (H) Disassembled system: 1) Support to fit microscope stages using different adaptors. 2) Halbach dipole generating B0= 0.097 T. Red line indicates poles. 3) Halbach quadrupole completely filled with magnets, producing G = 1.3 T/m. 4) Weaker quadrupole with only every forth magnet present, producing G = 0.33 T/m. (I) Assembled system with a weight of 273 g. (J) System mounted on a Leica TCS SP5 confocal microscope.