An explicit classical strategy for winning a $\mathrm{CHSH}_{q}$ game

A $\mathrm{CHSH}_{q}$ game is a generalization of the standard two player $\mathrm{CHSH}$ game, having $q$ different input and output options. In contrast to the binary game, the best classical and quantum winning strategies are not known exactly. In this paper we provide a constructive classical strategy for winning a $\mathrm{CHSH}_{q}$ game, with $q$ being a prime. Our construction achieves a winning probability better than $\frac{1}{22}q^{-\frac{2}{3}}$, which is in contrast with the previously known constructive strategies achieving only the winning probability of $O(q^{-1})$.

A CHSHq game is a generalization of the standard two player CHSH game, having q different input and output options. In contrast to the binary game, the best classical and quantum winning strategies are not known exactly. In this paper we provide a constructive classical strategy for winning a CHSHq game, with q being a prime. Our construction achieves a winning probability better than 1 22 q − 2 3 , which is in contrast with the previously known constructive strategies achieving only the winning probability of O(q −1 ). INTRODUCTION Non-locality is one of the defining features of quantum mechanics qualitatively differentiating it from classical physics [1]. Apart from its foundational importance, scientists have recently realized that quantum non-locality is also an extremely valuable resource enabling various tasks, such as quantum key distribution [2,3] or randomness expansion and amplification [4][5][6][7][8][9][10][11]. All these applications use a unifying feature of quantum mechanics -namely its possibility to provide the experimentalist results that exhibit super-classical correlations. Measurements on distant parts of a quantum system can, if performed in a specific way, produce results that are not reproducible by any classical system, even with the help of pre-shared information. Since the seminal work of Bell [12], who first realized this fact, a long line of research was devoted both to experimental realization of different tests of quantumness (including the recent loophole-free Bell experiment [13]) and its theoretical implications.
One of the recent utilizations of quantum super-correlations is the idea of Device Independence. As quantum devices are capable of producing a different flavour of correlations then purely classical ones, the existence of these kind of correlations (a. k. a. violating some kind of Bell inequality) certifies a quantum nature of the experiment performed. Thus by observing the output data of an experiment and relating it to its input, one is in principle able to conclude quantum nature of the devices, without any need of knowing or testing the inner workings of the devices. And as quantum measurements providing super-classical correlations are inevitably connected with randomness of the outcomes, an experiment can simultaneously check "quantumness" of the devices and provide randomness. This approach is called Device Independence [1], and stands in the spotlight of recent research in the area of quantum information.
Arguably the simplest and most studied generalization of the original Bell setting is the Clauser-Horne-Shimony-Holt (CHSH) setting [14], where two experimentalists choose one out of two possible binary measuremets on their part of the system. The setting can be rephrased into a language of games, where two non-communicating players, Alice and Bob, both receive a uniformly chosen single bit input x and y respectively and their goal is to produce single bit outputs a and b, such that a + b ≡ xy mod 2 (see Fig. 1).
It is well known that classical players can win this game with probability no more than 75%. The strategy achieving this is trivial, consisting of outputting a 0 by both Alice and Bob, irrespectively on the inputs. Utilizing quantum mechanics, players can share a maximally entangled state of two qubits and perform a suitable measurement (dependent on the input) on their respective qubit. In such a way they can increase the probability of wining the game up to 2+ √ 2 4 ≈ 85%. This fact can be utilized to perform device-independent experiments. With the standard CHSH setting, in a single round of the protocol only two bits are produced, where only one of them can be utilized due to the correlation with the other output bit. Therefore there appears a natural question if and how one might produce more bits in a single experimental run. This can be easily achieved by allowing Alice and Bob to receive an input from a higher alphabet and also producing a more complicated result. A straightforward generalization is a CHSH q game, where the dimensionality of both inputs and outputs is limited to a prime q (see Fig. 2). In this case, the winning condition states a + b ≡ xy mod q. However, to be useful for device independent experiments, the probability of winning the game with a quantum strategy must be higher than the probability with purely classical systems. Therefore, bounds for these probabilities are of utmost importance for its possible use. In this paper we provide a constructive lower bound for the probability of winning a CHSH q game using purely classical systems.
The paper is organized as follows. In the second section we formally define the CHSH q game and review the existing bounds for both classical and quantum strategies. In the third section we relate the problem of finding classical strategies to CHSH q games to solving the problem of point-line incidences. In the section four we introduce our classical strategy and prove its efficiency, whereas in the last section we conclude by discussing the results obtained.
A B ≡ xy mod 2 A B Two non-communicating players Alice (A) and Bob (B) get inputs x and y chosen at random from a finite field Fq with prime q. Their goal it to produce two outputs a, b ∈ Fq respectively, such that a + b ≡ xy mod q.

