API reference
BellPolytopes.bell_frank_wolfe — MethodCalls the lazy pairwise blended conditional gradient algorithm from Frank-Wolfe package.
Arguments:
p: a correlation/probability tensor of orderN.
Returns:
x: a correlation/probability tensor of orderN, the output of the Frank-Wolfe algorithm,ds: a deterministic strategy, the atom returned by the last LMO,primal:½|x-v₀*p|²,dual_gap:⟨x-v₀*p, x-ds⟩,active_set: all deterministic strategies used for the decomposition of the last iteratex, contains fieldsweights,atoms, andx,M: a Bell inequality, meaningful only if the dual gap is small enough,β: the local bound of the inequality parametrised byM, reliable only if the last LMO is exact.
Optional arguments:
o: same type asp, corresponds to the noise to be added, by default the center of the polytope,prob: a boolean, indicates ifpis a corelation or probability array,marg: a boolean, indicates ifpcontains marginals (by convention in the last index of each dimension),v0: the visibility used to make a nonlocalpcloser to the local polytope,epsilon: the tolerance, used as a stopping criterion (when the primal value or the dual gap go below its value), by default 1e-7,verbose: an integer, indicates the level of verbosity from 0 to 3,shr2: the potential underlying shrinking factor, used to display the lower bound in the callback,mode: an integer, 0 is for the heuristic LMO, 1 for the enumeration LMO,nb: an integer, number of random tries in the LMO, if heuristic, by default 10^2,TL: type of the last call of the LMO,mode_last: an integer, mode of the last call of the LMO, -1 for no last call,nb_last: an integer, number of random tries in the last LMO, if heuristic, by default 10^5,sym: a boolean, indicates if the symmetry of the input should be used, by default automatic choice,use_array: a boolean, indicates to store the full deterministic strategies to trade memory for speed in multipartite scenarios,callback_interval: an integer, print interval ifverbose= 3,seed: an integer, the initial random seed.
BellPolytopes.local_bound — MethodCompute the local bound of a Bell inequality parametrised by M. No symmetry detection is implemented yet, used mostly for pedagogy and tests.
BellPolytopes.move_marg — Methodmove_marg(FC::AbstractArray, sense::Int = -1)Change convention for the placement of marginals. By default, converts from first to last index. If sense=1, convert back from last to first index.
BellPolytopes.nonlocality_threshold — Methodnonlocality_threshold(p::Array, lower_bound = 0, upper_bound = 1)Compute the nonlocality threshold of the probability/correlation tensor p.
Returns:
lower_bound: a (exact up to analyticity step) lower bound on the nonlocality threshold ofp,upper_bound: a (heuristic) upper bound on the nonlocality threshold ofplocal_model: a decomposition of the tensorpwith visibilitylower_bound(up to a distance2√epsilon),bell_inequality: a (heuristic) Bell inequality corresponding toupper_bound.
Optional arguments:
- ``
digits: number of digits oflower_bound, 4 by default,- for the other optional arguments, see
bell_frank_wolfe.
BellPolytopes.pythagorean_approximation — MethodCompute a rational approximation of a m × 3 Bloch matrix.
BellPolytopes.shrinking_squared — MethodCompute the shrinking factor of a m × 3 Bloch matrix, symmetrising it to account for antipodal vectors.