Introduction

Correlations born of local measurements performed on entangled quantum systems shared between distant observers resist local-causal explanations, a phenomenon known as Bell nonlocality1,2. Apart from their foundational significance, nonlocal correlations enable several classically impossible information processing and cryptographic applications such as unconditionally secure Device-Independent Quantum Key Distribution (DIQKD)3,4,5,6,7. The efficacy of these applications relies on loophole-free certification of strong nonlocal correlations. In particular, the detection loophole, posed by the lack of perfect detectors in Bell tests, is the most persistent obstacle in the experimental realization of strong long-range loophole-free nonlocal correlations. The detection efficiency of a measuring party is the ratio of particles detected to the total number of particles emitted by the source. The effective detection efficiency η depends on the detectors and decays with the distance from the source. Closing the detection loophole in Bell experiments amounts to having an effective detection efficiency η higher than a threshold value η*, referred to as the critical detection efficiency.

Consequently, significant research efforts have been directed toward minimizing the critical detection efficiency requirement for loophole-free certification of nonlocality8,9,10,11,12. However, for real-world applications to be effective, mere violation of a Bell inequality is insufficient13. Instead, the efficacy of such applications12 typically requires a high degree of nonlocality and motivates the question:

Which quantum strategies yield the maximum loophole-free nonlocality in the presence of inefficient detectors?

As the extent of the violation of a (facet) Bell inequality corresponds to the distance of a nonlocal correlation from a facet of the local polytope, it translates to a reliable measure of nonlocality14. Thus the question above boils down to finding the quantum strategies that yield the maximal loophole-free violation of a Bell inequality for specified detection efficiencies. Since the use of inefficient detectors results in the occurrence of “no-click” events, to decide whether a Bell inequality is violated in a loophole-free way, these events must be included in the measurement statistics. An experimentally convenient way of including the “no-click” events is to assign a valid outcome to them15. Moreover, such local assignment strategies have been proven to be optimal in the simplest Bell scenario16. We use local assignment strategies to show that the quantum state and measurements maximally violating a given Bell inequality, in the presence of inefficient detectors, correspond to those maximally violating, under ideal conditions, a tilted version of the inequality. In the simplest Bell scenario, where up to a relabeling of measurements and outcomes the only facet inequality is the Clauser-Horne-Shimony-Holt (CHSH) inequality17, attaining maximal loophole-free nonlocality amounts to maximally violating a “doubly-tilted” CHSH inequality.

The doubly-tilted CHSH inequalities are generalizations of the tilted CHSH inequalities considered in refs. 18,19, which correspond to the special case of one party having access to ideal detectors, and for which both the maximal violation and the quantum realization attaining it are known. In fact, in18 it is shown using sum-of-squares (SOS) decompositions that the optimal state and measurements are unique up to local unitaries, i.e., the maximal violation self-tests the optimal quantum strategy. In contrast, we analytically derive self-testing statements for the entire family doubly-tilted CHSH inequalities as a function of the detection efficiencies via a novel proof technique based on Gröbner basis elimination (for an introduction to the method for a physics audience see Appendix A of ref. 20) and Jordan’s lemma (Chapter VII21). We find that the optimal quantum strategy entails non-maximally incompatible observables for both parties and a partially entangled two-qubit state, with the optimal observables of a party also depending on the detection efficiency of the other party.

The analytical self-testing statements enable us to recover, up to arbitrary precision, the maximum quantum violation of the doubly-tilted CHSH inequalities. We compare these values with the corresponding upper bounds from the Navascués–Pironio–Acín (NPA) hierarchy22,23. Strikingly, even higher levels (up to level 10) cannot saturate the maximal violation of the doubly-tilted CHSH inequalities. Consequently, the SOS decomposition-based self-testing technique18 turns out to be analytically intractable for the doubly-tilted CHSH inequalities. We conclude by discussing implications of our self-testing statements towards device-independent cryptography with inefficient detectors and the complexity of characterizing the set of quantum correlations via the NPA hierarchy and the SOS decompositions self-testing method.

Results

Nonlocality with imperfect detectors

Consider a bipartite Bell experiment wherein a source distributes a physical system to be shared between Alice and Bob. Alice and Bob perform one out of mA, mB possible measurements, labeled x, y, which have dA, dB possible outcomes labeled a, b, respectively. The four-tuple (mA, mB, dA, dB) specifies the Bell scenario. The experiment results in the behavior vector \({\boldsymbol{p}}\in {{\mathbb{R}}}_{+}^{{m}_{A}{d}_{A}{m}_{B}{d}_{B}}\) with entries p(abxy) specifying the probability of outcomes a, b when Alice measures x and Bob measures y. We denote by \({{\boldsymbol{p}}}^{A}\in {{\mathbb{R}}}_{+}^{{m}_{A}{d}_{A}}\), \({{\boldsymbol{p}}}^{B}\in {{\mathbb{R}}}_{+}^{{m}_{B}{d}_{B}}\) the marginal vectors with entries pA(ax), pB(by) specifying the respective marginal probabilities. The set \({\mathcal{L}}\) of behaviors p admitting a local-causal explanation forms a polytope, with local deterministic strategies \(\bar{{\boldsymbol{p}}}\) as vertices satisfying \(\bar{p}(ab| xy)={\delta }_{a,{a}_{x}}{\delta }_{b,{b}_{y}}\), where ax, by are local deterministic assignments.

A quantum strategy is described by the three-tuple \(({\hat{\rho }}_{AB},\{{\hat{M}}_{a}^{x}\},\{{\hat{N}}_{b}^{y}\})\) entailing the shared quantum state \({\hat{\rho }}_{AB}\) and local quantum measurement operators \(\{{\hat{M}}_{a}^{x}\},\{{\hat{N}}_{b}^{y}\}\) which results in a quantum behavior p with components,

$$p(ab| xy)={\rm{Tr}}\,\left({\hat{\rho }}_{AB}\,{\hat{M}}_{a}^{x}\otimes {\hat{N}}_{b}^{y}\right)\qquad \forall \,a,b,x,y,$$
(1)

We denote the convex set of quantum behaviors by \({\mathcal{Q}}\). It is well know that \({\mathcal{L}}\subseteq {\mathcal{Q}}\) and that there exists nonlocal quantum behaviors such that \({\boldsymbol{p}}\in {\mathcal{Q}}\setminus {\mathcal{L}}\). The hyperplanes containing the facets of \({\mathcal{L}}\) thus separate the local behaviors from those that are nonlocal, and each of them is associated with a Bell inequality of the form,

$$\beta ({\boldsymbol{p}}):= {\boldsymbol{\beta }}\cdot {\boldsymbol{p}}=\sum _{abxy}{\beta }_{abxy}p(ab| xy)\le {\beta }_{{\mathcal{L}}},$$
(2)

