An optical device, comprising: an optical port array having at least one optical input port for receiving an optical beam and a plurality of optical output ports; an optical arrangement for allowing optical coupling between the at least one optical input port and each of the optical output ports and preventing any light entering any one of the plurality of optical output ports from being coupled to any other of the plurality of optical output ports; a dispersion element receiving the optical beam from the at least one optical input after traversing the optical arrangement and spatially separating the optical beam into a plurality of wavelength components; a focusing element for focusing the plurality of wavelength components; and a programmable optical phase modulator for receiving the focused plurality of wavelength components, the modulator being configured to steer the wavelength components to a selected one of the optical outputs, wherein the optical arrangement includes: at least one walkoff crystal for spatially separating the optical beams received from any of the ports in optical port array into first and second optical components being arranged in first and second polarization states, respectively; a first composite halfwave plate for arranging the first optical components into the second polarization state characterized in that said optical arrangement furthermore includes: a Faraday rotator and a second composite half-wave plate, the Faraday rotator and the second composite half-wave plate rotating the spatially separated optical beams received from the optical input port via the first composite half-wave plate into the first polarization state and rotating the spatially separated optical beams received from the plurality of optical output ports into the second orthogonal polarization state. an optical port array having at least one optical input port for receiving an optical beam and a plurality of optical output ports; an optical arrangement for allowing optical coupling between the at least one optical input port and each of the optical output ports and preventing any light entering any one of the plurality of optical output ports from being coupled to any other of the plurality of optical output ports; a dispersion element receiving the optical beam from the at least one optical input after traversing the optical arrangement and spatially separating the optical beam into a plurality of wavelength components; a focusing element for focusing the plurality of wavelength components; and a programmable optical phase modulator for receiving the focused plurality of wavelength components, the modulator being configured to steer the wavelength components to a selected one of the optical outputs, wherein the optical arrangement includes: at least one walkoff crystal for spatially separating the optical beams received from any of the ports in optical port array into first and second optical components being arranged in first and second polarization states, respectively; a first composite halfwave plate for arranging the first optical components into the second polarization state characterized in that said optical arrangement furthermore includes: a Faraday rotator and a second composite half-wave plate, the Faraday rotator and the second composite half-wave plate rotating the spatially separated optical beams received from the optical input port via the first composite half-wave plate into the first polarization state and rotating the spatially separated optical beams received from the plurality of optical output ports into the second orthogonal polarization state.