MerLin: a framework for differentiable photonic quantum machine learning

Machine Learning


MerLin 0.3 is an open-source framework developed by Quandela for systematic exploration of photonic and hybrid quantum machine learning (QML). Built on the Perceval SDK, it leverages powerful linear optical simulation (SLOS) to perform accurate quantum state calculations within the PyTorch native environment. The core of the architecture is QuantumLayer, torch.nn.Module This enables end-to-end differentiable training of linear optical circuits. This framework accelerates gradient-based optimization of circuit parameters such as phase shifters and beam splitters directly within standard classical AI pipelines by precomputing sparse photon number transition graphs.

The framework supports multiple data encoding methods, including angular encoding for Fourier-like feature mapping and amplitude encoding for state vector initialization. a QuantumBridge Abstractions enable cross-paradigm architecture comparisons by mapping qubit-based gates to photonic dual-rail or QLOQ encodings. MerLin is designed to recognize and run on hardware. MerlinProcessor This facilitates the offloading of hybrid model components to physical quantum processing units (QPUs) such as Quandela’s Belenos system. It also integrates noise models and detector-specific semantics (such as photon number decomposition and threshold detectors), allowing researchers to simulate hardware constraints during the training phase.

To address QML reproducibility challenges, MerLin includes a library of 18 reproduced state-of-the-art papers spanning quantum kernels, reservoir computing, and convolutional architectures. These modular experiments provide a standardized baseline for comparing photonic and gate-based modalities under uniform conditions. Technical insights from these reproductions show that the expressive power of photonic variational quantum circuits (VQCs) scales linearly with the number of input photons without increasing the circuit depth. This empirical approach aims to move QML from an isolated demonstration to a disciplined engineering framework for evaluating quantum utility.

For more information, please see the MerLin technical documentation here, the official blog description here, the MerLin GitHub repository here, or the framework documentation here.

February 21, 2026

Printable, PDF, and email compatible





Source link