Develop Quantum Mechanics Intuition through Quantum Game — Qubit Tic Tac Toe

Too Hon Lin
5 min readDec 21, 2019

--

You must have encountered the word “quantum” at some point in your life — quantum computer, quantum materials, quantum technology. Just recently, Google has claimed that they have achieved “quantum supremacy”, which sparked a lot of attention from the media, and of course, heated debate. Some scientists are even claiming we are moving into the “quantum era”.

A Quantum Computer — SOURCE

Quantum physics and quantum technology seems like the all-powerful tool which will bring a whole new revolution to the world, but what exactly is quantum physics? If you are looking for a one-sentence short answer, I afraid you have found the wrong place. In fact, quantum physics is so bizarre, that most quantum physicists might not even understand it fully yet to provide you any solution. To quote Richard Feynman, the Nobel Prize Winner for Physics in 1965 — if you think you understand quantum mechanics, you don’t understand quantum mechanics. In fact, most quantum physicists have taken the “shut-up and calculate” approach for their researches, hoping to shed some light to this weirdness by diving into the weirdness itself.

However, the mathematics of quantum mechanics is extremely complex and tedious. Thus, it is my goal to let you have a “feel” of what quantum mechanics is without diving too much into the math — by playing a game! However, instead of a classical game, we will be “quantizing” the game — a quantum game!

“Quantizing” a game simply means introducing quantum effect into the game. The game we will be quantizing today is none other than the infamous tic tac toe! For those who have never heard of it, Tic tac toe is a 2-player strategy game, where players take turns to place their marking(either “O” or “X”) on a 3x3 board. The goal is to form a straight line from 3 markings.

The marking “O” and “X” are like the head and tail in a coin — they can’t exist simultaneously in the game, or can they? Well, to observe quantum behavior, we need something that is very very tiny — like an atom! Let’s shrink our marking to the nanoscale. Something weird happens to our marking! Instead of just “O” and “X”, if we leave the marking by itself for a while without disturbing it, and come back after a few seconds, the marking might sometime be “O”, sometimes be “X”! The marking is now in the state of superposition — the state where it can be either of “O” or “X”! This is the essence of quantum mechanics —given the right condition, an object like a coin can have a wave-like behavior(or ghost-like/spooky behavior if you prefer!), known as the quantum superposition. Scientists have no idea why this happens, but it really happens, which is both amusing and irritating at the same time. Since quantum physics is weird, let’s use the quantum marking in our game instead of a classical one!

A quantum marking can be in the state of O or X(0 or 1)!
Quantum Superposition. A coin(0 and 1) can become a quantum coin, which can sometimes be 0, sometimes 1.

Hmm, so is quantum physics a science about matters being in 2 states simultaneously? NO! The weirdness doesn’t stop here. Our marking can be either “O” or “X”, provided we are not looking at it! If we look at the marking, the quantum superposition will disappear, and it will collapse back to either “O” or “X”! It is like a cat inside a black box, and you have no idea if the cat is alive or dead, until you open the box! Before opening the box, the cat is either dead or alive! Thus, to win qubit tic tac toe, you need to open the black box, and check the state our quantum marking has collapsed into!

Hadamard gate creates a quantum superposition of O and X. Once the marking is measured, it has 50% collapsing to O, 50% collapsing to X

Normally, it is useful to think of our quantum marking as a sphere, as illustrated in figure 3. Since the quantum marking is a sphere, you can perform whatever operation you want onto the sphere such as rotation, or reflection. As long as the volume of the sphere is not disturbed(which can be by looking at it, or measuring it), its quantum state is preserved. This operation is impossible for a classical object — a “X” marking is always a “X” marking, a head is always a head. The ability to rotate, flip our quantum marking, makes our game more interesting. When your opponent puts a “X” quantum marking, you can now flip the X marking to your own quantum marking “O”, and measure it so it loses its quantum state, preventing your opponent from manipulating your marking!

You can rotate a qubit! Rotation doesn't destroy the quantum state of a qubit!

Thus, our qubit tic tac toe is the extension of Schoridnger’s cat — but instead of 1, we have 9 black boxes with 9 cats inside. Before opening the box(performing measurement), you can perform all sorts of operations(unitary operation) in the box as long as it is non-destructive. The goal is to keep 3 cats alive in a straight line (or dead if you are dead inside). Why does this happen to our poor cat? Well. who knows, let’s just shut up and play the game!

Schrodinger’s cat

The game can be found here: https://github.com/honlin96/Qubit-Tic-Tac-Toe. It runs on Python 3 and requires Qiskit library (Refer here for Qiskit library installation.)

--

--

Too Hon Lin

A true coffee(caffeine) addict who is passionate about science and science communication.