where ( ) denotes the inner product in \({{\mathbb{R}}}_{+}^{{m}_{A}{d}_{A}{m}_{B}{d}_{B}}\), and the vector \({\boldsymbol{\beta }}\in {{\mathbb{R}}}_{+}^{{m}_{A}{d}_{A}{m}_{B}{d}_{B}}\) with the real coefficients βabxy as entries specifies the Bell functional β(p) and lies in the orthogonal complement of the corresponding facet. A nonlocal behavior \({\boldsymbol{p}}\,\notin\, {\mathcal{L}}\) violates at least one such facet Bell inequality, such that, \(\beta ({\boldsymbol{p}}) > {\beta }_{{\mathcal{L}}}\). The amount of the violation, \(\beta ({\boldsymbol{p}})-{\beta }_{{\mathcal{L}}}\), is related to the distance of p from \({\mathcal{L}}\), and constitutes a measure of nonlocality14. We denote the maximal quantum value of the Bell functional β(p) by \({\beta }_{{\mathcal{Q}}}\).

In the derivation of inequality (2) the detectors are assumed to be perfect. However in actual experiments detectors sometimes fail to detect an incoming system, which results in the occurrence of “no-click” events. The most general way of accounting for a “no-click” event is to consider it an additional outcome of the local measurements, which enlarges the considered Bell scenario. A more convenient approach, which preserves the Bell scenario, consists of locally assigning a pre-existing outcome to each “no-click” event11,15,24. Moreover, this method is particularly well-suited for our purposes as we are interested in gauging the effect of imperfect detectors on the violation of a given facet Bell inequality.

Let ηA, ηB [0, 1] be Alice’s and Bob’s independent detector efficiencies. A local assignment strategy is described by a local behavior \({\boldsymbol{q}}\in {\mathcal{L}}\) with q(abxy) as entries specifying the probability with which the parties assign the outcomes a, b to failed measurements of x, y, respectively. Then the effect of inefficient detectors on an ideal behavior p can be summarized as the following affine map,

$$\begin{array}{lll}\tilde{{\boldsymbol{p}}}={\eta }_{A}{\eta }_{B}{\boldsymbol{p}}+{\eta }_{A}(1-{\eta }_{B}){{\boldsymbol{p}}}^{A}\otimes {{\boldsymbol{q}}}^{B}\\\qquad \,+\,(1-{\eta }_{A}){\eta }_{B}{{\boldsymbol{q}}}^{A}\otimes {{\boldsymbol{p}}}^{B}+(1-{\eta }_{A})(1-{\eta }_{B}){\boldsymbol{q}},\end{array}$$
(3)

where is the Kronecker product, \({{\boldsymbol{q}}}^{A}\in {{\mathbb{R}}}_{+}^{{m}_{A}{d}_{A}}\), \({{\boldsymbol{q}}}^{B}\in {{\mathbb{R}}}_{+}^{{m}_{B}{d}_{B}}\) are the respective marginals of q.

Observe that in (3), the effective behavior \(\tilde{{\boldsymbol{p}}}\) is a convex mixture of the ideal behavior p, the product behaviors pAqB, qApB and the local assignment strategy q. Since, \({{\boldsymbol{p}}}^{A}\otimes {{\boldsymbol{q}}}^{B},{{\boldsymbol{q}}}^{A}\otimes {{\boldsymbol{p}}}^{B},{\boldsymbol{q}}\in {\mathcal{L}}\), locally assigning outcomes to failed measurements cannot increase the value of the Bell functional \(\beta (\tilde{{\boldsymbol{p}}})\)(2) beyond the local bound \({\beta }_{{\mathcal{L}}}\). Hence, we say that a given Bell inequality (2) is violated in a loophole-free way if the effective behavior \(\tilde{{\boldsymbol{p}}}\) violates it, such that \(\beta (\tilde{{\boldsymbol{p}}}) \,>\, {\beta }_{{\mathcal{L}}}\). For any given ηA, ηB, we are interested in the maximal effective or loophole-free violation of a Bell inequality (2),

$$\beta (\tilde{{\boldsymbol{p}}})-{\beta }_{{\mathcal{L}}}.$$
(4)

As \(\tilde{{\boldsymbol{p}}}\) depends on the ideal quantum behavior \({\boldsymbol{p}}\in {\mathcal{Q}}\) and the local assignment strategy \({\boldsymbol{q}}\in {\mathcal{L}}\)(3), finding the maximal loophole-free violation (4) of a Bell inequality, requires optimizing over both \({\mathcal{Q}}\) and \({\mathcal{L}}\). We now present a useful Lemma which helps resolve this optimization,

Lemma 1

For any specification detection efficiencies ηA, ηB and any given Bell inequality \(\beta ({\boldsymbol{p}})\le {\beta }_{{\mathcal{L}}}\) (2), the ideal quantum behaviors \({\boldsymbol{p}}\in {\mathcal{Q}}\) that yield the maximal loophole-free violation \(\beta (\tilde{{\boldsymbol{p}}})-{\beta }_{{\mathcal{L}}}\)(4), are the ones that maximally violate a tilted Bell inequality \({{\boldsymbol{\beta }}}_{{\eta }_{A},{\eta }_{B}}({\boldsymbol{p}})\le {\beta }_{{\mathcal{L}}}({\eta }_{A},{\eta }_{B})\) where \({\beta }_{{\mathcal{L}}}({\eta }_{A},{\eta }_{B})={\beta }_{{\mathcal{L}}}/{\eta }_{A}{\eta }_{B}-\beta (\bar{{\boldsymbol{q}}})\alpha ({\eta }_{A})\alpha ({\eta }_{B})\) and,

$${{\boldsymbol{\beta }}}_{{\eta }_{A},{\eta }_{B}}({\boldsymbol{p}})={\boldsymbol{\beta }}\cdot {\boldsymbol{p}}+\alpha ({\eta }_{B}){{\boldsymbol{\beta }}}_{\bar{{\boldsymbol{q}}}}^{A}\cdot {{\boldsymbol{p}}}^{A}+\alpha ({\eta }_{A}){{\boldsymbol{\beta }}}_{\bar{{\boldsymbol{q}}}}^{B}\cdot {{\boldsymbol{p}}}^{B},$$
(5)

where α(η) = (1 − η)/η, \(\bar{{\boldsymbol{q}}}\) is a deterministic assignment strategy with entries \(\bar{q}(ab| xy)={\delta }_{a,{a}_{x}}{\delta }_{b,{b}_{y}}\), and \({{\boldsymbol{\beta }}}_{\bar{{\boldsymbol{q}}}}^{A}\), \({{\boldsymbol{\beta }}}_{\bar{{\boldsymbol{q}}}}^{B}\) represent single party Bell functionals with coefficients \({\beta }_{ax}^{A}=\sum _{y}{\beta }_{a{b}_{y}xy}\), \({\beta }_{by}^{B}=\sum _{x}{\beta }_{{a}_{x}bxy}\) as entries, respectively, such that, the effective value of the original Bell functional is \(\beta (\tilde{p})={\eta }_{A}{\eta }_{B}\left({\beta }_{Q}({\eta }_{A},{\eta }_{B})-\alpha ({\eta }_{A})\alpha ({\eta }_{B}){\boldsymbol{\beta }}\cdot \bar{{\boldsymbol{q}}}\right)\) where βQ(ηA, ηB) is the maximum quantum value of the Bell functional \({\beta }_{{\eta }_{A},{\eta }_{B}}\).

