Load CddIF - Package (insert your path to cddif.m if necessary)

<< ~/dev/pra1/final/cddif.m

3 Particles - 2 Measurement Directions

Functions used to calculate the quantum mechanical probabilities:

Prob[{x_}] := (1/2)
Prob[{x_, y_}] := (1/4)
Prob[{x_, y_, z_}] := (1/8) (1 - Sin[x + y + z])

Truthtable for this configuration:

TruthTable[3, 2]

Calculation of the H-Representation in the case "3-particles, 2-measurement directions"

Please note, that in this case the runtime of the calculation can be quite long using the function ConvToHRep[3,2]:

hrep = ConvToHRep[3, 2]

It is recommended to write the truthtable needed for the evaluation to a file using the function ToCddExtFile["3_2",3,2], afterwards execute the command "cdd 3_2.ext" outside of Mathematica (eventually on a faster computer). The file "3_2.ine" created by "cdd" can be read in using ReadInHRep["3_2"], but this is also a memory - and time consuming procedure. Therefore some functions can be called with the specific filename as argument so that the calculation is done line by line, which saves a lot of ressources.

ToCddExtFile["3_2", 3, 2]

Display violated inequalities, in this case the inequalities must be violated more than 0.4 to get included. The option PrintOut->True shows the inequalities during runtime on the display.

GetViolInequalities["3_2.ine", {{0, π/2}, {0, π/
            2}, {0, π/2}}, Prob, All, 0.4, 
      PrintOut -> True]

Graphical representation of the inequalities:
Inequalities in the original form p(x) <= b are displayed as functions f(x,b) = p(x) - b, if f(x,b) is greater than the paramter "violation" (here: 0.4). Furthermore only the lines from 10000 to 20000 are taken into consideration:

PlotInequalities["3_2.ine", {x, 
        0, π}, {{0, x}, {0, x}, {0, x}}, Prob, {10000, 20000}, 
      0.4]

ContourPlots of all inequalities violated more than 0.4 in the specified range:

cont=ContPlotInequalities["3_2.ine", {x, 0, π}, {y, 
          0, π}, {{0, x}, {0, y}, {x, y}}, Prob, {10000, 20000}, 
        0.4]

Graphical representation of some of the inequalities found above:

Show[GraphicsArray[Partition[cont, 3][[{1, 2}, All]]]] // 
      TableForm

Example to CddIF-Package,Author:Stefan Filipp,May 2001