CSHS Inequality - and noise

In summary, the conversation discussed the use of the CHSH inequality in Bell tests, which has an upper bound of 2.00 for classical theories and a maximum value of 2.82 for quantum theories. The conversation also touched on the use of match % and the cos^2 formula in experiments, and the potential impact of discarded readings on the results. Additionally, the code for a simulated experiment was shared, which generated results that were close to the expected values. Further discussion revolved around the 2.307 value mentioned in a cited article and the potential for higher values in a local model.
  • #1
.Scott
Science Advisor
Homework Helper
3,475
1,588
I never heard of the CSHS Inequality until I read it in another thread.
DrChinese said:
As a practical matter: most Bell tests do not use the 25% vs 33% standard for ruling out classical theories. Instead they use what is called the CHSH inequality. You can read about it in the references. It has an upper bound of 2.00 for classical (local realistic) theories, so predicts something below 2.00. That maps to the 33%. The quantum theoretical max is about 2.82. Bell tests usually give a value between 2.25 and 2.40.
The other interesting item was this:
DrChinese said:
I usually talk about match % because it is easier to discuss and relate to the cos^2 formula. Then the formula is:
Matches/(Matches+NonMatches) where hits that cannot be paired are ignored. In real experiments, unpaired hits are usually noted and discussed.
I think an important part of that discussion is the more hits are ignored, the easier it is for local realistic theories to score over 2.00. So I just had to try.

For those familiar with C++, I offer this simulated experiment:
Code:
#include "stdafx.h"
#define _CRT_RAND_S
#include <stdlib.h>
#include <conio.h>
#include <math.h>
#include <atlstr.h>

using namespace System;

#define TRYCOUNT 1000
#define RADIANS 0.01745329251994329576923690768489

//
// Random number generators: range of 0.0 to 1.0.
double RNG()
{
  unsigned int nRandom;
  rand_s(&nRandom);
  return ((double)nRandom) / UINT_MAX;
}


//
// We have a selection of 4 polarizer/splitters.
static double Splitters[4] = { 0.0, 45.0, 22.5, 67.5 };

//
// Here is the noiseless QM model.
void QMModel(double AngleA, double AngleB, int &ResultA, int &ResultB)
{
  double Agree;

  ResultA = ResultB = (RNG()<0.5) ? -1 : 1;
  Agree = pow( (cos(RADIANS*(AngleA-AngleB))), 2);
  if(RNG()>Agree) ResultA = -ResultA;
}

//
// Here is a local model that includes built-in misses.
// Result will be:
//   +1: Detected by the "+" detector.
//   -1: Detected by the "-" detector.
//    0: Not detected!
//
void LocalModel(double Hidden, double Angle, int &Result)
{
  double Split;

  Result = 1;
  Split = cos(RADIANS*(Angle-Hidden));
  if(Split<0.0) {
    Split = -Split;
    Result = -1;
  }
  if(RNG()>Split) Result = 0;
}