II. GENERAL CHSHq GAMES
Formally, with a non-local game G, we associate two values: a classical probability of winning ω(G) and a quantum probability of winning ω * (G). The non-local properties of quantum theory are demonstrated by the fact that ω * (G) > ω(G). In case of the standard binary CHSH game we have ω(CHSH) = 0.75 and ω * (CHSH) 2+ √ 2 2 ≈ 85%. Both these values are known exactly and for both quantum and classical case there exist a constructive strategy that achieves this bound and is efficient to calculate. In fact, the classical strategy is fully trivial with a constant output, whereas the quantum strategy consists of selecting a proper measurement setting given by the binary input and providing the measurement result as the output.
The binary CHSH game can be generalized in the following way. Both Alice and Bob receive inputs x, y ∈ F q , i.e. a finite field which exist for any q being a prime power. Their goal is to produce outputs a, b ∈ F q , such that a + b ≡ xy, where both sum and product are operations of the corresponding field. We will denote a game with inputs in F q as CHSH q . Note that for this section and the next section we consider the most general case of q being a prime power, however in section IV, we switch to prime q's only. The reason for this is the fact that in prime finite fields both addition and multiplication are very intuitive -they are just addition and multiplication modulo q, which is vital for the proofs.

A. Quantum bound
Contrary to the binary CHSH game, neither the exact value ω * (CHSH q ), nor a strategy obtaining the optimal value is known. The only existing result due to [15] introduces an upper bound for the quantum probability This fact has two important consequences. The first is that being it an upper bound, we will not be able to show ω * (CHSH q ) > ω(CHSH q ) and thus the usefulness of use of CHSH q for device independent experiments. The second consequence is that even the upper bound decreases with 1 √ q in the leading order with large q. Thus, even if the tightness of this bound and a classical-quantum gap could be shown in the future, the statistics of successful outcomes would decreasing with q and many experimental runs would be needed.

B. Classical bounds
With classical bounds the situation is slightly better. There exists an upper bound in the form where p is a prime, k ≥ 1 and ε > 0 is a constant. It is only valid for the case of an odd prime power, but still could serve for a proof of a classical -quantum gap if the quantum bound would be proven tight.
There also exists a set of lower bounds in the form We see that for q being an even power prime the lower bound is higher than for odd powers and thus for all values of q there is a significant gap between the lower or upper (partly non-existent) bounds. Even more importantly and perhaps surprisingly, these lower bounds are not connected with any concrete strategy. Quantum strategies existing so far are limited to different heuristics (e.g. trying to maximize the winning probability over all measurements of the maximally entangled bipartite state), random searches and numerics [16,17]. Best known classical strategies so far obtained only ω(CHSH q ) = Ω 1 q [17], which corresponds to a trivial strategy (both Alice and Bob output 0 irrespective on their input and win if either x = 0 or y = 0, thus in 2q − 1 out of q 2 cases).
In this paper we present the first constructive classical strategy for the CHSH q game with the probability of for q being a prime. With this strategy we close the gap between constructive strategies and existence bounds. To be able to present details of the proof, we first relate the problem of classical CHSH q game strategies to a well-known problem of point-line incidences.

III. POINT-LINE INCIDENCES AND CLASSICAL STRATEGIES FOR THE CHSHq GAME
Every classical strategy of CHSH q can be written as a convex combination of deterministic strategies, which can be written down as two functions -a : F q → F q representing the strategy of Alice and b : F q → F q representing Bob's strategy.
The winning condition now states which can be rewritten into a form where all additions and multiplications are operations of the finite field F q . Note that in this form Alice's strategy can be seen as a set of points P = (x, a(x)) ∈ F 2 q and Bob's strategy can be seen as a set of lines L = l y,−b(y) ⊆ F 2 q , where a line l y,−b(y) contains all points (g, h) ∈ F 2 q , such that h = yg − b(y). Note that the strategy of Alice and Bob is successful for input x, y if the point specified by a vector (x, a(x)) lies on a the line specified by (y, −b(y)). Assuming uniform choice of the input pairs, the strategy of Alice and Bob is the more successful, the more of the points of P lie on the lines in L. Thus one can reformulate the problem of the best strategy for Alice and Bob to a problem of finding q points and q lines with the highest number of incidences. This is a well known and hard problem, even for general sets of points and lines [18]. However, in order to be able to map a set of points and lines to a classical strategy for CHSH q , two more conditions need to be fulfilled: • No two points lie on the same vertical line (have the same x); • No two lines have the same slope y.
Violation of these conditions would make the strategy ambiguous, since it would assign more than one possible output to some inputs x, y.
Let us label the number of point-line incidences by I. The fraction of inputs for which Alice and Bob can produce a correct outcome is given by I q 2 , which, with an assumption of uniform choice of input pairs (x, y), also gives the probability of winning the CHSH q game.

