Code to accompany The minimal example of quantum network Bell nonlocality
Erwan Don, Jessica Bavaresco, Patryk Lipka-Bartosik, Nicolas Gisin, Nicolas Brunner, and Alejandro Pozas-Kerstjens
This is a repository containing the code used to compute the figures 3 and 4 of "The minimal example of quantum network Bell nonlocality". Erwan Don, Jessica Bavaresco, Patryk Lipka-Bartosik, Nicolas Gisin, Nicolas Brunner, and Alejandro Pozas-Kerstjens, arXiv:2605.00981." It provides the codes for proving the triangle nonlocality and for finding quantum realizations of noisy
The code is written in Python (for finding the quantum models) and in C++ (for proving network nonlocality). The Python part requires numpy for math operations, scipy for the optimization engine, and matplotlib for plots. The nonlocality part requires Mosek as a solver for linear programs.
The network nonlocality part must be compiled. In order to do so, please follow the instructions in the fast-inflation documentation. However, the following should suffice:
cd nonlocality-detection
make prepare
make releaseThen, in order to perform one of the tests, just run ./ release_inf w_(visibility). Further instructions can be found in the fast-inflation documentation.
The file quantum_realizations.ipynb is a Jupyter notebook that computes the parameters for our models in Fig. 3 (
If you would like to cite this work, please use the following format:
@misc{don2026minimal,
title = {The minimal example of quantum network {Bell} nonlocality},
author = {Don, Erwan and Bavaresco, Jessica and Gisin, Nicolas and Brunner, Nicolas and Pozas-Kerstjens, Alejandro},
archivePrefix = {arXiv},
eprint = {2605.00981}
}