An optical device includes a planar subwavelength grating (10) formed in a dielectric material and having a laterally varying, continuous grating vector. When used to modulate a beam of laterally uniform polarized electromagnetic radiation incident thereon, the device passes the incident beam with a predetermined, laterally varying transmissivity and/or retardation. When used to effect polarization state transformation, the device transforms a beam of electromagnetic radiation incident thereon into a transmitted beam having a predetermined, laterally varying polarization state. The device (214) can be used to provide radially polarized electromagnetic radiation for accelerating subatomic particles or for cutting a workpiece. The device (108) also can be used, in conjuction with a mechanism for measuring the lateral variation of the intensity of the transmitted beam, for measuring all four Stokes parameters that define the polarization state of the incident beam.