IV. STRATEGY
In this section we construct a strategy for Alice and Bob to win the CHSH q game for prime q. We do so by showing an explicit construction for q points and q lines with I = 1 22 q 4/3 and thus a fraction of correct outcomes 1 22 q −2/3 . We achieve this by selecting a specific set of points and lines not obeying the unambiguity conditions stated before, but having a large number of mutual incidences. Then we perform a transformation that will remove the ambiguities at the cost of removing a portion of the lines and points we started with. In what follows we will use the letter p instead of q to stress that the sums and products are being performed in a field F p of prime order p. We will also use the symbol ≡ in equations valid modulo p (unless explicitly a different modulo is stated) and symbol = in standard integer/rational equations.

A. Selection of points and lines
We define the following quantities We see that both p 1 and p 2 are even and the following inequalities hold: Now we define a set of p 1 p 2 points by all points with coordinates (x, a) and x ∈ 0, p 1 ) (6) a ∈ 0, p 2 ) .
We also define p1p2 4 lines in the form (y, b) with It is easy to see that each line contains exactly p 1 points with different x coordinates. The highest a reached by the lines for x < p 1 is p2 2 − 1 + p1 2 − 1 (p 1 − 1) < p 2 − 1 and thus the number of incidences within this set is exactly which is roughly p 4 3 4 .

B. Transformation
Now we perform the following transformation of both points and lines: where all sums and products are performed in F p and division is understood as multiplication by the inverse element. Transformation is well defined for all the points but (0, 0) and all the lines. With a bit of technical exercise one can see that the transformed points lie on a transformed line if and only if the original points did. It is also easy to see that we have successfully removed all the ambiguity in points, as p 2 x − a is different for all pairs of (x, a) satisfying (6) and so is the inverse element. Therefore, we have a new set of (p 1 p 2 − 1) points that all have different x coordinates. The situation of lines is much different. The slope is defined by the fraction 2p2b p2−y , for which it is not easy to see how many different values it can acquire in F p . Here we will show that among the p1p2 4 lines transformed according to (8) there will be at least p1p2 20 with different slopes.

C. Identifying ambiguities
In order to prove the result, we will sum up all the lines that share a slope with another line and show that there aren't too many of them. In fact we could leave one of the lines sharing a slope with another lines and remove all the rest, but instead we will remove all of them. This makes the procedure redundant, but easier to tackle and does not influence the final results by more than a constant.
We will work with the equation k ≡ 2p2b p2−y , which, after the substitution k ≡ 2p2 k , is equivalent to the equation We will search for values of k for which there exists more than one solution of y and b within the given range (7). To do so, we can visualize the situation as follows: We start from the element 0 in the field of length p (corresponding to b = 0 on the left-hand side of (9)) and make steps of length k (corresponding to increasing b). We are allowed to make up to p2 2 − 1 steps (due to (7)) and are seeking for cases when we "visit" the interval more than once, as this is the interval of values the right-hand side of (9) can acquire. This can happen in two principally different cases: • k < p1 2 and thus the interval is repeatedly visited within subsequent steps • k > 2p 1 and the interval is visited after one or more cycles within the field.
For p1 2 ≤ k ≤ 2p 1 , the size of the step is larger than the interval we are trying to hit, therefore we cannot visit the interval twice without at least one cycle in the field, yet the step is too short to finish a single cycle within the field. Thus for p1 2 ≤ k ≤ 2p 1 there cannot exist more than one solution of (9).

Small steps
If k < p1 2 , the analysis is very simple. We can upper bound the number of solutions for each k to p1 2 and thus the number of repeated solutions to R small = p 2 1 4 . This bound is in fact very loose, but for large p is fully satisfactory.

Large steps
The second case is more complicated. Here we know that the left hand side of equation (9) is 0 for b = 0. Let b 1 be the smallest b such that (9) holds for a given k and let b 2 be the next b for which (9) holds. Let We now define Here δ is an integer, thus δ can acquire both positive and negative values and therefore |δ| is the standard absolute value. It is easy to see that due to the limited width of the interval (10). This condition means that before visiting the interval p 2 − p1 2 , p 2 twice, we have to visit also the interval − p1 2 , p1 2 in point d ≡ δ once again after staring from 0. Let us now define This means that after l steps of length k we visit the point d ≡ δ. Switching back to integers, this means that there exists a positive s such that As k < p and d < p, clearly 0 ≤ s ≤ l and as k > 2p 1 , s > 0. We can also write Now it is easy to see that the points in the field visited in r th step (0 < r < l) have the form Let us now define a set of rational numbers For the specific case s = 1, elements of Q are natural numbers and for each q they exactly define elements of F p visited by the q th step of length k. In all the other cases we want to relate the r th visited element of the field with a specific element of Q. We do it as follows -the r th visited point is associated with element of Q defined by q(r) := rs mod l.
Therefore the element of F p r sp+δ l is associated with (see also Fig. 3) Let us define l q as the largest l for which (24) is satisfied. Then it holds: Let us also define l q − x q as the smallest l for which (24) is satisfied. For l q − x q to solve the inequality, it must hold and thus We identify x q as the number of different ls that can solve (24) for a fixed value of q.

