Diffractive optical elements and spatial light modulators