BCSGameValue

From QETLAB
Revision as of 18:42, 23 June 2015 by Nathaniel (talk | contribs) (Created page with "{{Function |name=BCSGameValue |desc=Computes the maximum value of a binary constraint system (BCS) game |rel=BellInequalityMax<br />NonlocalGameValue<br />XORGameVal...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
BCSGameValue
Computes the maximum value of a binary constraint system (BCS) game

Other toolboxes required cvx
Related functions BellInequalityMax
NonlocalGameValue
XORGameValue
Function category Nonlocality and Bell inequalities
Usable within CVX? no

BCSGameValue is a function that computes the maximum possible value of a given binary constraint system (BCS) game[1] 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

  • 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', or 'nosignal'. If MTYPE = 'quantum' then only an upper bound on the non-local game is computed, not necessarily the best upper bound (see the argument K below).
  • K (optional, default 1): If MTYPE = 'quantum' 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 give better bounds, but require more memory and time. Alternatively, K can be a string of a form like '1+ab+aab', 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 is anything other than 'quantum' then K has no effect.

Examples

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:

>> C{1} = zeros(2,2);
   C{2} = zeros(2,2);
   for v1 = 0:1
       for v2 = 0:1
           % Set up the first constraint: we win if v1+v2 is even.
           if(mod(v1+v2,2) == 0)
               C{1}(v1+1,v2+1) = 1;
           end

            % Set up the first constraint: we win if v1+v2 is odd.
           if(mod(v1+v2,2) == 1)
               C{2}(v1+1,v2+1) = 1;
           end
       end
   end
>> BCSGameValue(C,'classical') % should give 3/4

ans =

   0.7500

>> BCSGameValue(C,'quantum') % should give cos^2(pi/8)

ans =

   0.8536

References

  1. R. Cleve and R. Mittal. Characterization of binary constraint system games. Lecture Notes in Computer Science, 8572:320–331, 2014. E-print: arXiv:1209.2729 [quant-ph]