The proof has been deferred to the Supplementary Information for brevity. As a consequence of Lemma 1, finding the maximal loophole-free violation (4) of a Bell inequality amounts to finding the maximum quantum values of a finite set of tilted Bell functionals of the form (5) associated with the finite set of deterministic vertices of \({\mathcal{L}}\). In the next section, we exemplify the application of Lemma 1 and find the maximum loophole-free nonlocality in the simplest Bell scenario for any specification of detection efficiencies.

Maximal loophole-free nonlocality in the CHSH scenario

We now consider the simplest bipartite Bell scenario, in which Alice and Bob perform one of the two distinct measurements, x, y {0, 1} and obtain binary outcomes, a, b {−1, +1}, respectively. It is convenient in this scenario to introduce correlators, \(\left\langle {A}_{x}{B}_{y}\right\rangle := \sum _{ab}ab\,p(ab| xy)\), and marginals \(\left\langle {A}_{x}\right\rangle := \sum _{a}a\,{p}_{A}(a| x)\), \(\left\langle {B}_{y}\right\rangle := \sum _{b}b\,{p}_{B}(b| y)\)2. In a quantum strategy these averages correspond to the expectation values of binary observables, \({\hat{A}}_{x}={\hat{M}}_{+1}^{x}-{\hat{M}}_{-1}^{x}\) and \({\hat{B}}_{y}={\hat{N}}_{+1}^{y}-{\hat{N}}_{-1}^{y}\) with respect to a shared quantum state \({\hat{\rho }}_{AB}\). Then the nonlocality of a given behavior p can be witnessed by a violation of the CHSH inequality,

$$C({\boldsymbol{p}})=\sum _{x,y}{(-1)}^{x\cdot y}\left\langle {A}_{x}{B}_{y}\right\rangle \le 2,$$
(6)

which up to relabeling of measurements and outcomes is known to be the only tight and complete Bell inequality in this scenario25. Hence, the violation of the CHSH inequality C(p) − 2 forms our measure of nonlocality.

We are interested in the maximal loophole-free violation of the CHSH inequality \(C(\tilde{{\boldsymbol{p}}})-2\) for any specification of detection efficiencies ηA, ηB. Therefore, we invoke Lemma 1 with a deterministic assignment strategy, wherein q(abxy) = δa,+1δb,+1 for all x, y, to retrieve the following doubly-tilted CHSH inequality,

$$\begin{array}{lll}{C}_{{\eta }_{A}{\eta }_{B}}({\boldsymbol{p}})=C({\boldsymbol{p}})+\frac{2}{{\eta }_{B}}(1-{\eta }_{B})\left\langle {A}_{0}\right\rangle +\frac{2}{{\eta }_{A}}(1-{\eta }_{A})\left\langle {B}_{0}\right\rangle \\\qquad\qquad \,\le \,2\left[\frac{1}{{\eta }_{A}}+\frac{1}{{\eta }_{B}}-1\right]={c}_{{\mathcal{L}}}({\eta }_{A},{\eta }_{B}).\end{array}$$
(7)

In the Supplementary Information we demonstrate that the assignment strategy considered above is optimal for all ηA, ηB. Consequently, for any given ηA, ηB, the quantum strategies which maximally violate the doubly-tilted CHSH inequality (7) yield the maximal loophole-free violation of the CHSH inequality (6). However, not all combinations ηA, ηB allow for such a violation. In particular, a quantum loophole-free violation of the CHSH inequality (6) is not possible if the detection efficiencies ηA, ηB [0, 1] fail to satisfy26,27,28,29

$${\eta }_{B}\, >\, \frac{{\eta }_{A}}{3{\eta }_{A}-1}.$$
(8)

Therefore, (8) provides lower bounds for Bob’s critical detection efficiency \({\eta }_{B}^{* }\ge \frac{{\eta }_{A}}{3{\eta }_{A}-1}\) given Alice’s detection efficiency \({\eta }_{A}\in (\frac{1}{2},1]\), effectively defining the region (8) of ηA, ηB, where we look for the maximum quantum violation of doubly-tilted CHSH inequalities \({c}_{{\mathcal{Q}}}({\eta }_{A},{\eta }_{B})\).

In the following sections, we find the exact value of \({c}_{{\mathcal{Q}}}({\eta }_{A},{\eta }_{B})\) along with the optimal quantum strategies. In Fig. 1, we plot the consequent maximal loophole-free value of the CHSH functional \(C(\tilde{{\boldsymbol{p}}})={\eta }_{A}{\eta }_{B}{c}_{{\mathcal{Q}}}({\eta }_{A},{\eta }_{B})-2(1-{\eta }_{A})(1-{\eta }_{B})/{\eta }_{A}{\eta }_{B}\).

Fig. 1: Maximum loophole-free violation of the CHSH inequality.
figure 1

A plot of the maximum loophole-free value of the CHSH functional, \(C(\tilde{{\boldsymbol{p}}})={\eta }_{A}{\eta }_{B}{c}_{{\mathcal{Q}}}({\eta }_{A},{\eta }_{B})+(1-{\eta }_{A})(1-{\eta }_{B})2\), against detection efficiencies \({\eta }_{A},{\eta }_{B}\in [\frac{1}{2},1]\), where we used the analytical expression for maximum quantum violation of the doubly-tilted CHSH inequality (7), \({c}_{{\mathcal{Q}}}({\eta }_{A},{\eta }_{B})\), derived in Section “Two inefficient detectors”. The solid red line represents Bob’s critical detection efficiency \({\eta }_{B}^{* }=\frac{{\eta }_{A}}{3{\eta }_{A}-1}\)(8), below which a loophole-free quantum violation of the CHSH inequality is not possible26,27,28,29.

Maximal violation of doubly-tilted CHSH inequalities and self-testing

In this section, we address the problem of computing the maximal violation of the inequalities of the form (7), which form a two-parameter family, and the quantum strategies attaining it. A one-parameter subset within this family is that corresponding to either ηA = 1 or ηB = 1, for which the solution is already known. We start by revisiting these results before presenting the solution for the general case which, remarkably, is far from being a straightforward generalization of the first.

One inefficient detector

Let us consider an ideal scenario wherein Alice has access to perfect detectors such that ηA = 1, while Bob’s detectors are imperfect and click with efficiency ηB. Consequently, we retrieve the following family of tilted CHSH inequalities from (7),

$${C}_{\alpha }({\boldsymbol{p}})=\sum _{x,y}{(-1)}^{x\cdot y}\left\langle {A}_{x}{B}_{y}\right\rangle +\alpha \left\langle {A}_{0}\right\rangle \le 2+\alpha ,$$
(9)

where the tilting parameter \(\alpha =\frac{2}{{\eta }_{B}}(1-{\eta }_{B})\) is determined by the detection efficiency on Bob’s side. First, a quantum loophole-free violation of the CHSH inequality (6) requires \({\eta }_{B}\in (\frac{1}{2},1]\), which restricts the tilting parameter to α [0, 2).

