Metasurface for programmable quantum algorithms with quantum and classical light

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.

While superconducting circuits and trapped ions are two promising physical technologies for implementing quantum computing, photonic implementation remains a versatile platform [1][2][3].Photonic implementation not only allows for the investigation of fundamental questions in quantum mechanics [4][5][6], but also provides a practical way to demonstrate the advantages of quantum algorithms in solving problems that are significantly slower on classical computers [7][8][9].In fact, classical optics already possesses key elements of quantum computing, such as superposition, interference, and to a large extent, non-separable states analogous to entanglement without quantum non-locality [10,11].By utilizing the different internal degrees of freedom of a single photon, it becomes possible to construct non-separable states and perform quantum algorithms at both the single-photon level and even using classical light [12,13].
Tremendous efforts have been devoted to simulating various quantum algorithms using classical light as an easily accessible testbed.For instance, quantum algorithms involving up to two-qubit operations can be constructed using common optical components, such as beam splitters, polarization beam splitters, lenses, and Dove prisms, by leveraging the two paths and polarization degrees of freedom [12,13].Recent experiments have explored the use of vortex beams generated or manipulated by a spatial light modulator (SLM) to achieve quantum algorithms with up to 4 qubits, utilizing 16 orbital angular momenta (OAM) [14,15].Additionally, more efficient and programmable utilization of the SLM has demonstrated the implementation of the Deutsch-Jozsa algorithm with an effective complexity of 20 qubits [16,17].These principles can also be applied at the single-photon level when using a quantum source, where practical demonstrations often employ the heralding technique to enhance detection purity and signal-to-noise ratio [17,18].Moreover, by working with photon counting in the quantum regime, it becomes possible to investigate two-photon physics within the same linear optical system.This approach opens up avenues for studying boson sampling, a nonuniversal quantum computation method that is useful for evaluating the permanents of matrices [19].
On the other hand, metasurfaces, which consist of a single layer of nanostructures, have proven to be highly useful in multiplexing or demultiplexing optical information.They have been applied successfully in generating vortex beams and holograms with fine resolution [20][21][22][23][24].As we move towards the quantum regime, we are witnessing early demonstrations of metasurfaces in quantum tomography, the generation of high-dimensional entanglement, quantum imaging, and the manipulation of two-photon interference [25][26][27][28][29][30][31][32].Furthermore, due to their capability to store a significant amount of information regarding light-matter interaction, metasurfaces offer potential for processing quantum optical information and implementing quantum algorithms.Some studies have even proposed the use of metamaterials to simulate quantum algorithms in the classical domain [33][34][35].
In this work, we have developed a platform that utilizes a geometric-phase metalens array on a metasurface to execute quantum algorithms, enabling the implementation of unitary transformations in a single step.By employing a spatial light modulator (SLM) and a single photon camera for the generation and detection of input and output states, we have successfully performed programmable quantum algorithms in the optical domain.This includes the implementation of Grover's search (GS) and the quantum Fourier transform (QFT) by selectively illuminating the metalenses.To validate our approach, we conducted simulations and experiments using both classical and quantum light.The programmable nature of our approach offers the potential for miniaturizing quantum optical circuits, providing a low-cost and integrated solution for quantum information processing.

