Computation of CHSH in the many - pair scenario

Here we consider the special case of measurement on Werner states with angles regularly separated by an angle β, i.e.
  A_0 = σ_z
  A_1 = cos(2*β)*σ_z + sin(2*β)*σ_x
  B_0 = cos(-β)*σ_z + sin(-β)*σ_x
  B_1 = cos(β)*σ_z + sin(β)*σ_x

Majority voting

PpAtmp=(∑_(np=(M+1)/2)^M)Binomial[M,np]((((1+CA)/2))^np)((((1-CA)/2))^(M-np))//FullSimplify
PpBtmp=(∑_(np=(M+1)/2)^M)Binomial[M,np]((((1+CB)/2))^np)((((1-CB)/2))^(M-np))//FullSimplify

PpA[CA_,CB_,CAB_,M_]:=(2^(-M)) (((1-CA))^((1/2) (-1+M))) (((1+CA))^((1+M)/2)) Binomial[M,((1+M)/2)] Hypergeometric2F1[1,((1-M)/2),((3+M)/2),((1+CA)/(-1+CA))];
PpB[CA_,CB_,CAB_,M_]:=(2^(-M)) (((1-CB))^((1/2) (-1+M))) (((1+CB))^((1+M)/2)) Binomial[M,((1+M)/2)] Hypergeometric2F1[1,((1-M)/2),((3+M)/2),((1+CB)/(-1+CB))];

Ppp[CA_,CB_,CAB_,M_]:=1/(4^M)*(∑_(npp=0)^M)((∑_(npm=(M+1)/2-npp)^M)((∑_(nmp=(M+1)/2-npp)^M)(Multinomial[npp,npm,nmp,M-npp-npm-nmp]*(1+CA+CB+CAB)^npp*(1+CA-CB-CAB)^npm*(1-CA+CB-CAB)^nmp*(1-CA-CB+CAB)^(M-npp-npm-nmp))))

Here is the CHSH value for measurement on M Werner states with visibility V, according to the angle β

CHSHMaj[V_,β_,M_]:=Module[{CA1=0,CA2=0,CB1=0,CB2=0,CAB11=V*Cos[β],CAB12=V*Cos[β],CAB21=V*Cos[β],CAB22=V*Cos[3*β]},CH=1-PpA[CA1,CB1,CAB11,M]-PpB[CA1,CB1,CAB11,M]+Ppp[CA1,CB1,CAB11,M]+Ppp[CA1,CB2,CAB12,M]+Ppp[CA2,CB1,CAB21,M]-Ppp[CA2,CB2,CAB22,M];4*CH-2]

Maximal violation as a function of the angle for various number of parties and visitility 0.0892

Table[CHSHMaj[1-0.0108,2*(angle/180*π),M],{M,1,17,4},{angle,0,14,0.5}]

Plot[Table[CHSHMaj[1-0.0108,2*(angle/180*π),M],{M,1,19,4}],{angle,0,14}]

Parity voting

CHSH value for measurement on M Werner states with visibility V, according to the angle β

CHSHParity[V_,β_,M_]:=3*(V*Cos[β])^M-(V*Cos[3*β])^M

Table[CHSHParity[1-0.0108,2*(angle/180*π),M],{M,1,17,4},{angle,0,14,0.5}]

Plot[Table[CHSHParity[1-0.0108,2*(angle/180*π),M],{M,1,19,4}],{angle,0,14}]