Nonhomogeneous magnetic field magnet