This repository contains the simulation of a quantum optical shallow network implemented through the Hong-Ou-Mandel effect. The main code can be found in quantumNetwork.ipynb, implemented with arbitrary number of neurons. Training and validation data are prepared in dataprocessing.py, using the MNIST, the Fashion-MNIST, and the CIFAR-10 datasets for binary classification tasks. A classical analogue is reported in classicalNetwork.ipynb, with the possibility to add constraints given by the normalization and the positivity conditions. Dependencies: tensorflow 2.18.0 and keras 3.8.0.
Contributors: Angela Rosy Morgillo @MorgilloR and Simone Roncallo @simoneroncallo
Reference: Simone Roncallo, Angela Rosy Morgillo, Chiara Macchiavello, Lorenzo Maccone and Seth Lloyd “Quantum optical shallow networks” (2025)