//
void ExpectedValues
  (int nTries, int nAngleA, int nAngleB, double &EQM, double &ELocal)
{
  int  nQMDiscard, nQMAgree, nQMDisagree;
  int  nLocalDiscard, nLocalAgree, nLocalDisagree;
  double AngleA, AngleB, Hidden;
  int  nTry, ResultA, ResultB, nMeasured, EVNumerator;
  CStringA Report;

  nQMDiscard = nLocalDiscard = 0;
  nQMAgree = nLocalAgree = nQMDisagree = nLocalDisagree = 0;
  AngleA = Splitters[nAngleA];
  AngleB = Splitters[nAngleB];

  for(nTry=0;nTry<nTries;nTry++) {
    QMModel(AngleA,AngleB,ResultA,ResultB);

    if((ResultA==0)||(ResultB==0)) nQMDiscard++;
    else if((ResultA>0)&&(ResultB>0)) nQMAgree++;
    else if((ResultA<0)&&(ResultB<0)) nQMAgree++;
    else nQMDisagree++;

    //
    // In the local model, a hidden value is carried by both particles.
    Hidden = 360.0 * RNG();
    LocalModel(Hidden,AngleA,ResultA);
    LocalModel(Hidden,AngleB,ResultB);

    if((ResultA==0)||(ResultB==0)) nLocalDiscard++;
    else if((ResultA>0)&&(ResultB>0)) nLocalAgree++;
    else if((ResultA<0)&&(ResultB<0)) nLocalAgree++;
    else nLocalDisagree++;
  }
  //
  Report.Format(
    "\nResults with splitters: A=%1.1f°, B%1.1f°\n",
    AngleA, AngleB
  );
  puts(Report);
  //
  // Report noiseless QM results.
  nMeasured = nQMAgree + nQMDisagree;
  EVNumerator = nQMAgree - nQMDisagree;
  EQM = ((double)EVNumerator)/nMeasured;
  Report.Format(
    "  Noiseless QM Model:\n"
    "    Discard:  %d/%d (%.2f%%)\n"
    "    Agree:    %d/%d (%.2f%%)\n"
    "    Disagree: %d/%d (%.2f%%)\n"
    "    Expected: %d/%d (%.2f%%)\n",
    nQMDiscard, nTries, (nQMDiscard*100.0)/nTries,
    nQMAgree, nMeasured, (nQMAgree*100.0)/nMeasured,
    nQMDisagree, nMeasured, (nQMDisagree*100.0)/nMeasured,
    EVNumerator, nMeasured, 100.0*EQM
  );
  puts(Report);
  //
  // Report local results.
  nMeasured = nLocalAgree + nLocalDisagree;
  EVNumerator = nLocalAgree - nLocalDisagree;
  ELocal = ((double)EVNumerator)/nMeasured;
  Report.Format(
    "  Local Model:\n"
    "    Discard:  %d/%d (%.2f%%)\n"
    "    Agree:    %d/%d (%.2f%%)\n"
    "    Disagree: %d/%d (%.2f%%)\n"
    "    Expected: %d/%d (%.2f%%)\n",
    nLocalDiscard, nTries, (nLocalDiscard*100.0)/nTries,
    nLocalAgree, nMeasured, (nLocalAgree*100.0)/nMeasured,
    nLocalDisagree, nMeasured, (nLocalDisagree*100.0)/nMeasured,
    EVNumerator, nMeasured, 100.0*ELocal
  );
  puts(Report);
}

//
int main()
{
  double dQM_CSHS, dLl_CSHS;
  double EQMAB, EQMAb, EQMaB, EQMab, ELlAB, ELlAb, ELlaB, ELlab;
  CStringA Report;

  //
  //  Perform the experiment four times with the polarizing splitters
  // at different setting combinations.
  ExpectedValues(TRYCOUNT, 0, 2, EQMAB, ELlAB);
  ExpectedValues(TRYCOUNT, 0, 3, EQMAb, ELlAb);
  ExpectedValues(TRYCOUNT, 1, 2, EQMaB, ELlaB);
  ExpectedValues(TRYCOUNT, 1, 3, EQMab, ELlab);
  //
  // Tally and report the results.
  dQM_CSHS     = EQMAB - EQMAb + EQMaB + EQMab;
  dLl_CSHS     = ELlAB - ELlAb + ELlaB + ELlab;
  Report.Format(
    "\nQM CSHS = %.4f\nLocal CSHS = %.4f\n",
    dQM_CSHS,dLl_CSHS
  );
  puts(Report);
  _getch();
  return 0;
}
When I ran this, I got these results:
Code:
Results with splitters: A=0.0°, B22.5°

  Noiseless QM Model:
    Discard:  0/1000 (0.00%)
    Agree:    833/1000 (83.30%)
    Disagree: 167/1000 (16.70%)
    Expected: 666/1000 (66.60%)

  Local Model:
    Discard:  542/1000 (54.20%)
    Agree:    455/458 (99.34%)
    Disagree: 3/458 (0.66%)
    Expected: 452/458 (98.69%)