The maximum quantum value of the Bell functional in (9) is \({c}_{{\mathcal{Q}}}(\alpha )=\sqrt{8+2{\alpha }^{2}}\)19. Hence, the maximum loophole-free violation of CHSH inequality when ηA = 1 is \(2\sqrt{2}\sqrt{{\eta }_{B}^{2}+{(1-{\eta }_{B})}^{2}}\). Recall that, in terms of the state and measurements \((\left\vert {\psi }^{{\prime} }\right\rangle ,\{{\hat{A}}_{x}^{{\prime} }\},\{{\hat{B}}_{y}^{{\prime} }\})\) of an optimal quantum strategy, we can write the maximal quantum value of the tilted CHSH functional as \({c}_{{\mathcal{Q}}}(\alpha )=\left\langle {\psi }^{{\prime} }\right\vert {\hat{C}}_{\alpha }\left\vert {\psi }^{{\prime} }\right\rangle\), where \({\hat{C}}_{\alpha }\) is the tilted CHSH Bell operator, given by

$${\hat{C}}_{\alpha }=\sum _{x,y}{(-1)}^{x\cdot y}{\hat{A}}_{x}\otimes {\hat{B}}_{y}+\alpha {\hat{A}}_{0}.$$
(10)

In ref. 18 it is shown that \({\hat{C}}_{\alpha }\) admits an SOS decompositions of the form,

$${c}_{{\mathcal{Q}}}(\alpha ){\hat{\mathbb{1}}}-{\hat{C}}_{\alpha }=\sum _{i}{\hat{P}}_{i}^{\dagger }{\hat{P}}_{i},$$
(11)

in terms of polynomials \({\hat{P}}_{i}\) in the operators \(\{{\hat{\mathbb{1}}},\{{\hat{A}}_{x}^{{\prime} }\},\{{\hat{B}}_{y}^{{\prime} }\},\{{\hat{A}}_{x}^{{\prime} }{\hat{B}}_{y}^{{\prime} }\}\}\). These decompositions are then used to prove that \({C}_{\alpha }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha )\) self-tests the optimal strategy \((\left\vert \psi \right\rangle ,\{{\hat{A}}_{x}\},\{{\hat{B}}_{y}\})\)18,30, where,

$$\begin{array}{lll}\left\vert \psi \right\rangle =\cos \theta \left\vert 00\right\rangle +\sin \theta \left\vert 11\right\rangle ,\\ {\hat{A}}_{0}={\sigma }_{z}\qquad {\hat{B}}_{0}=\cos \mu \,{\sigma }_{z}+\sin \mu \,{\sigma }_{x}\\ {\hat{A}}_{1}={\sigma }_{x}\qquad {\hat{B}}_{1}=\cos \mu \,{\sigma }_{z}-\sin \mu \,{\sigma }_{x},\end{array}$$
(12)

with \(\alpha =2/\sqrt{1+2{\tan }^{2}2\theta }\), \(\tan (\mu )=\sin (2\theta )\) and σx(z) denotes the x(z) Pauli matrix.

The proof builds upon the observation that for any optimal quantum strategy \((\left\vert {\psi }^{{\prime} }\right\rangle ,\{{\hat{A}}_{x}^{{\prime} }\},\{{\hat{B}}_{y}^{{\prime} }\})\), the SOS decomposition (11) implies that \(\left\vert {\psi }^{{\prime} }\right\rangle\) must belong to the null space of the operators \({\hat{P}}_{i}\), i.e., it must satisfy the conditions, \({\hat{P}}_{i}\left\vert {\psi }^{{\prime} }\right\rangle =0\) for all i. From these conditions it is possible to infer the existence of operators \(\{{\hat{Z}}_{A},{\hat{X}}_{A},{\hat{Z}}_{B},{\hat{X}}_{B}\}\)18, such that,

$$\begin{array}{lll}{\hat{Z}}_{A}\left\vert {\psi }^{{\prime} }\right\rangle \,=\,{\hat{Z}}_{B}\left\vert {\psi }^{{\prime} }\right\rangle \\ \sin \theta {\hat{X}}_{A}({\hat{\mathbb{1}}}+{\hat{Z}}_{B})\left\vert {\psi }^{{\prime} }\right\rangle \,=\,\cos \theta {\hat{X}}_{A}({\hat{\mathbb{1}}}-{\hat{Z}}_{A})\left\vert {\psi }^{{\prime} }\right\rangle .\end{array}$$
(13)

The conditions (13) ensure the existence of local isometries, ΦA and ΦB, mapping any optimal strategy \((\left\vert {\psi }^{{\prime} }\right\rangle ,\{{\hat{A}}_{x}^{{\prime} }\},\{{\hat{B}}_{y}^{{\prime} }\})\) to the reference strategy \((\left\vert \psi \right\rangle ,\{{\hat{A}}_{x}\},\{{\hat{B}}_{y}\})\) in (12), that is,

$$\begin{array}{l}{\Phi }_{A}\otimes {\Phi }_{B}(\left\vert {\psi }^{{\prime} }\right\rangle )=\left\vert \psi \right\rangle \otimes \left\vert \,\text{junk}\,\right\rangle \\ {\Phi }_{A}\otimes {\Phi }_{B}({\hat{A}}_{x}^{{\prime} }\otimes {\hat{B}}_{y}^{{\prime} }\left\vert {\psi }^{{\prime} }\right\rangle )={\hat{A}}_{x}\otimes {\hat{B}}_{y}\left\vert \psi \right\rangle \otimes \left\vert \,\text{junk}\,\right\rangle ,\end{array}$$
(14)

where \(\left\vert \,\text{junk}\,\right\rangle\) represents the arbitrary state of additional degrees of freedom on the which the measurements act trivially. Thus the optimal quantum strategy is unique up to local isometries. We note that while the proof of relations in Eq. (13) requires an ideal behavior,18 demonstrates that self-testing can be made robust. We recall that a Bell expression provides a robust self-test for a given quantum strategy, say R if, in a noise-tolerant manner, the expected value β(p) close to the maximum \({\beta }_{{\mathcal{Q}}}\) consistently corresponds to a strategy \(\tilde{R}\) in a close neighborhood of the reference strategy R, up to local isometries.

Two inefficient detectors

We now consider the most generic experimental setting, wherein the detectors of both parties may be imperfect and click with efficiencies ηA, ηB [0, 1]. We rewrite for convenience, the doubly-tilted CHSH inequalities (7) for the general case as,

$${C}_{\alpha ,\beta }({\boldsymbol{p}})=\sum _{x,y}{(-1)}^{x\cdot y}\left\langle {A}_{x}{B}_{y}\right\rangle +\alpha \left\langle {A}_{0}\right\rangle +\beta \left\langle {B}_{0}\right\rangle \le 2+\alpha +\beta ,$$
(15)

where the tilting parameter \(\alpha =\frac{2}{{\eta }_{B}}(1-{\eta }_{B})\) for Alice’s term \(\left\langle {A}_{0}\right\rangle\) depends on the Bob’s detection efficiency ηB, while Bob’s tilting parameter \(\beta =\frac{2}{{\eta }_{A}}(1-{\eta }_{A})\) is determined by Alice’s efficiency ηA. Consequently, the boundary of the region of interest (8) translates to 0 < α + β < 2 in terms of the tilting parameters. We are interested in finding the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\beta )\) of the doubly-tilted CHSH functional in (15), as well as a quantum strategy attaining it, as a function of the tilting parameters α, β. However, the problem is intractable via the analytical techniques from18 described above. We discuss this feature in more detail in Section “Analytical intractability of SOS decomposition”.

