Periodic magnetic field as a polarized and focusing thermal neutron spectrometer and monochromator.