Computing scheme using metalens array for quantum algorithms
Our goal is to implement a specific quantum algorithm for n-qubits, which can be summarized as a transformation: |⟩, where  is a unitary matrix, using a metasurface.The integer  or  within the "ket" notation ranges from 0 to 2  − 1, representing the -qubit basis for either the input or output state.Our metasurface approach is shown in Fig. 1a.A spatial light modulator (SLM) is utilized to prepare the input state ∑   (in) |⟩ , where   (in) represents the complex electric field normally incident on the lens located at   .The SLM operates in vertical polarization, which is subsequently converted to left-circular polarization (LCP) before illuminating the metasurface.Our metasurface comprises 9 metalenses, out of which four are employed to perform a specific 2-qubit ( = 2) unitary operation.Each metalens at   diffracts the incident electric field   (in) into a discrete set of output directions   , with the designed complex amplitudes   (different colors, although physically all at the same wavelength, illustrate different output directions; for instance, a green beam corresponds to the normal exit direction, while a cyan beam corresponds to a 10° deflection to the left).In our case, each metalens converts LCP to right-circular polarization (RCP) using a custom complex transmission amplitude and phase profile given by the expression: where  denotes the transverse position measured from the center of the entire metasurface.  in) ⟩ by modulating the complex incident E-field for each selected metalens at  0 to  3 .Each metalens diffracts the beam into multiple output directions, with amplitude and phase modulated by the -matrix.The interference patterns of the diffracted beams in the same direction are projected onto the Fourier plane, where the intensity profile around  0 to  3 yields the output state | (out) ⟩. b, Complex transmission amplitude and phase profile of the metalens array, encoding both Grover's Search (GS) and Quantum Fourier Transform (QFT).c, Far-field intensity profile when only the center lens is excited to implement a column of the unitary U matrix.The color shows phase modulation for different output directions (all of the same wavelength).d, The corresponding matrices for the two programmed quantum operators,  ̂ and  ̂ .Programmability is achieved by selecting the metalens excitation ( 0 to  3 ) and the projected interference patterns ( 0 to  3 ).For example, selecting red square in (b) and (c) enables GS, while selecting blue square enables QFT.
Our scheme incorporates programmability using a static metasurface with shared resources for different quantum algorithm choices through selective illumination.The input field   (in) on a specific metalens at   is prepared by the corresponding region of a (phase) SLM at normal incidence.A certain fraction of these pixels is deactivated by introducing a phase gradient, diverting the light at an angle that does not fall on the lens array.This process sets   (in) with both amplitude and phase [31].The metalens then implements the j-th column of the unitary matrix  through a transmission profile at each lens.Fig. 1b illustrates the transmission profile (amplitude and phase in a color map) of our metasurface, comprising a total of 9 metalenses.
It should be noted that an additional quadratic focusing phase profile is added to each transmission profile, integrating the schematic Fourier lens shown in Fig. 1a onto the metalens array.Our metalens array is programmed with two different quantum operations: Grover's search (GS) or quantum Fourier transform (QFT), achieved by illuminating an arbitrary 2quibit input state on the 4 upper left (dashed red square) or lower right lenses (dashed blue square) in Fig. 1b, referred to as R-space, using the SLM.The lens labels  0 to  3 for the GS are indicated in Fig. 1a, while same lens labels are defined in a similar row-major order for the lenses used in QFT.On the other hand, the four output directions  0 to  3 for the GS or QFT are shown in Fig. 1c, referred to as k-space, again using dashed red square or blue square.For convenience, we have adopted the same label order as the convention used for R-space, but other choices are possible as long as 4 out of the 9 directions are selected as outputs in defining the  matrix.The corresponding unitary matrices of GS (  ) and QFT (  ) are shown Fig. 1d (normalization factor omitted).Taking the center lens,  3 , as an example, it generates {1,1,1, −1} at its 4 output directions for   , or {−1, −1, −1, −1} (for the same lens now labeled as  0 ) at its 4 output directions for   (a global  phase is added to the entire matrix without altering unitarity).Thus,  3 →  3 for   and  0 →  0 for   both implement the same matrix element −1, indicating that this resource is shared between the two algorithms.
These 8 matrix elements, with one of them shared and implemented by the center lens, are shown in Fig. 1c.The sharing of resources allows for a more compact implementation of the metalens array and the incorporation of additional functions given limited resources.For the entire (9 lenses) × (9 directions) matrix, there are unused matrix elements where we can embed more operations (for further details, refer to the Supplementary Materials).

