BCSGameValue

BCSGameValue is a function that computes the maximum possible value of a given binary constraint system (BCS) game under either classical mechanics, quantum mechanics, or general no-signalling theories. In the classical and non-signalling cases, an exact value is computed, whereas the value computed in the quantum case is only an upper bound (found using the NPA hierarchy).

A binary constraint system game is a non-local game in which there is a finite set of variables $v_1, v_2, \ldots, v_k$ and a finite set of constraints placed on those variables: $$ f_1(v_1,v_2,\ldots,v_k) = 1 \quad \quad f_2(v_1,v_2,\ldots,v_k) = 1 \quad \cdots \quad f_m(v_1,v_2,\ldots,v_k) = 1. $$ One of the constraints $f_i$ is chosen (at random, with equal probability) and given to Alice, and one of the variables $v_j$ appearing in $f_i$ is chosen (at random, with equal probability) and given to Bob. Alice and Bob win the game if and only if (1) Alice returns an assignment for every variable that satisfies her constraint, and (2) Bob returns a value for his variable that agrees with the value that Alice chose for that particular variable.

Syntax

 * BCSVAL = BCSGameValue(C)
 * BCSVAL = BCSGameValue(C,MTYPE)
 * BCSVAL = BCSGameValue(C,MTYPE,K)

Argument descriptions

 * C: A cell, each of whose elements is a constraint in the BCS. The constraints themselves are specified as $2 \times 2 \times 2 \times \cdots$ binary arrays, where the $(i,j,k,\ldots)$-entry is 1 if and only if setting $v_1=i, v_2=j, v_3=k, \ldots$ satisfies that constraint.
 * MTYPE (optional, default 'classical'): A string indicating which type of theory should be used when computing the maximum value of the BCS game. Must be one of 'classical', 'quantum'</tt>, or 'nosignal'</tt>. If MTYPE = 'quantum'</tt> then only an upper bound on the non-local game is computed, not necessarily the best upper bound (see the argument K</tt> below).
 * K</tt> (optional, default 1</tt>): If MTYPE = 'quantum'</tt> then this is a non-negative integer indicating what level of the NPA hierarchy should be used when bounding the value of the non-local game. Higher values of K</tt> give better bounds, but require more memory and time. Alternatively, K</tt> can be a string of a form like '1+ab+aab'</tt>, which indicates that an intermediate level of the hierarchy should be used, where this example uses all products of 1 measurement, all products of one Alice and one Bob measurement, and all products of two Alice and one Bob measurement. Use plus signs to separate the different categories of products, as above. The first character of this string should always be a number, indicating the base level to use. If MTYPE</tt> is anything other than 'quantum'</tt> then K</tt> has no effect.

The CHSH game
The (quite trivial) BCS game consisting of the following two constraints is equivalent to the CHSH inequality: $$ v_1 \oplus v_2 = 0 \quad \quad \quad v_1 \oplus v_2 = 1 $$ We can compute the classical and quantum values of the game with the following code:

The generalized CHSH game
By extending the CHSH game above to have more variables (say $k$ of them), we get the game defined by the following slightly more complicated constraints:: $$ v_1 \oplus v_2 \oplus \cdots \oplus v_k = 0 \quad \quad \quad v_1 \oplus v_2 \oplus \cdots \oplus v_k = 1 $$ We can compute the classical value and bound the quantum value of the game in the $k = 3$ case with the following code:

Note that the first level of the NPA hierarchy above just gave the (useless) upper bound of 1 on the game's value. However, increasing the level of the NPA hierarchy to the 1+AB level was sufficient to give a non-trivial upper bound.

The "four-line" BCS game
The BCS game defined by the following four constraints was shown by Speelman not to have a quantum strategy giving a value of 1 (see Section 5 of ): $$ v_1 \oplus v_2 \oplus v_3 = 0 \quad \quad \quad v_3 \oplus v_4 \oplus v_5 = 0 \\ v_5 \oplus v_6 \oplus v_1 = 0 \quad \quad \quad v_2 \oplus v_4 \oplus v_6 = 1. $$ We can compute the classical value and bound the quantum value of this game with the following code:

Just like in the previous example, the first level of the NPA hierarchy above just gave the (useless) upper bound of 1 on the game's value. However, increasing the level of the NPA hierarchy to the 1+AB level was sufficient to give a non-trivial upper bound.