To reduce the skew angle components in a dipole ring magnetic field
generating device, a magnetic field generating device 1 is provided in
which comprises: a plurality of magnet elements 101 to 124 arranged in a
ring shape such that a magnetization direction of the magnet elements
undergoes one rotation over half a circumference of the ring, wherein the
magnet elements generate a substantially unidirectional magnetic field in
a space within the ring; and corrective magnets 201 to 204 arranged on an
outer edge portion forming an aperture in a Z-axis direction of the
magnetic field generating device, wherein the Z-axis is defined as a
central axis of the magnetic field generating device, the Y-axis is
defined as a direction perpendicular to the Z-axis and parallel to the
unidirectional magnetic field, and the X axis is defined as a direction
perpendicular to the Z axis and the Y axis.