Results with splitters: A=0.0°, B67.5°

  Noiseless QM Model:
    Discard:  0/1000 (0.00%)
    Agree:    138/1000 (13.80%)
    Disagree: 862/1000 (86.20%)
    Expected: -724/1000 (-72.40%)

  Local Model:
    Discard:  676/1000 (67.60%)
    Agree:    247/324 (76.23%)
    Disagree: 77/324 (23.77%)
    Expected: 170/324 (52.47%)


Results with splitters: A=45.0°, B22.5°

  Noiseless QM Model:
    Discard:  0/1000 (0.00%)
    Agree:    855/1000 (85.50%)
    Disagree: 145/1000 (14.50%)
    Expected: 710/1000 (71.00%)

  Local Model:
    Discard:  542/1000 (54.20%)
    Agree:    457/458 (99.78%)
    Disagree: 1/458 (0.22%)
    Expected: 456/458 (99.56%)


Results with splitters: A=45.0°, B67.5°

  Noiseless QM Model:
    Discard:  0/1000 (0.00%)
    Agree:    853/1000 (85.30%)
    Disagree: 147/1000 (14.70%)
    Expected: 706/1000 (70.60%)

  Local Model:
    Discard:  548/1000 (54.80%)
    Agree:    446/452 (98.67%)
    Disagree: 6/452 (1.33%)
    Expected: 440/452 (97.35%)


QM CSHS = 2.8060
Local CSHS = 2.4313
It is claimed (wikipedia) that the angles I picked, 0, 45, 22.5, and 67.5, produce the greatest deviation from the classical results. Is this why I got such as high value for the QM model (2.8) or did I mess something up?

The 2.4313 value is slightly lucky. When I set "TRIES" to 100000, I got value closer to 2.40. In any case, assuming the code is good, it demonstrates that an experimental value of 2.4 might be discounted if the number of discards is as much as the number of hits.
 
Physics news on Phys.org
  • #2
Having looked at this some more, that 2.82 value is looking OK. I noticed that, although DrChinese gave a range 2.25 to 2.40, he also said that 2.82 was the maximum.

The article he cited ( http://arxiv.org/pdf/quant-ph/0205171v1.pdf ) gives a value of 2.307, but they are working with more than four angles. I'm looking at the table on page 7 of that article.

I need to read more to figure out exactly how they got that number. Actually, if anyone can give me a hint as to how I can generate that 2.307 value, I'd appreciate it.

I also noticed that my local model is actually capable of generating values in excess of 3.5 using 0,90,45,135. I need to add code to that local version to report the number of discarded readings that never showed up at any detector - since in a real-life experiment, those would be discards that would not even be recognized as such.
 

Related to CSHS Inequality - and noise

What is CSHS inequality?

CSHS inequality, or the Cauchy-Schwarz-Hoeffding-Shapley inequality, is a mathematical theorem that states the upper bound of the expected value of a function of independent random variables. It is commonly used in probability and statistics to prove the convergence of random variables.

How is CSHS inequality used in research?

CSHS inequality is used in various fields of research, including economics, finance, and machine learning. It is used to prove the convergence of estimators, establish the stability of algorithms, and prove the accuracy of statistical models.

What is the relationship between CSHS inequality and noise?

Noise, or random variation, is a key factor in CSHS inequality. In simple terms, CSHS inequality states that the expected value of a function of independent random variables is bounded by the square root of the product of the expected values of each random variable. Noise can affect the expected values of the random variables, thus impacting the overall inequality.

Can CSHS inequality be violated?

Yes, CSHS inequality can be violated in certain cases. This is typically due to the presence of dependent random variables, which do not satisfy the independence assumption required for the inequality to hold. In such cases, alternative methods must be used to establish the convergence of random variables.

Are there any applications of CSHS inequality in real life?

Yes, CSHS inequality has various applications in real life. It is used in risk management, portfolio optimization, and machine learning algorithms. It is also used in various statistical models to establish the accuracy of predictions and estimations.

Similar threads

Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
Replies
1
Views
1K
Replies
24
Views
23K
Replies
128
Views
31K
Replies
28
Views
6K
  • Cosmology
Replies
24
Views
5K
Back
Top