D. Removing ambiguities
Now we can calculate the upper bound of repeated solutions for a specific δ We get rid of the minimum in the sum by a simple trick -as l q grows with q, we will take the first value p1 2|δ| for small values of q and the second value p2 2lq for larger values of q. We choose the breaking point to be |δ|, which is roughly where the transition takes place. Importantly, we do not need to make this decision precise, as a wrong breaking point will only increase the value of the sum and we are interested in an upper bound. The sum now reads After substituting for l q , the sums can be solved and yield Using (4) and (5) it is easy to see that Now we are ready to sum all R δ with δ in the interval given by (13). As only absolute value of δ enters into the formula and δ = 0 is not a valid case, we can write: The total number of repeated solutions is then upper bounded by As p1 6 + 1 2 < p1 5 for p 1 > 30 (thus for fields larger than 27000) and p 2 > p 2 1 due to (4), we can upper bound So even if we remove all repeated solutions, we will stay with at least p1p2 4 − p1p2 5 = p1p2 20 lines, each reaching at least (p 1 − 1) points (as we lost one point during the transformation). This will lead us to as p 1 > 21 22 p 1/3 for p 1 > 30.

E. Formulating the strategy
In the previous subsection we have shown that the number of incidences is lower bounded by p 4/3 22 . Now we are ready to formulate the strategy for both Alice and Bob, which will utilize this fact and lead to a victory in the CHSH q game in more then p 4/3 22 cases out of p 2 . For Alice, the situation is rather simple. After getting the input x = 0, she will compute the inverse element x −1 . Then she will find the solution of an equation x −1 = p 2 x − a within the range (6). To do that, she will need to calculate the inverse element of x (which can be done in an efficient way) and find the quotient (x − 1) and remainder (p 2 − a ) after dividing by p 2 . If the resulting x and a fit into the range (6) (this will happen in p 2 p 1 cases), she will compute the outcome as a = 1 + 2a p2x −a , which again involves an efficient computation of an inverse element. In all remaining cases Alice will return 0, mimicking the trivial strategy.
Bob is in a slightly more complicated situation. For a given input a he will have to find the solution of a = 2p2b p2−y within the range (7). In the worst case he will have to try p 1 /2 different values for y and check whether a 2 − y p2 < p2 2 . If he finds a solution for y , he will output b = p2+y p2−y . In this way he will also utilize some of the ambiguous solutions (he will keep the first y that satisfies conditions, even if other values might as well) -this will potentially lead to winning the game (if the choice by Alice reflects correctly the solution chosen by Bob), but this chance is not incorporated in the bound. If Bob does not find a solution after trying all possible y , he will output 0.
Bob will need to calculate the inverse element of p 2 and 2, which are one-off efforts. Then he will need to perform simple inequality check up to p 1 /2 times and if successful, he will need to calculate one more inverse element. If this would be considered still inefficient, he can adopt the techniques from the previous subsections to find approximate values of y p2 for the set of 0 ≤ y < p2 2 in advance and then test only a minor subset of y s.

V. CONCLUSION
In this paper we have provided an explicit constructive strategy for winning a generalized CHSH q game. The winning probability is lower bounded by p −2/3 22 , what perfectly mimics the non-constructive existence bound known so far.
This result is useful for potential design of device independent algorithms based on higher alphabet CHSH games in different aspects. First, it closes the gap between existing explicit strategies and proven existence bounds, which helps the understanding of the nature of the problem. Second, and most importantly, the presented result provides the first non-trivial classical strategy for a CHSH game, where Alice and Bob need to act in a way that depends on their input and their output is a result of a non-trivial calculation.
There is also a set of open questions that remain. The obvious one is, how one could generalize result presented in this paper for prime power fields. This is not easy, as the nature of the proof relays on the relation between addition and multiplication, which is unique for prime fields. Also the fact that known existence bounds crucially depend on whether they are deployed on even or odd power prime field suggests that any possible generalization will not be straightforward.
More ambitious goals include the aim of finding tight bounds on classical strategies. This might, in accordance with suitable heuristic results for quantum strategies, lead to the possibility of direct use of higher-order CHSH q games in experiments. The ultimate goal, naturally, remains to directly prove a gap between classical and quantum strategies.