Space-variant Pancharatnam-Berry phase optical elements based on computer-generated subwavelength gratings are presented. By continuously controlling the local orientation and period of the grating we can achieve any desired phase element. Unlike diffractive and refractive elements, the phase is not introduced through optical path differences, but results from the geometrical phase that accompanies space-variant polarization manipulation. We introduce and experimentally demonstrate Pancharatnam-Berry phase optical elements (PBOEs) such as polarization beam-splitters, optical switches and spiral phase. We also introduce and experimentally demonstrate quanitized pancharatnam-Berry phase diffractive optics. We realized quantized geometrical blazed polarization diffraction gratings, as well as a polarization dependent focusing lens for CO 2 laser radiation at a wavelength of 10.6 micron on GaAs substrates. We also demonstrate the formation of propagation-invariant linearly polarized axial symmetric beams by use of quantized Pancharatnam-Berry optical elements. Finally a novel method for real time polarimetry and infrared polarization scrambler by use of quasi-periodic subwavelength structures is presented.