API reference

BellPolytopes.bell_frank_wolfeMethod

Calls the lazy pairwise blended conditional gradient algorithm from Frank-Wolfe package.

Arguments:

  • p: a correlation/probability tensor of order N.

Returns:

  • x: a correlation/probability tensor of order N, 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 iterate x, contains fields weights, atoms, and x,
  • M: a Bell inequality, meaningful only if the dual gap is small enough,
  • β: the local bound of the inequality parametrised by M, reliable only if the last LMO is exact.

Optional arguments:

  • o: same type as p, corresponds to the noise to be added, by default the center of the polytope,
  • prob: a boolean, indicates if p is a corelation or probability array,
  • marg: a boolean, indicates if p contains marginals (by convention in the last index of each dimension),
  • v0: the visibility used to make a nonlocal p closer 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 if verbose = 3,
  • seed: an integer, the initial random seed.
source
BellPolytopes.local_boundMethod

Compute the local bound of a Bell inequality parametrised by M. No symmetry detection is implemented yet, used mostly for pedagogy and tests.

source
BellPolytopes.move_margMethod
move_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.

source
BellPolytopes.nonlocality_thresholdMethod
nonlocality_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 of p,
  • upper_bound: a (heuristic) upper bound on the nonlocality threshold of p
  • local_model: a decomposition of the tensor p with visibility lower_bound (up to a distance 2√epsilon),
  • bell_inequality: a (heuristic) Bell inequality corresponding to upper_bound.

Optional arguments:

  • ``
  • digits: number of digits of lower_bound, 4 by default,
  • for the other optional arguments, see bell_frank_wolfe.
source