# Quantum Computing: How to Intuitively Understand The CHSH Game

I’ve embarked on my Quantum Computing journey, and it’s been an incredibly fun and rewarding experience. Although it’s challenging, I’ve managed to grasp most of the basic concepts intuitively. However, when I encountered the concept of the CHSH Game, I found myself stuck for a while. It felt different from the other basic concepts I had learned.

Thankfully, after exploring multiple perspectives, I was able to understand it intuitively. It turns out I had been approaching the concept from the “wrong” perspective initially, which made it harder to grasp.

I hope this article helps others who are facing similar challenges in understanding the CHSH Game in Quantum Computing. Let’s start!

Disclaimer: I’m still newbie in Quantum Computing, writing an article helps me to understand any concept clearly and I think by writing an article I could receive feedbacks to more people that might be could understand the concept better than me. So, I’m sorry if some explanations might be incorrect . Good luck!

# What is CHSH Game?

Actually, The concept of CHSH Game is pretty simple. It will only need 3 actors to be able to be played:

- Player 1
- Player 2
- Referee

To make it more clear and fun, let’s name the Player 1: Alice and Player 2: Bob, and in my case the Referee is a Computer. The rule of the game is also pretty simple:

There would be three stages:

- Pre Game Stage. In this stage, Alice and Bob are allowed to talk to each other crafting a plan / strategy to win the game.
- Input Stage. In this stage, Alice and Bob are separated (not able to communicate) and they will receive a randomly independent input (X,Y) ∈ {0,1}.
- Output Stage. In this stage, Alice and Bob will have to give input (A,B) ∈ {0,1} that satisfy this rule: (X and Y) = (A xor B).

Let’s focus on the Output stage by looking at this truth table:

AND logic will be true when **both inputs are 1** while the XOR logic will be true when the **both inputs are different**. By this definition, we can then create a table to see which outputs will give us a winning or losing based on given inputs:

At first glance, it seems so easy that we could just return (A=B) when the inputs are not satisfy the AND condition, and return (A≠B) when the inputs satisfy the AND condition.

But the problem is, Alice and Bob doesn’t have any clue about each other inputs because they are **separated and not able to communicate**. They only **able to communicate in the Pre-Game stage**.

# Deterministic Strategy

Let’s start with the deterministic strategy and actually there are some probabilistic strategy that Alice and Bob could use to win the game, for example **the constant strategy**.

Using the constant strategy, they will have to return exactly the same output no matter what the inputs are (it could be constant 0 or 1, as long as they are the same).

As you can see in the winning table, by using this strategy, the could win 3/4 of the condition. So when the probability of each possible inputs are same (1/4), they will have a 75% winning rate.

Is there any other deterministic strategy that could have a better winning rate? The answer is No!, you can just try it by yourself to find another deterministic strategy, and you will found out that it could achieve the maximum winning rate of 75%.

# Probabilistic Strategy

It might be tempting and make sense to think about the probabilistic strategy in opposite of the deterministic strategy. But it’s just a waste of time, no matter what probabilistic strategy we use, we **couldn’t increase our winning rate** because it would just become **random choice of the deterministic strategy** so it cannot exceed the winning rate of the deterministic strategy.

We need something more, beyond classical strategies…

Extraordinary problems, needs extraordinary solutions.

# Quantum Strategy

## Quantum Entanglement

In Quantum strategy, we could leverage the concept of “Quantum Entanglement”.

By sharing entangled qubits, we could help Alice and Bob to increase their winning rate, but we still need to do another “dirty” stuff to make it work.

## Angle of Measurements

Measurements is very important in Quantum Computing because as we know that in Quantum world, the act of measurements could affect the output.

As we know that by having entangled qubits, Alice and Bob could somehow coordinate in a magical and probabilistic way. But it won’t be useful since by using entanglement alone, we couldn’t increase our winning rate yet, the result would be the same as what we did in probabilistic strategy that we’ve discussed in previous section.

The entangled qubits of Alice and Bob will always return exactly the same values because if Alice’s qubit is measured as 0, Bob’s qubit will certainly become 0 or when Alice’s qubit measured as 1, Bob’s qubit will certainly become 1. So they could only have 75% winning rate at max when they measure the entangled qubits directly.

That’s why they need to somehow modify their **angle of measurements** to increase their winning rate.

## Unitary Rotation Matrix

Before Alice and Bob measure their entangled qubites to get the output result, they must apply some operations that somehow rotate the state of their qubit depends on the inputs so that it could increase their winning rate of playing The CHSH Game.

First, I will need to remind you about the radians in unit circle:

Alice and Bob will have to apply a unitary rotation operation U(𝞱) that receive 𝞱 parameter (angle measured in radians) to their qubits depending on the inputs.

First, imagine this state vector:

The state will depends on the variable 𝞱. And we could use that state to construct a unitary rotation matrix called U:

By having this unitary rotation operation, we could somehow rotate the states of the entangled qubits before we do the measurements so that could give us the desired output probabilistically.

## Quantum Circuit

By using the U(𝞱) operation, we could craft quantum circuit that apply one or two operations on the entangled qubits of Alice and Bob depending on the inputs they received.

## How to understand The CHSH Game Intuitively?

The answer is trough **visualization**. I will give you the visualization that will explain how the rotation could help us on improving the winning rate of Alice and Bob in this CHSH Game so you could grasp the concept and have an intuitive understanding of the solution to CHSH game using Quantum Strategy.

## Visualization: (X AND Y = False)

(X AND Y) will be **false** if and only if the inputs are not (X,Y) = (1,1). In this case, when Alice receive input (X=0), this **condition** will **never** **be true**. In this case, Bob and Alice **should** return **exactly the same output** (either 00, or 11).

As you can see in the Quantum Circuit above, Alice will do the zero rotation (or not rotating at all). So Alice’s state will be like this:

**Green** vector is the posibility of Alice outputs become **0** and **blue** is 1. They are orthogonal (The **inner product** of this vectors is 0). Because (X,Y) inputs are probabilistically independent, there is possibility that Bob will receive input (Y=0) or (Y=1).

Based on received input, Bob will also apply rotation to his qubit (U(𝜋/8) when Y=0, or (U(-𝜋/8) when Y=1). When we plot the rotations of Bob qubit and put it together with the rotation of Alice’s qubit, we will see the visualization to be like this:

No matter which rotation Bob’s applied depends on the Y input, they are still close to Alice’s state. So we can conclude that the probability of Alice and Bob will return exactly the same output is:

We get this from the what so-called: *angle addition formulas. *This formula reveals the geometric interpretation of the inner product between real unit vectors, as the cosine of the angle between them.

## Visualization: (X AND Y = True)

(X AND Y) will be **true** if only if the inputs are (X,Y) = (1,1). This case is a little bit different from the other three cases. So instead of rotating the qubits to be closer to each other, we need to do the opposite (more distant).

In this case, Alice will apply the U(π/4) operation:

Based on received input, Bob will also apply the U(-𝜋/8) operation to his qubit. So the visualization would be like this:

As you can see that the possibility that the output will give exactly the same value is getting separated while the probability that they will return different value is getting closer (See blue dashed vector vs green solid vector).

By using the same formula, we could get the probability that they will return different value is:

The decimal value of that equation is ≈0.85. Which means that for all possible cases, we’ve increased our winning rate from 75% to ≈85%.

If you are interested to see more detailed explanation including the mathematical representative of each operations, you could visit **this post** in my personal blog. Thank you!

Please drop your comments below if you have anything to discuss! 🍻