A metasurface optical pulse shaper includes a metasurface with superpixels disposed on an entry side of the metasurface and a wire grid polarizer disposed on an exit surface of the metasurface for controlling a phase, amplitude, or polarization of an optical pulse, wherein the metasurface in