The file codes.py
contains all the codes that are implemented in the nonlocality_certification
jupyter-notebook. The main routine is optimal_value(...)
,
which optimizes the following function
$$ R=\max_{s}\frac{\mathcal{Q}(s)-\Delta \mathcal{Q}(s)+dm}{\mathcal{C}(s)+dm}, $$
with $\mathcal{Q}(s)$ and $\mathcal{C}(s)$ the Quantum and the Local Hidden values, respectively, of a Bell inequality and $\Delta \mathcal{Q}(s)$ is the experimental error of the Quantum value. This optimization requires the data stored in the experimental_data
folder.