Geometric-phase metasurface and experimental setup
Fig. 2a showcases the Scanning Electron Microscope (SEM) image of the metasurface, with a close-up view provided in Fig. 2b.The design consists of nine metalenses, each comprising 32 unit cells along the diameter (approximately 20μm in diameter).Each metalens is composed of nano-slots with variable orientations.In particular, each unit cell, with a periodicity of  = 620nm, contains two pairs of rotated nanoslots (195 nm long, 50 nm wide) with rotation angles  1 and  2 , as depicted in Fig. 2c.The chosen periodicity is smaller than the operational wavelength of  = 810nm to suppress higher-order diffraction.Regarding the two pairs of rotating slots within a unit cell, we focus on achieving cross-circular polarization (CP) from LCP to RCP in our scheme, contributing to a transmission with an amplitude proportional to |cos( 1 −  2 )| and an overall geometric phase of  1 +  2 [36].By selecting appropriate values of  1 and  2 at each unit cell within the metalens at   , the resultant complex transmission amplitude profile is designed to match the specifications outlined in Eq. ( 1), where now the  matrix represents the whole 9 × 9 operation matrix obtained by combining all the unitary matrices of the programmed quantum algorithms.Here,  ranges from 0 to 8, corresponding to the 9 output directions from the same lens at   .The design of metalens array, incorporating the nanoslots with the orientation profile, is fabricated on silver-coated glass (50nm coating) using the focused ion beam (FIB) technique.

Experimental characterization
We first examine the operations of the metasurface using classical light.In this case, we replace the part before the SLM in Fig. 2d with a 810 nm laser (OBIS LX 808 nm 150 mW Laser).The utilization of classical light for excitation effectively enhances the signal, resulting in shorter acquisition times (5-10ms).It also leads to higher resolution in the interference patterns formed at the focal plane of the metalens array.This is because the higher receiving power can be distributed among more pixels on the single photon camera.These investigations facilitate the more challenging task of extracting information from the interference patterns in the subsequent stage with a quantum light source.code: red for 1, cyan for -1, green for i, and purple for -i, shaded regions (phase gradient) are effectively inactive.b, Numerical simulation of the far-field interference pattern.c, Experimental result using a classical light source.The input and output states are labeled at the top and bottom of each column.The library for decoding the interference pattern into the output state for the representative cases of value 0 and 1 is listed in the bottom inset.
Fig. 3 displays the simulation and experimental results obtained using a classical light source for two quantum algorithms: GS (left 4 columns) and QFT (right 4 columns).For each algorithm, we test it using four different input states, which are labeled at the top of each corresponding result column.Let us begin with the first column, which corresponds to the input state (−1,1,1,1) for the GS algorithm.Our objective is to pick the basis with  phase shift and output the state (1,0,0,0) with unit probability on the corresponding basis using the metalens array to implement the unitary matrix   (as shown in the matrix multiplication in Fig. 1d).
The input state is initially encoded as the phase profile on the SLM (Fig. 3a) using the four upper-left lenses in a row-major manner: a region marked as -1 has a constant SLM phase of π (cyan color), while a region marked as 1 has a constant SLM phase of 0 (red color).Only the corresponding metalenses are selectively excited to implement the GS algorithm, while the other regions display a phase gradient to deflect the light away from the metalens array.In the far field, the interference patterns are formed at the output directions, as shown in the numerical simulation (by propagating the complex field to the focal plane of the metalens) in Fig. 3b    can then be determined from the center of each interference pattern.It is worth noting that only the upper left 4 directions exhibit notable interference patterns (as seen Fig. 1c).To achieve higher accuracy, we extract the intensity using the entire interference pattern.Some representative cases from the library are shown at the bottom of Fig. 3, illustrating the different possible patterns for value 0 (fully destructive, resulting in dark centers) and 1 (fully constructive, resulting in a bright center).By comparing the interference patterns with the library, we find that the output state agrees to the expected result (1,0,0,0) for the GS algorithm.
In the meantime, for the sake of convenience of our discussion, we discretize the output state to be either fully destructive or fully constructive interference.More details are given in Supplementary Materials regarding the decoding process for the full spectrum of intensity values, other than 0 and 1, which will be used in the next step.With the previous experience gained from using classical light to confirm the metasurface's functionality, we now shift our focus to discussing the results obtained with a quantum light source.This presents an additional challenge in extracting information due to the lower number of photons reaching the single photon camera.In this case, we can only use a significantly smaller number of pixels on the camera, around 40 × 40 pixels, to capture the total interference patterns for all four output directions.This allows us to still ensure an adequate number photons per pixel, enabling data acquisition within a manageable time duration.To mitigate the impact of environmental noise in the situation of smaller number of signal photons, we adopt the heralding technique (as shown in Fig. 2d).Subsequently, we develop a fitting procedure for each interference pattern formed at a particular output direction, assuming that only four waves from the involved metalenses interfere with each other.The fitting parameters correspond to the complex amplitudes exiting each metalens.Based on this fitting procedure, we achieve an effective 4x up-sampling of the interference pattern images, which are presented in Fig. 4a and Fig. 4b for the GS and QFT algorithms, respectively.Further details regarding the up-sampling process using the physical fitting model are provided in the Supplementary Materials.The up-sampled interference patterns are displayed in a tabular form with each column labeling the input state and each row labeling the output interference pattern at individual output directions (output basis), resembling to the classical results shown in Fig. 3 by reading out the individual interference patterns in a row-major manner.At the same time, we have also obtained the |  (out) | (continuous values now) at each output direction   during the fitting process.These values are presented in the same tabular form in Fig. 4c and Fig. 4d for the GS and QFT algorithms, respectively.In both cases, a comparison is made to the expected results (identity matrix), resulting in a root-mean-square error (RMSE) of 0.148 for all 16 elements in the GS algorithm and 0.216 for the QFT algorithm.It is worth noting that the larger error observed at the  0 direction in the QFT algorithm (as shown in Figure 4d) can be attributed to the presence of residual beams, which also appear in Figure 3c, contributing to the larger RMSE in the QFT case.

