{"uid":"cap_gjbtTOGJiYvO6G0Myu0Wr","slug":"chsh-bell-inequality-s-parameter-calculator-5c0849b9","name":"CHSH Bell Inequality / S-Parameter Calculator","description":"Converts ++, +−, −+ and −− counts into a correlation for each of AB, AB′, A′B and A′B′, then computes S = E(AB) + E(AB′) + E(A′B) − E(A′B′). A value above the classical bound in supplied data does not by itself demonstrate entanglement or close detection, locality, sampling or significance loopholes.","url":"https://quantum.halowerk.com/v1/entanglement-test","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"measurements":{"type":"array","items":{"type":"object","required":["setting","plus_plus","plus_minus","minus_plus","minus_minus"],"properties":{"setting":{"enum":["AB","ABprime","AprimeB","AprimeBprime"],"type":"string"},"plus_plus":{"type":"integer","maximum":1000000000000,"minimum":0},"minus_plus":{"type":"integer","maximum":1000000000000,"minimum":0},"plus_minus":{"type":"integer","maximum":1000000000000,"minimum":0},"minus_minus":{"type":"integer","maximum":1000000000000,"minimum":0}},"additionalProperties":false},"maxItems":4,"minItems":4}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lx7Jjj2JbcBcbPErqZPB6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts raw coincidence counts (++, +−, −+, −−) for four measurement settings into CHSH correlators and computes the S parameter to test Bell inequality violation.","exampleAgentPrompt":"I ran a Bell test experiment and got coincidence counts for all four measurement settings — for AB I have 412 ++, 88 +−, 91 −+, and 409 −−; for AB′ I have 400 ++, 100 +−, 102 −+, 398 −−; for A′B I have 405 ++, 95 +−, 97 −+, 403 −−; for A′B′ I have 95 ++, 405 +−, 403 −+, 97 −−. Can you compute the CHSH S parameter and tell me whether it exceeds the classical bound of 2?","exampleUseCases":[{"title":"Verifying photon entanglement experiment","prompt":"I just finished a photon coincidence experiment and need to check my CHSH S value. Here are the counts: AB is 600 ++, 50 +−, 48 −+, 602 −−; AB′ is 580 ++, 70 +−, 68 −+, 582 −−; A′B is 590 ++, 60 +−, 62 −+, 588 −−; A′B′ is 65 ++, 585 +−, 583 −+, 67 −−. Compute the correlators and the S parameter so I can see if it violates the Bell inequality."},{"title":"Classroom quantum mechanics demonstration","prompt":"For our quantum mechanics class demo I have these simulated coincidence counts for the four CHSH settings — AB: 300 ++, 200 +−, 200 −+, 300 −−; AB′: 280 ++, 220 +−, 220 −+, 280 −−; A′B: 290 ++, 210 +−, 210 −+, 290 −−; A′B′: 210 ++, 290 +−, 290 −+, 210 −−. What is the CHSH S value and does it go above the classical bound of 2?"},{"title":"Benchmarking quantum hardware correlations","prompt":"I want to benchmark entanglement quality on a quantum processor. The coincidence counts from my Bell test run are: AB 8500 ++, 1500 +−, 1520 −+, 8480 −−; AB′ 8200 ++, 1800 +−, 1820 −+, 8180 −−; A′B 8300 ++, 1700 +−, 1720 −+, 8280 −−; A′B′ 1700 ++, 8300 +−, 8320 −+, 1680 −−. Please calculate all four E correlators and the S parameter."}],"resultDescription":"Returns the four per-setting correlations E(AB), E(AB′), E(A′B), E(A′B′) derived from the coincidence counts, and the combined CHSH S value computed as E(AB) + E(AB′) + E(A′B) − E(A′B′). The response also indicates whether S exceeds the classical bound of 2, though the service notes that exceeding the bound alone does not close experimental loopholes such as detection, locality, or sampling loopholes.","failureModes":["Fewer or more than exactly 4 measurement items returns a validation error","Invalid or duplicate setting enum values cause rejection","All counts zero for a setting produces a divide-by-zero or NaN correlation","Negative count values are rejected by schema minimum constraint","Counts exceeding 10^12 are rejected by schema maximum constraint"],"whenToPreferThis":"Use this endpoint when you have raw coincidence count data from a Bell test experiment across all four CHSH measurement settings and need the S parameter quickly without implementing the correlator arithmetic yourself. It is ideal for physics research pipelines, quantum hardware benchmarking, educational demonstrations, and automated experiment analysis workflows. Prefer it over general-purpose math APIs because it encodes the precise CHSH formula (E(AB) + E(AB′) + E(A′B) − E(A′B′)) and handles the four-setting structure natively.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:30:37.142Z","isFirstParty":false}