  Metasurfaces have recently opened up applications in the quantum regime,
including quantum tomography and the generation of quantum entangled states.
With their capability to store a vast amount of information by utilizing the
various geometric degrees of freedom of nanostructures, metasurfaces are
expected to be useful for processing quantum information. In this study, we
propose and experimentally demonstrate a programmable metasurface capable of
performing quantum algorithms using both classical light and quantum light at
the single photon level. Our approach encodes multiple programmable quantum
algorithms, such as Grover's algorithm and the quantum Fourier transform, onto
the same metalens array on a metasurface. A spatial light modulator selectively
excites different sets of metalenses to carry out the quantum algorithms, while
the photon arrival data or interference patterns captured by a single photon
camera are used to extract information about the output state. Our programmable
quantum metasurface approach holds potential as a cost-effective means of
miniaturizing components for quantum computing and information processing.