For the general doubly-tilted CHSH inequalities (15), we consider here an alternative approach. Since in this scenario both Alice and Bob perform two dichotomic measurements, Jordan’s lemma ensures the existence of local bases in which the two observables of each party take a jointly block diagonal form, with blocks of dimension at most two30,31,32. It follows then that the ensuing Bell operator associated with the Bell functional in (15) also takes a block diagonal form. Hence, the quantum value can always be expressed as a convex combination of two-qubit values. Thus, the maximal quantum value of the Bell functional is always achievable with a two-qubit strategy.

Consequently, without loss of generality we can take the local observables to be,

$${\hat{A}}_{0}={\sigma }_{Z}\,,\,{\hat{A}}_{1}={c}_{A}\,{\sigma }_{Z}+{s}_{A}\,{\sigma }_{X}$$
(16a)
$${\hat{B}}_{0}={\sigma }_{Z}\,,\,{\hat{B}}_{1}={c}_{B}\,{\sigma }_{Z}+{s}_{B}\,{\sigma }_{X},$$
(16b)

where \({c}_{A}=\cos {\theta }_{A}\), \({s}_{A}=\sin {\theta }_{A}\), \({c}_{B}=\cos {\theta }_{B}\) and \({s}_{B}=\sin {\theta }_{B}\), and \({\theta }_{A},{\theta }_{B}\in (0,\frac{\pi }{2}]\) are the angles between Alice’s and Bob’s measurements, respectively. Finally, the doubly-tilted CHSH Bell operator can be expressed as,

$${\hat{C}}_{\alpha ,\beta }=\sum _{x,y}{(-1)}^{x\cdot y}{\hat{A}}_{x}\otimes {\hat{B}}_{y}+\alpha \,{\hat{A}}_{0}\otimes {\hat{\mathbb{1}}}+\beta \,{\hat{\mathbb{1}}}\otimes {\hat{B}}_{0}.$$
(17)

We are now prepared to present our main result, namely, the maximal quantum violation of the doubly-tilted CHSH inequalities (15) which self-tests the optimal quantum state and measurements attaining it. Here, we consider the symmetric case with α = β.

Theorem 1

(Self-testing with symmetrically tilted CHSH inequalities) The maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) of the symmetrically (α = β) tilted CHSH functional in (15) for α [0, 1) is the largest real root of the degree 4 polynomial,

$$\begin{array}{lll}f(\lambda )={\lambda }^{4}+(4-{\alpha }^{2}){\lambda }^{3}+\left(\frac{11}{4}{\alpha }^{4}-12{\alpha }^{2}-4\right){\lambda }^{2}\\\qquad\quad \,+\,(2{\alpha }^{6}-{\alpha }^{4}-20{\alpha }^{2}-32)\lambda +5{\alpha }^{6}-21{\alpha }^{4}+16{\alpha }^{2}-32.\end{array}$$
(18)

Moreover, \({C}_{\alpha ,\alpha }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) self-tests a two-qubit quantum strategy with optimal (*) local observables of the form (16), such that the optimal cosines are equal, i.e., \({c}^{* }(\alpha )={c}_{A}^{* }(\alpha )={c}_{B}^{* }(\alpha )\), and satisfy,

$${c}^{* }(\alpha )=\frac{1}{8}\left[3{\alpha }^{2}-4+\sqrt{16+9{\alpha }^{4}+8{\alpha }^{2}(2{c}_{{\mathcal{Q}}}(\alpha ,\alpha )-1)}\right].$$
(19)

Proof

The proof relies on Lagrange multipliers to recast the problem as a system of nonlinear polynomial equations, which is then solved via elimination using Gröbner basis (see Appendix A of20). The elimination step was carried out in Mathematica; for the convenience of the reader we provide a Mathematica notebook containing the proof33.

Consider the parametrization presented in (16) and assume α = β. Then the Bell operator in (17) has the following matrix representation

$${\hat{C}}_{\alpha ,\alpha }=\left(\begin{array}{cccc}\omega +2\alpha &{s}_{B}-{c}_{A}{s}_{B}&{s}_{A}-{c}_{B}{s}_{A}&-{s}_{A}{s}_{B}\\ {s}_{B}-{c}_{A}{s}_{B}&-\omega &-{s}_{A}{s}_{B}&({c}_{B}-1){s}_{A}\\ {s}_{A}-{c}_{B}{s}_{A}&-{s}_{A}{s}_{B}&-\omega &({c}_{A}-1){s}_{B}\\ -{s}_{A}{s}_{B}&({c}_{B}-1){s}_{A}&({c}_{A}-1){s}_{B}&\omega -2\alpha \end{array}\right)$$
(20)

where ω = 1 + cA + cB − cBcA. The characteristic polynomial of (20) has the expression,

$$\begin{array}{lll}q(\lambda ,{c}_{A},{c}_{B},\alpha )={\lambda }^{4}-(4{\alpha }^{2}+8){\lambda }^{2}\\\qquad\qquad\qquad\quad+\,8{\alpha }^{2}({c}_{A}{c}_{B}-{c}_{A}-{c}_{B}-1)\lambda \\\qquad\qquad\qquad\quad+\,8\left[2({c}_{A}^{2}+{c}_{B}^{2}-{c}_{A}^{2}{c}_{B}^{2})\right.\\ \qquad\qquad\qquad\quad\left.+\,{\alpha }^{2}({c}_{A}^{2}{c}_{B}+{c}_{A}{c}_{B}^{2}-{c}_{A}^{2}-{c}_{B}^{2}-{c}_{A}-{c}_{B})\right].\end{array}$$
(21)

Note that parameters sA, sB have been rewritten in terms of cA, cB, so that (21) is a polynomial function of the cosines. For the optimal quantum strategy, \({c}_{A}={c}_{A}^{* }(\alpha )\), \({c}_{B}={c}_{B}^{* }(\alpha )\), the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) corresponds to the maximum eigenvalue λ*(α) of (20). Hence, to find the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) we need to maximize the largest root of (21) over the parameters cA, cB [0, 1).

The Lagrangian for this optimization problem is

$$L=\lambda +s\cdot q(\lambda ,{c}_{A},{c}_{B},\alpha ),$$
(22)

where s is a Lagrange multiplier. A stationary point of L satisfies the conditions \({\partial }_{\lambda }L={\partial }_{{c}_{A}}L={\partial }_{{c}_{B}}L={\partial }_{s}L=0\), and is therefore a solution of the following polynomial equations,

$${\partial }_{\lambda }L=0,$$
(23a)
$${\partial }_{{c}_{A}}q(\lambda ,{c}_{A},{c}_{B},\alpha )=0,$$
(23b)
$${\partial }_{{c}_{B}}q(\lambda ,{c}_{A},{c}_{B},\alpha )=0,$$
(23c)
$$q(\lambda ,{c}_{A},{c}_{B},\alpha )=0.$$
(23d)

