BellInequalityMax

BellInequalityMax is a function that computes the maximum possible value of a given Bell inequality 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).

Syntax

 * BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)
 * BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL,MTYPE)
 * BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL,MTYPE,K)

Argument descriptions

 * JOINT_COE: A matrix whose $(i,j)$-entry gives the coefficient of $\langle A_i B_j \rangle$ in the Bell inequality.
 * A_COE: A vector whose $i$-th entry gives the coefficient of $\langle A_i \rangle$ in the Bell inequality.
 * B_COE: A vector whose $i$-th entry gives the coefficient of $\langle B_i \rangle$ in the Bell inequality.
 * A_VAL: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Alice's side.
 * B_VAL</tt>: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Bob's side.
 * MTYPE</tt> (optional, default 'classical'</tt>): A string indicating which type of theory should be used when computing the maximum value of the Bell inequality. Must be one of 'classical'</tt>, 'quantum'</tt>, or 'nosignal'</tt>. If MTYPE = 'quantum'</tt> then only an upper bound on the Bell inequality is computed, not necessarily is 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 Bell inequality. 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 <tt>K</tt> has no effect.

The CHSH inequality
One formulation of the CHSH inequality says that if $\{A_1,A_2\}$ and $\{B_1,B_2\}$ are $\{-1,+1\}$-valued measurement settings, then in classical physics the following inequality holds:
 * $$\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle + \langle A_2 B_1 \rangle - \langle A_2 B_2 \rangle \leq 2.$$

Similarly, the best bound on this quantity is $2\sqrt{2}$ in a quantum mechanical setting (this is Tsirelson's bound), and it is $4$ in no-signalling theories. All three of these bounds can be found as follows:

The CHSH inequality again
Another (equivalent) formulation of the CHSH inequality says that if $\{A_1,A_2\}$ and $\{B_1,B_2\}$ are $\{0,1\}$-valued measurement settings, then in classical physics the following inequality holds:
 * $$\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle + \langle A_2 B_1 \rangle - \langle A_2 B_2 \rangle - \langle A_1 \rangle - \langle B_1 \rangle \leq 0.$$

Similarly, the best bound on this quantity is $1/\sqrt{2} - 1/2$ in a quantum mechanical setting, and it is $1/2$ in no-signalling settings. These three bounds can be verified as follows:

The I3322 inequality
The I3322 inequality is a Bell inequality that says that if $\{A_1,A_2,A_3\}$ and $\{B_1,B_2,B_3\}$ are $\{0,1\}$-valued measurement settings, then in classical physics the following inequality holds:
 * $$\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle - \langle A_1 B_3 \rangle + \langle A_2 B_1 \rangle + \langle A_2 B_2 \rangle + \langle A_2 B_3 \rangle - \langle A_3 B_1 \rangle + \langle A_3 B_2 \rangle - \langle A_2 \rangle - \langle B_1 \rangle - 2\langle B_2 \rangle \leq 0.$$

Similarly, it is known that a value of (strictly) larger than $1/4$ is possible in quantum mechanics, and the best possible bound is $1$ in no-signalling theories. The following code computes the best possible classical and no-signalling bounds exactly, and computes several different upper bounds for the quantum mechanical setting:

We note that the values provided for the quantum upper bound above for <tt>K = '1+ab'</tt>, <tt>K = 2</tt>, and <tt>K = 3</tt> agree with the values found in. Furthermore, the value when <tt>K = 4</tt> agrees with the value found in. The exact value of the best upper bound in the quantum setting is an open problem, but is known to be approximately $0.250875$.