Ever since I found out about Qiskit and IBM Q (a publicly-available quantum computer), I’ve wanted to play with electrons just to be able say around water coolers that I did. After completing a Quantum Machine Learning course, today seemed like a good day to finally try it.

But, I didn’t use Python or Qiskit. Instead, I went directly to the IBM Q Experience website and logged in.

The “hello world” of quantum computing is beautifully simple. The tutorial could not be more simple nor better explained. The end result is not a traditional string output, but a histogram showing the quantum states of two entangled electrons.

Unfortunately, after trying 2 different browsers, I discovered that the ridiculously-easy drag-and-drop circuit composer does not work on my smartphone. Fortunately, however, there is a text editor available.

So, I searched online and found some sample QASM (Quantum Assembly Language) code. I don’t know what that code is intended to do, but my goal was just to complete the “hello world” task. Since I’m already familiar with NASM, I picked a few lines of QASM, edited them, and ran the code. To my own amazement, it worked on the first try.

The first 2 lines should be obvious to any experienced programmer. Lines 3 and 4 seem to initialize the 5 available quantum bits (qubits); that’s always step 1.

Those first 4 lines were provided to me. I added the next 4 lines.

Line 5 applies a Hadamard gate to qubit 0, which creates a superposition. Unlike a digital bit, which can only be represented by a 0 or a 1, a qubit can be a 0, a 1, or a superposition (infinite probabilities, beyond the scope of this article).

Line 6 applies a CNOT gate, which entangles the 2 qubits (entangled electrons always have the same quantum state, but that is also beyond the scope of this article). Finally, lines 7 and 8 measure each qubit individually.

I only waited a minute or two for my queued code to run. Since I didn’t know how long it would take, I was pacing around in a manner similar to an expectant father in a waiting room.

After execution, I could finally see what the drag-and-drop interface should have looked like. You can see, from left to right, the Hadamard gate on qubit 0, the entanglement, and then the 2 individual measurements.

Although the histogram does not display properly on my smartphone, the left and right columns represent 00 and 11 probabilities, the expected outcomes. The middle 2 columns represent 01 and 10 probabilities, which are actually errors. Quantum computing is still in its infancy, but that doesn’t make this any less incredible.

The above text is from the tutorial. This was not a simulation. Electrons were entangled by 8 lines of code.

The next time someone says “hello world” tasks are stupid, I’ll beg to differ. This felt awesome, and I’m eager to explore quantum computing further. I’d still like to try non-simulator Qiskit, because you can do more with Qiskit, but I’d really, really like to play with QASM more.