If you are familiar with rock-paper-scissors and like quantum computing, you will love this game!
Of course you must first learn the rules of rock-paper-scissors-lizard-spock (cf. The Big Bang Theory), but that's easy:
Scissors cuts Paper
Paper covers Rock
Rock crushes Lizard
Lizard poisons Spock
Spock smashes Scissors
Scissors decapitates Lizard
Lizard eats Paper
Paper disproves Spock
Spock vaporizes Rock
(and as it always has) Rock crushes Scissors
Just for fun I tried to implement this in a program for a quantum computer. Well not everthing, but I let the quantum computer randomly pick a choice, so if you win you can say: I have beaten a quantum computer ;-)
The code can be found here:
https://github.com/fhdroid/qrpsls
Have fun!
Albert Einstein thought the idea of Quantum Entanglement had to be incorrect. He called this "Spooky action at a distance".
Unfortunately for him, he was proven wrong by the researchers of NIST.
Because I'm not an expert on quantum mechanics, I won't try to explain it in layman's terms, but if you need beginners-information I can recommend the book (with Isaac Chuang) and articles by Michael Nielsen. He does a great job in explaining the fundamentals of quantum mechanics and computing.
What I would like to share with you is how easy it is to perform (simple) tasks you can run on a real quantum computer. And the great part is: it's all FREE.
First of all you need
sign up for an account. Don't worry, they won't ask silly questions. After that, you can click on the "Composer" link and you're ready to shuffle some qubits around!
For that you need to know a little bit about gates and measurements but that is covered in the
Beginner's Guide or one of the more elaborated guides.
You could also take a look at one of the many Youtube tutorials and mimic the placement of the gates.
After some experimenting, I decided to put a Hadamard gate on the first qubit and an CNOT gate on the second. In the Composer GUI it looks like this:
As expected the result was as follows when I ran it on the simulator:
The nice thing about the Composer is that it also gives you the OpenQASM code for your experiment.
OpenQASM will be discussed in another article I will be posting soon. But if you can not wait for it; here is the code:
include "qelib1.inc";
qreg q[5];
creg c[5];
h q[0];
cx q[0],q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];
Than I tried my hand at
Grover's algorithm and ran it in the simulator first. This is the setup.
This was the result:
As expected it gives a nice "score" of 1. So I was curious to run it on the real computer. The result was very accurate:
Because of the "noise" it was not an absolute "1" but as the people at IBM-Q will progress, the better the result will be.