The cosines \({c}_{A}^{* }(\alpha ),{c}_{B}^{* }(\alpha )\) parametrizing the optimal measurements, and the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )={\lambda }^{* }(\alpha )\), are thus common roots of the polynomials \({\partial }_{\lambda }L,\,{\partial }_{{c}_{A}}q,\,{\partial }_{{c}_{B}}q\), and q in (23). These polynomials define a ring, for which a Gröbner basis20 is computed, which in turn is used to eliminate s, cA and cB.

The elimination procedure results in a degree 6 polynomial over λ. Two out of the six roots, 2(1 + α) and 2(1 − α), coincide with and remain below the classical bound for all α [0, 1], respectively. Taking the quotient of the degree 6 polynomial with respect to the product of these two roots results in f(λ) in (18). Again, only the largest root λ*(α) of f(λ) violates the local bound 2(1 + α) for α [0, 1), and hence \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )={\lambda }^{* }(\alpha )\).

To derive the optimal cosines \({c}_{A}^{* }(\alpha )\), \({c}_{B}^{* }(\alpha )\), we consider the Eqs. (23b), (23c). Since, cB = 1, cA = 1 correspond to compatible measurements, we divide (23b), (23c) by their respective factors 8(1 − cA), 8(1 − cB), to retrieve the following equations,

$$({\alpha }^{2}-4{c}_{A})(1+{c}_{B})+2{\alpha }^{2}{c}_{A}+{\alpha }^{2}\lambda =0,$$
(24a)
$$({\alpha }^{2}-4{c}_{B})(1+{c}_{A})+2{\alpha }^{2}{c}_{B}+{\alpha }^{2}\lambda =0.$$
(24b)

Taking the difference of (24a) and (24b) to eliminate λ, we retrieve the condition, \(\left({\alpha }^{2}-4\right)({c}_{A}-{c}_{B})=0\). Since α [0, 1), we conclude that the optimal cosines must be equal, i.e., \({c}_{A}^{* }(\alpha )={c}_{B}^{* }(\alpha )={c}^{* }(\alpha )\). Plugging cA = cB = c back into (24a), we find that the optimal cosine c*(α) must be a root of the following degree 2 polynomial,

$$h(c)=4{c}^{2}+(4-3{\alpha }^{2})c-{\alpha }^{2}(1+\lambda ).$$
(25)

We find that, for all α [0, 1) and \(\lambda ={\lambda }^{* }(\alpha )={c}_{{\mathcal{Q}}}(\alpha ,\alpha )\), the optimal cosine c*(α) corresponds to the largest root of (25), given by (19), since the other root \({c}^{{\prime} }={c}_{A}={c}_{B}\,\notin\, [0,1)\). Since the optimal cosine c*(α) (19) is uniquely determined by \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\), we conclude that the optimal measurements are self-tested by the optimal quantum value \({C}_{\alpha ,\alpha }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha ,\alpha )\). Moreover, we find that the maximum eigenvalue of (20) with optimal settings cA = cB = c*(α) is nondegenerate (since no other eigenvalue violates the local bound 2(1 + α)) for all α [0, 1), which implies that \({C}_{\alpha ,\alpha }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) also self-tests the optimal two-qubit non-maximally entangled state specified by the eigenvector associated with the maximum eigenvalue.

In Fig. 2, we the plot the optimal cosine cA = cB = c*(α) parametrizing the optimal measurements (16) and the Schimdt coefficient ξ* of the optimal partially entangled two-qubit state against α [0, 1) self-tested by \({C}_{\alpha ,\alpha }({\boldsymbol{p}}){c}_{{\mathcal{Q}}}(\alpha ,\alpha )\). The analogous self-testing statements for the general case of α ≠ β are contained in Theorem 2, which, along with the analogous proof, has been deferred to the Supplementary Information for brevity. In particular, in contrast to the symmetric (α = β) case for which a closed-form solution is presented in the Mathematica notebook33, the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\beta )\) in the general case (α ≠ β) corresponds to the largest real root of a degree 6 polynomial, which can be obtained numerically to any desired precision.

Fig. 2: Self-testing of non-maximally incompatible measurements and non-maximally entangled state.
figure 2

Plots of (i.) (solid blue line) the optimal cosine cA = cB = c*(α) (16), and (ii.) (dashed orange line) the Schmidt coefficient ξ* of the optimal non-maximally entangled quantum state \(\left\vert \psi \right\rangle ={\xi }^{* }\left\vert 00\right\rangle +\sqrt{1-{{\xi }^{* }}^{2}}\left\vert 11\right\rangle\) (represented in the Schmidt basis), against the tilting parameter α [0, 1), self-tested by the maximal quantum value \({C}_{\alpha ,\alpha }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) of the symmetrically (α = β) tilted CHSH inequality (15). As α → 1 (\(\eta \to \frac{2}{3}\)), the optimal qubit measurements as well as the optimal two-qubit entangled state become almost compatible and product, respectively.

Robust self-testing

To demonstrate the robustness of the self-testing statements in Theorem 1, we use the numerical SWAP method introduced in refs. 34,35. The numerical SWAP technique utilizes the NPA hierarchy to obtain lower bounds \({{\mathcal{F}}}_{L}^{* }\le {{\mathcal{F}}}^{* }\le {\mathcal{F}}\) on the fidelity \({\mathcal{F}}\) between the state \(\left\vert {\psi }^{{\prime} }\right\rangle\) in a given quantum strategy and the reference state \(\left\vert \psi \right\rangle\) which is self-tested, say by the maximal quantum violation \(\beta ({\boldsymbol{p}})={\beta }_{{\mathcal{Q}}}\) of a Bell inequality (2), where L is level of NPA hierarchy. It builds upon the fact that, in case of self-testing, the local isometries of the form (14) mapping an optimal state to the target state \(\left\vert \psi \right\rangle\) can be implemented via a partial SWAP unitary USWAP which depends on the optimal measurements. It follows then that every state in an optimal quantum strategy, and only those states, saturate the inequality \({\mathcal{F}}=\left\langle \psi \right\vert {U}_{SWAP}\left\vert {\psi }^{{\prime} }\right\rangle \le 1\). Hence, the problem of certifying that the maximal quantum value of a Bell functional self-tests the target state can be rephrased as that of checking whether the minimal fidelity \({{\mathcal{F}}}^{* }\), over optimal realizations, is 1. The advantage in this recasting of the problem is that the finding the minimal fidelity \({{\mathcal{F}}}^{* }\) can be relaxed via the NPA hierarchy.

