Magnetic resonance apparatus having a permanent magnet system with a magnet arrangement for generating a homogeneous magnetic field in a direction perpendicular to a z-axis in a measurement volume, wherein the permanent magnet system comprises at least two ring-shaped magnet elements (2, 2') containing magnetic material in a ring plane, which are arranged coaxially around the z-axis and which comprise individual magnet segments arranged in a Halbach configuration, wherein the magnetization direction of at least two ring-shaped magnet elements (2, 2') deviates from the ring plane in such a way that the component perpendicular to the ring plane varies with the azimuthal angle through the center of the respective magnet segment of a ring-shaped magnet element (2, 2'), wherein a 3D angle α determines the deviation of the magnetization directions from those of a planar Halbach ring, and wherein the magnetization of in each case two ring-shaped magnet elements (2, 2') is mirror-symmetrical with respect to one another, wherein the mirror plane is the central x-y-plane perpendicular to the z-axis, wherein the ring-shaped magnet elements (2, 2') are constructed from magnet segments arranged next to one another which are composed of magnetic material, and wherein the magnetization direction of the magnet segments with respect to their outer surfaces parallel to the respective ring plane is different in each case from that of their two magnet segments adjacent in the ring-shaped magnet element (2, 2'), characterized in that the magnet segments are constructed such that the magnetization direction of the individual magnet segments follows the formula Mr = MCos α Cos φ 0, M φ = MSin φ 0, Mz = MCos φ 0 Sin α, wherein Mr, Mφ and Mz denote the components of the magnetization vector in cylindrical coordinates: M denotes the remanence of the magnet material used in the respective ring-shaped magnet element (2, 2'), φ0 denotes the azimuthal angle through the center of the respective magnet segment, and a denotes a parameter fixed for the entire ring-shaped magnet element (2, 2'), namely the 3D angle that determines the deviation of the magnetization directions from those of a planar Halbach ring. wherein the magnetization direction of at least two ring-shaped magnet elements (2, 2') deviates from the ring plane in such a way that the component perpendicular to the ring plane varies with the azimuthal angle through the center of the respective magnet segment of a ring-shaped magnet element (2, 2'), wherein a 3D angle α determines the deviation of the magnetization directions from those of a planar Halbach ring, and wherein the magnetization of in each case two ring-shaped magnet elements (2, 2') is mirror-symmetrical with respect to one another, wherein the mirror plane is the central x-y-plane perpendicular to the z-axis, wherein the ring-shaped magnet elements (2, 2') are constructed from magnet segments arranged next to one another which are composed of magnetic material, and wherein the magnetization direction of the magnet segments with respect to their outer surfaces parallel to the respective ring plane is different in each case from that of their two magnet segments adjacent in the ring-shaped magnet element (2, 2'), characterized in that the magnet segments are constructed such that the magnetization direction of the individual magnet segments follows the formula Mr = MCos α Cos φ 0, M φ = MSin φ 0, Mz = MCos φ 0 Sin α, wherein Mr, Mφ and Mz denote the components of the magnetization vector in cylindrical coordinates: M denotes the remanence of the magnet material used in the respective ring-shaped magnet element (2, 2'), φ0 denotes the azimuthal angle through the center of the respective magnet segment, and a denotes a parameter fixed for the entire ring-shaped magnet element (2, 2'), namely the 3D angle that determines the deviation of the magnetization directions from those of a planar Halbach ring.