Skip to content

tkrivachy/triangle-nonlocality-symmetric-subspace

Repository files navigation

triangle-nonlocality-symmetric-subspace

Computational appendix for the work on exploring local hidden variable models in the fully symmetric subspace of the triangle network.

Organization: data is provided in the data directory, scripts are in the main directory, and plots that are generated by the scripts can be found in the plots directory.

Data and code for the NN-inspired Bell-type inequality

The data folder includes $(w, \delta_w)$ pairs LHV-Net found for l=1,2. Recall the inequality is

$f_w(p) - f_w(p_{elegant}) \leq \delta_w$,

with:

$f_w(p) = w s_{111}(p) - (1-w) \Delta_l(p)$,

where $\Delta_l(p)$ is a penalty for being non-symmetric and $s_{111}$ captures the strength of (1,1,1)-type outcomes. The parameter $w$ balances these two. Details in the paper.

The python script ineq_finding_best_w_plots.py evaluates $f_w(p) - f_w(p_{\text{EJM}})$ for several distributions and plots them together with the maximum of this expression as found by LHV-Net. Moreover, with the help of the function f_w_minus_f_w_Elegant, we can evaluate the inequality's main expression for any distribution pabc and any w, l (use verbose=True to see the average values and penalties used in the inequality). Together with the delta_w values, we can then check if the inequality is violated for a given distribution pabc and w,l.

Data and code for almost symmetric classical strategy with s_111 > 0.25

The distribution found by LHV-Net with $s_{111} \approx 0.289$ can be found in data/probs_LHVNet_high111.csv, with probabilities given in lexicographic order (0,0,0; 0,0,1; ... 3,3,3). np.reshape can reshape it into a (4,4,4) tensor if necessary. The discretized, deterministic apporixmation of this distribution (with $s_{111} \approx 0.294$) can be found in data/probs_high111.csv, with a similar format.

The flags of the determistic, discretized approximation (flags discretized to a 100x100 grid), can be found in data/flags_high111.json. An example python script for loading and plotting these flags, as well as analyzing the distribution, is provided (flag_plotter_high111.py)

Data and code for the local maps of the symmetric subspaces for $N=3,4,5,6$

Data can be found in data/symmetric_subspace_maps/, one csv for each of the four considered cardinalities (3,4,5,6). First three columns give the $s_{111}, s_{112}, s_{123}$ values, while the fourth column gives the lowest Euclidean distance that LHV-Net found between the target point with such $(s_{111}, s_{112}, s_{123})$ values and the set of local distributions (as approximated by LHV-Net).

An accompanying python script is provided, symmetric_subspace_map_plotter.py, which loads and plots this data. Moreover for cardinality 4, it plots the Elegant distribution and its noisy verison as well, where sources are given a finite visibility (see https://www.nature.com/articles/s41534-020-00305-x for details).

Checking the output distribution of flags

The Mathematica notebook flag_check.nb provides utilities to define flag models (local models), plot them, and compute the associated output distributions. A sample of this notebook can be found in plots/flag_check_sample_plot.pdf, showing the kind of local model that can be plotted with this notebook.

This notebook contains code that defines flags models as found in the paper, and compares the associated output distributions to the ones stated in the paper.

Plotting the full analytically local region that we found

The python script plot_full_inner_approx.py, to be ran as python3 plot_full_inner_approx.py, generates the plot plots/full_inner_approx.png. The way the script works is by sampling uniformly over the analytical parameters that define the local region, and plotting the corresponding points. The resulting sampled local points in the symmetric subspace are not themselves uniformly spaced out, though. One can easily modify the script to choose a denser sampling, if desired.

About

Computational appendix for the work on exploring local hidden variable models in the fully symmetric subspace of the triangle network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published