Another advantage of this method is that it can be used to numerically study the robustness of the self-testing results. If minimization of \({\mathcal{F}}\) is carried over quantum strategies attaining a suboptimal functional value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )-\epsilon\), then the minimum fidelity \({{\mathcal{F}}}^{* }\) quantifies how close the state in any such strategy must be to the target \(\left\vert \psi \right\rangle\). In Fig. 3, we plot the numerically computed lower bounds on minimum fidelity \({{\mathcal{F}}}_{L}^{* }\le {{\mathcal{F}}}^{* }\) from level L of the NPA hierarchy against the value of the symmetrically tilted functional Cα,α(p), for α {0.2, 0.3, 0.4, 0.6, 0.8}. Since the optimal observables \({\hat{A}}_{1}\) and \({\hat{B}}_{1}\) are given by some linear combination of gates \(\hat{Z}\) and \(\hat{X}\) in the SWAP circuit (16), to find \({{\mathcal{F}}}_{L}^{* }\), we introduce extra dichotomic operators \({\hat{A}}_{2}\) and \({\hat{B}}_{2}\) to account for the X gate on Alice’s and Bob’s side and impose the relevant extra constraints by means of localizing matrices34. We find that level 3 of the NPA hierarchy is enough for producing the fidelity curves for α < 0.9, but higher values of α require increasing levels of the hierarchy. This rise in the minimum hierarchy level required for certification is also observed in the calculation of NPA upper bounds for the maximal quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\le {c}_{{{\mathcal{Q}}}_{L}}(\alpha ,\alpha )\), which we address in the following subsection. As can be seen in the figure, the minimal fidelity becomes \({{\mathcal{F}}}_{L}^{* }={{\mathcal{F}}}^{* }=1\) when the functional value is maximal, as expected from the discussion above. In particular, for α > 0.3 a clear change in behavior in the fidelity curve is observed when the functional value reaches the local bound \({C}_{\alpha ,\alpha }({\boldsymbol{p}})={c}_{{\mathcal{L}}}(\alpha ,\alpha )=2(1+\alpha )\), after which the dependence is almost linear.

Fig. 3: Robustness of the self-testing statements.
figure 3

A plot of lower bounds \({{\mathcal{F}}}_{L}^{* }\) on the minimum quantum fidelity \({{\mathcal{F}}}_{L}^{* }\le {{\mathcal{F}}}^{* }\) from the level L = 3 of NPA hierarchy between the actual state and the optimal self-testing state against the observed value Cα,α(p) of the symmetrically (α = β) tilted CHSH functional (15) for tilting parameters α {0.3, 0.4, 0.5, 0.6, 0.7, 0.8}.

Analytical intractability of SOS decompositions

As already mentioned above, the SOS decompositions found in the case of one ideal detector do not easily generalize to the general case of efficiencies ηA, ηB < 1. On one hand, failed numerical attempts to find tight SOS decompositions with degree 2 polynomials suggested they were not available for some values of the tilting parameters α, β. Since a polynomial-degree SDP relaxation of the SOS problem is dual to the moment SDP relaxation introduced by NPA, we started by charting, in the tilting parameter space α, β [0, 2], the minimum level L required for the NPA upper bound \({c}_{{{\mathcal{Q}}}_{L}}(\alpha ,\beta )\) to be tight such that \({c}_{{{\mathcal{Q}}}_{L}}(\alpha ,\beta )={c}_{{\mathcal{Q}}}(\alpha ,\beta )\), where the maximal quantum values \({c}_{{\mathcal{Q}}}(\alpha ,\beta )\) of the doubly-tilted CHSH inequalities are obtained from Theorem 1 and 2 up to any desired precision. We show the results of this numerical exploration in Fig. 4.

Fig. 4: Increasing levels for tight NPA upper bounds in the CHSH scenario.
figure 4

A plot of the minimum level L {1, 1 + AB, 2, 3, 4, 5, 6, 7+} of the NPA hierarchy required to saturate the maximum quantum value \({c}_{{\mathcal{Q}}}(\alpha ,\beta )\) of the doubly-tilted CHSH inequality (15) such that \({c}_{{{\mathcal{Q}}}_{L}}(\alpha ,\beta )={c}_{{\mathcal{Q}}}(\alpha ,\beta )\) for α, β [0, 2]. Notably, while level 1 + AB suffices when either α = 0 (x-axes) or β = 0 (y-axes), the required minimum level of the NPA hierarchy rapidly increases as the tilting parameters tend toward the critical boundary α + β = 2.

As the figure shows, there is a rapid increase of L as the tilting parameters approach the critical boundary α + β = 2. In particular, for α = β = 0.999 we find that not even L = 10 is enough for the NPA upper bound to match the maximum quantum value, as illustrated by the upper bound sequence in Fig. 5. In particular, to a 12-digits approximation the analytical answer is \({c}_{{\mathcal{Q}}}(\alpha =0.999,\beta =0.999)=3.9980\,0000\,1333\), whereas the NPA hierarchy gives the upper bound of \({c}_{{{\mathcal{Q}}}_{L = 10}}(\alpha =0.999,\beta =0.999)=3.9980\,0000\,2190\). These high precision calculations were performed using the toolkit for non-commutative polynomial optimization Moment36, the modeler YALMIP37, and the arbitrary-precision solver SDPA-GMP38.

Fig. 5: Error in estimation of maximum quantum violation with high levels of NPA hierarchy.
figure 5