Conclusion
In conclusion, we have developed a metalens array platform capable of implementing quantum algorithms at the single-photon level.The functionality of the platform has been validated using both classical and quantum light sources.By selectively exciting subsets of metalenses and interpreting the interference patterns at specific output directions, we have demonstrated the programmability of quantum algorithms, exemplified by the Grover's search (GS) and Quantum Fourier Transform (QFT) algorithms in this work.Such a platform holds promise for miniaturizing quantum optical circuits and algorithms, opening up possibilities for metasurface applications.Although the scalability to a larger number of qubits through this approach requires further exploration, it already offers the opportunity to 'factorize' certain components within a larger-scale quantum computation.The metasurface can effectively reduce the size and eliminate the need for optical alignment in the factorized part.While we have demonstrated resource sharing between two algorithms on the same metasurface, further optimization of resource management can be explored in future developments.Additionally, the current work utilizes a geometric metasurface with robust operation, relying on metallic components rather than local resonances.However, it may be advantageous to adopt dielectric metasurfaces in the foreseeable future to achieve higher transmission efficiency, thereby enabling the use of larger metalens arrays for quantum operations.
Consequently, light from different metalenses with the same output direction interferes in the far-field regime, resulting in an electric field   (out) in RCP.The interference pattern |  (out) | 2 around each direction   is captured by a single photon camera.The entire unitary operation can be summarized as   (out) = ∑     () 2  −1 =0in terms of the complex field amplitudes.

Fig. 1 |
Fig. 1 | Computing metasurface for programmable quantum algorithm.a, Overall schematic of the computing metasurface for implementing two-qubit unitary quantum operations.A spatial light modulator (SLM) selectively excites the metalens array and prepares the two-qubit input state | (in) ⟩ by modulating the complex incident E-field for

Fig. 2 |
Fig. 2 | Geometric-phase metalens array and heralding photon experimental setup.a, SEM image of the metasurface designed for operational wavelength λ = 810 nm.b, Enlarged SEM view of the metalens array showcasing the quality of the metalens.c, Unit cell for controlling amplitude and phase response, composed of two pairs of rotated nano-air-slots on a silver film (50nm thick) coated glass substrate.d, Experimental setup using a heralding photon source for imaging the far-field interference patterns resulting from the quantum operation.

Fig. 3 |
Fig. 3 | Simulation and experimental results using classical light source for the Grover-Search (left) and QFT (right).a, SLM phase profile for each input state for the two algorithms: four input states for each algorithm listed at the top of each column.Color and the experimental results captured by the single photon camera in Fig. 3c.The interference patterns (intensity) for the two results closely resemble each other and represent the output state in the upper left region, indexed also in a row-major manner.The intensity |  (out) | 2 at direction

Fig. 4 |
Fig. 4 | Experimental results using quantum heralding photon source.(a-b), Interference patterns after up-sampling for the GS (left) and QFT (right) algorithms.(cd), Normalized fitted output state amplitudes extracted from the interference patterns for the corresponding algorithms.