qiskit-community / qiskit-hackathon-taiwan-20

32 stars 10 forks source link

Quantum Brain Teaser #5

Closed wslu42 closed 3 years ago

wslu42 commented 3 years ago

Abstract

Similar to physical brain teaser, by pattern matching in our quantum brain teaser UI users are expected to find hidden logic behind quantum gates operations, and build up quantum intuitions when playing this brain teaser.

Description

Physical brain teaser was introduced on many occasions not only to entertain people but train our brain in many ways: improving brain processing speed, learning 3D physical intuitions, and maybe building up some muscle memories. Without any instructions, users need to find the patterns hidden in these little gizmos by the creators, practice and generalize the rules behind the scene to solve the puzzles. Imagine in the near future the quantum industries are looking for a bunch of quantum gate engineers who work as chip designers these days and their jobs are primarily creating quantum circuits that fulfills some sort of "truth tables" just like in the old days when classical gates were first introduced. Wouldn't it be cool if we can invent some "quantum brain teasers" to train our brain and build up some instincts when manipulating the quantum gates?

One iconic game we are seeing these days is "Hello Quantum" by Dr. James Wootton (Please do check it out on your App store -- it's fun!). https://www.ibm.com/blogs/research/2018/07/hello-quantum/ Without expecting any prerequisites from users, it started with some simple demo of how quantum gates manipulate the qubits (H, X, CX, SWAP) to match an assigned pattern and gradually escalate the difficulties. Users can learn how quantum gates work simply by try and error process, although the process would be accelerated greatly if some quantum gate knowledge was applied.

Members

Deliverable

Now, can we do something similar real quick? Or do you have some thoughts in mind that implement similar ideas different from Hello Quantum? Below are some criteria I was expecting as a minimal viable product (MVP) for this project:

  1. A text based UI: Including qubit (arranged in some grid-like structure), gate operations (connected to some of the qubits). This can be done simply by printing out a matrix, for example.
  2. Definition of "pattern matching" mechanism: how to determine users pass each challenge.
  3. QuantumCircuit operations allow the user to manipulate the gate in real time. ^^^These are Minimal Viable Products that participants should be able to realize in a 24hr time frame^^^

A quick example is as below: Assuming we have a quantum brain teaser consists of four qubits arranged in 2x2 matrix and defined each qubit as 0, 0, >> A, B 0, 0, >> C, D And we attach the gate this way: X2 | 0, 0 -- X1 0, 0 -- H where user can operate this "quantum brain teaser" by either operating X1 which will filp qubit A,B both to 1, operating X2 which will filp qubit B,D both to 1, or operating H which will put anything that was 0 to + and 1 to - in qubit C,D. And eventually we defined user should be matching below pattern in 2 steps: 1, 0 0, 1 It should be obvious that the answer is just to activate X1 and X2 in either order. Now through this little example you can actually see the difficulties of the problem can be escalated gradually by considering some arbitrary pattern say, trying to match this one again in 2 steps: 0, 1 +, - yeah it's just X2 H instead of adding two more steps (X1 and H) after the previous case, which demonstrates the unitary properties of the gates. 😄

The MVP doesn't have to be defined this way, it can be anything as long as it's correct in a quantum sense (which will be verified when the participants of this project introduce the qasm backend).

Please remember this teaser is not just for fun (although that should be our primary goal today :)) but can be useful to build up some "quantum instinct" when preparing for future quantum engineers. Even myself was entertained by these little gizmos from time to time. So let's have some fun!!

GitHub repo