Abstract The swap test is a quantum algorithm capable of computing the absolute value of the scalar product of two arbitrary wavefunctions. Scalar products represent a crucial ingredient to many QML methods, but their evaluation is not straightforward at all. For this reason, many research efforts have been made without achieving an efficient and robust implementation. Here, we present an integrated photonic circuit designed to implement the swap test algorithm. Our approach relies solely on linear optical integrated components and qudits, represented by single photons from an attenuated laser beam propagating through a set of waveguides. By utilizing 2$^3$ spatial degrees of freedom for the qudits, we can configure all the necessary arrangements to set any two-qubit state and perform the swap test. This simplifies the requirements on the circuitry elements and eliminates the need for non-linearity, heralding, or post-selection to achieve multi-qubit gates. Our photonic swap test circuit successfully encodes two qubits and estimates their scalar product with a measured root mean square error smaller than 0.05. This result paves the way for the development of integrated photonic architectures capable of performing Quantum Machine Learning tasks with robust devices operating at room temperature.
Read full abstract