Resonant metasurfaces for generating complex quantum states | Synapse