The curves in plot (a) correspond to the difference \({c}_{{{\mathcal{Q}}}_{L}}(\alpha ,\alpha )-{c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) (×10−8) between the upper-bounds from the levels L {7, 8, 9, 10} of the NPA hierarchy and the maximal quantum violation \({c}_{{\mathcal{Q}}}(\alpha ,\alpha )\) of symmetrically (α = β) tilted Bell inequalities (15), against α [0.99, 1], obtained with an arbitrary precision solver SDPA-GMP38 and our analytical solution (Theorem 1), respectively.

These observations raise the question of whether there is a finite level at which the NPA upper bound coincides with the maximum quantum value for all tilting parameters α, β. Because of the SDP duality mentioned earlier, it is easy to see that NPA level L corresponds to polynomial degree on the SDP relaxation of the SOS decompositions problem. Thus the problem of finding tight SOS decompositions (of the form (11)) for the doubly-tilted CHSH inequalities (15) is intractable via analytical methods described in ref. 18 for the tilted CHSH inequalities (9).

Discussions

In this work, we addressed the problem of finding the quantum strategies that maximize the loophole-free violation of a given Bell inequality in the presence of inefficient detectors. In Lemma 1, we demonstrate that for any Bell inequality and any specification of detection efficiencies, the quantum strategies that yield the maximal loophole-free violation are the ones that maximally violate a tilted version of the Bell inequality. We then consider the CHSH inequality (6) to retrieve a family of doubly-tilted CHSH inequalities (7) from Lemma 1. As our main result, we analytically derive self-testing statements (Theorem 1 and Theorem 2) for the doubly-tilted CHSH inequalities, entailing the maximal quantum violation and the ensuing optimal quantum strategy. We note that the maximal quantum violation of the symmetrically (α, β) tilted CHSH inequality (15) from Theorem 1 differs from that reported in11. Additionally, it is worth noting that the nonlocal correlations maximally violating the symmetrically (α = β) tilted inequalities in (15) also maximize the sum \(\left\langle {A}_{0}\right\rangle +\left\langle {B}_{0}\right\rangle\) for a given value C(p) of the CHSH functional. Consequently, the quantum strategies obtained via Theorem 1 allow us to recover the boundary of the set of quantum correlations on the slice C(p) vs \(\left\langle {A}_{0}\right\rangle +\left\langle {B}_{0}\right\rangle\) of the no-signaling polytope, plotted in Fig. 6. Furthermore, these quantum strategies have found application in the recently introduced routed Bell experiments11,12,29.

Fig. 6: Effect of inefficient detectors on nonlocal correlations.
figure 6

This graphic illustrates the impact of detector inefficiencies on nonlocal quantum correlations within the simplest Bell scenario. The blue region represents the set of quantum correlations \({\boldsymbol{p}}\in {\mathcal{Q}}\). The solid blue curve represents the boundary of \({\mathcal{Q}}\) on the slice C(p) vs \(\left\langle {A}_{0}\right\rangle +\left\langle {B}_{0}\right\rangle\) of the no-signaling polytope. With the detection efficiencies ηA = ηB = 0.85, and the local assignement strategy q(abxy) = δa,+1δb,+1, the effective quantum correlations \(\tilde{{\boldsymbol{p}}}\) (3) are constrained to the smaller orange subset. The blue dot on the solid blue curve corresponds to the isotropic behavior piso that maximally violates the CHSH inequality (6), \(C({{\boldsymbol{p}}}_{iso})=2\sqrt{2}\), in ideal conditions, while the corresponding effective behavior (blue dot on the solid orange curve) \({\tilde{{\boldsymbol{p}}}}_{iso}\) no longer attains the maximum loophole-free violation of the CHSH inequality, \(C({\tilde{{\boldsymbol{p}}}}_{iso})\approx 2.08854\). The red dot on the solid blue curve corresponds to the quantum behavior ptilted which maximally violates the doubly-tilted CHSH inequality (7) (dashed black line), \({C}_{{\eta }_{A},{\eta }_{B}}({{\boldsymbol{p}}}_{tilted})=2.98098\). The corresponding effective behavior (red dot on the solid orange curve) ptilted attains the maximum loophole-free violation \(C({\tilde{{\boldsymbol{p}}}}_{\rm{tilted}})\approx 2.19876\) of the CHSH inequality, thereby, exemplifying Lemma 1.

Besides providing a convenient way for finding quantum strategies that generate the maximum loophole-free nonlocality, Lemma 1, and in particular the expression of the tilted Bell inequalities (5), offers crucial insights into how the optimal quantum behaviors move with the efficiencies of the detectors, in the no-signaling polytope. Essentially, with decreasing efficiencies, the hyperplane corresponding to the Bell inequality in (5) tilts about a local deterministic point specified by the assignment strategy, in turn moving the optimal strategy along towards the local polytope \({\mathcal{L}}\), and specifically towards the local deterministic point. We exemplify this observation in Fig. 6.

The family of self-testing statements in Theorem 1 and 2 provide crucial insights into how decreasing detector efficiency affects optimal quantum strategies. For inefficient detectors ηA, ηB < 1, the optimal strategy requires partially entangled states for maximal loophole-free nonlocality and the degree of entanglement decreases as the efficiencies approach the critical values (8), as the state becomes almost product (see Fig. 2 for the symmetric (α = β) case). While this finding is in line with observations from the known asymmetric case ηA = 1, the optimal measurements for the general case ηA ≠ ηB present an intriguing deviation. Specifically, in the asymmetric case ηA = 1 (β = 0), Alice’s optimal measurements (12) remain maximally incompatible irrespective of Bob’s detection efficiency ηB (1/2, 1] (α [0, 2)), while Bob requires partially incompatible measurements whose incompatibility decreases with his decreasing efficiency ηB (α), approaching almost compatible measurements as ηB → 1/2 (α → 1). However, the situation changes significantly when both detectors are inefficient. As we illustrate in Fig. 7, in contrast to the asymmetric case, Alice’s measurements depend non-trivially on Bob’s detection efficiency ηB. Interestingly, whenever ηA < 1 (β > 0), Alice’s optimal measurements sharply tend towards compatible as ηB (α) approaches the critical boundary (α → 2 − β) (8). This observation highlights the natural importance of partially incompatible measurements in device independent cryptography with imperfect detectors39.

Fig. 7: Self-testing of partially incompatible observables.
figure 7

A plot of the optimal cosines of Alice \({c}_{A}^{* }(\alpha ,\beta )\) (16) with β {α, 0.1, 0.01, 0.001, 0} self-tested by the maximum quantum value \({C}_{\alpha ,\beta }({\boldsymbol{p}})={c}_{{\mathcal{Q}}}(\alpha ,\beta )\) of the doubly-tilted CHSH inequalities (15) against the tilting parameter α [0, 1]. Here, \({c}_{A}^{* }(\alpha ,\beta )=0\) implies maximally incompatible whereas \({c}_{A}^{* }(\alpha ,\beta )=1\) reflects compatible observables. Notice, that in contrast to the asymmetrically tilted case β = 0 wherein Alice’s optimal cosine \({c}_{A}^{* }(\alpha ,\beta =0)\) stays constant with respect to α18, for the general case, whenever β > 0, Alice’s optimal measurements change with \(\alpha =\frac{2}{{\eta }_{B}}(1-{\eta }_{B})\) and in-turn depend on Bob’s detection efficiency ηB, and tend towards compatible measurements as α → 2 − β.

Besides the inferences concerning the maximal effective nonlocality in the presence of inefficient detectors, Theorem 1 and 2 allow us to reveal a fascinating intricacy. While the NPA hierarchy is claimed to not converge to the set of quantum correlations in general, i.e., \(\mathop{\lim }\nolimits_{N\to \infty }{{\mathcal{Q}}}_{L}\subset{\mathcal{Q}}\), lower levels (e.g., L = 1 + AB, 2, 3) were widely believed to be sufficient to characterize extremal quantum correlations in the CHSH scenario. However, in striking contrast to the widely held belief, we demonstrate in Figs. 4 and 5, as the tilting parameters α, β > 0 approach critical limit α + β → 2, the level L of NPA hierarchy required for a tight upper bound on the maximal quantum value of doubly-tilted CHSH functional (15) increases drastically (Fig. 4). This effect is the most pronounced for the symmetric case α = β where we find that even level 10 of the NPA hierarchy does not yield tight upper bounds on the maximal violation of the symmetrically tilted CHSH inequalities as α → 1 (Fig. 5). Crucially, it remains unclear if any finite level of NPA will be enough to characterize all extremal quantum correlations even in the CHSH scenario. This effect also renders the traditional SOS decomposition method impractical for deriving analytical self-testing statements intractable.

Even more strikingly, this unexpected feature is observed for quantum behaviors maximally violating the doubly-tilted CHSH inequalities (15) near the critical boundary α + β = 2, as depicted in Fig. 4, which are require with almost compatible measurements (Fig. 7) and almost product states. Since the level 1 + AB is enough for the asymmetric case β = 0 wherein Alice’s optimal measurement remains maximally incompatible, irrespective of the value of α, the effect of increasing NPA levels seems to be linked to the aforementioned intricate dependency of the optimal partially incompatible measurements on the tilting parameters 0 < α, β < 2, and which becomes sharper as the optimal measurements for both parties become almost compatible as α + β → 2. These results then raise the question of whether the complexity of the characterization of extremal nonlocal quantum correlation, as measured by the minimum level of the NPA hierarchy required to saturate the maximal quantum violation of the associated Bell inequality, is related to the partial incompatibility of the quantum measurements realizing them.