# BellInequalityMaxQubits

 Other toolboxes required BellInequalityMaxQubits Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings CVX BellInequalityMaxNonlocalGameValueXORGameValue Nonlocality and Bell inequalities no

BellInequalityMaxQubits is a function that computes an upper bound for the maximum possible value of a given Bell inequality in a quantum mechanical setting where the two parties each have access to qubits (i.e., 2-dimensional quantum systems). This bound is computed using the method presented in .

## Syntax

• BMAX = BellInequalityMaxQubits(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)
• [BMAX,RHO] = BellInequalityMaxQubits(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)

## Argument descriptions

### Input arguments

• 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: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Bob's side.

### Output arguments

• BMAX: An upper bound on the qubit value of the Bell inequality.
• RHO: A many-qubit quantum state that acts as a witness that verifies the bound provided by BMAX. This is the positive-partial-transpose (PPT) state described by .

## Examples

### 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.$ It is straightforward to check that a 2-qubit maximally-entangled Bell state allows for a value of $1/4$ in this Bell inequality. The following code verifies that it is not possible to get a value of larger than $1/4$ using $2$-dimensional systems:

>> BellInequalityMaxQubits([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1])

ans =

0.2500

It is worth taking a look at the $I_{3322}$ example at the BellInequalityMax page to compare the computations provided there.