Quantum Computing: A Beginner’s Notes

 

About the Beginner

I am a pretty normal guy. I drink my coffee in the morning, check my email and wonder what the future will bring. When I was much younger, I thought I wanted to be a nuclear physicist. I believed the only real solution to our energy problem was harnessing the power of the sun—that we would absolutely need to switch from fossil fuels and fission to fusion. I went to college and very quickly discovered that I wasn’t quite made of the engineering stuff. Engineering demanded precision, answers were right or wrong, and although you needed a good command of its rules, it did not seem to demand much deep thinking. So I switched out of engineering and ended up with a Master of Fine Arts in Poetry—and poetry, I felt, was just my cup of tea.

But I never left the engineering world far behind. To help pay for college, I fixed computers and eventually taught myself to write code. Coding I believed was just a different form of poetry. It had its own internal sets of rules, and when executed properly, it could delight just as well as any well-written poem. Shortly after, the Internet appeared—and I knew the world was about to change. As a programmer, I could see the way the Internet was spiraling out from the dark corners of research labs and academia into every facet of daily life. It was like standing on the edge of a great mountain and watching the shadow of a massive cloud spreading out to encompass the valley below.

The Valley Below

That same sense came to me the other day when I stumbled across the IBM Q website (https://www.research.ibm.com/ibm-q/). IBM and a handful of other companies have been trying to build a quantum computer for years. And, like fusion technology, the promise of a true, general purpose quantum computer is staggering. Because a quantum computer can, in theory at least, process many, many variables simultaneously, it has the potential to solve vastly complex problems almost instantaneously. Protein folding could be solved in seconds—leading to new drugs and molecular discoveries. Weather prediction would reach new heights of accuracy. And our current crop of cryptographic protections could be breached—posing challenges for the Internet as we know it. That much I knew. We are at the beginning of the age of the quantum—its vast cloud is just starting to fan out across the valley below.

What struck me with IBM’s quantum computing was that they had put it all online. I could set up an account, login, and begin learning the fundamentals of quantum computing for free, from the comforts of my home. When first released, the folks at IBM had a 5 qubit machine plugged into the internet. A year later, beta access to their 16 qubit processor is now available. If quantum computing is susceptible to Moore’s law, watch out. In two years, we could witness the birth of a 64 qubit processor—capable of processing 264 variables instantaneously—making a quantum computer faster than a traditional computer for some types of operations.

Into The Valley of Quantum Computing

So I started my descent into the often complex, and dizzying world of quantum computers. IBM’s Quantum Experience does a beautiful job of holding your hand.  The Beginner’s Guide provides great background information on quantum mechanics and quantum computing, and it allows you to flip between the user guide and the Composer, where you get to “program” the score that’s to be played out either in the simulator or on the real hardware that lives in IBM’s lab. The Composer also makes a graphical representation of the underlying coding (QASM) and thus lowers the difficulty level tremendously as it not only helps you visualize the score, but it helps you learn QASM.

In simulation mode, you can create a score using any number of qubits. Running against the hardware, however you are limited to 5 (or, if beta, 16) qubits.  The Composer provides tabs to drag and drop gates, barriers and measurements onto the score or to flip from viewing properties of steps or the entire QASM code.

 

Figure 1: Composer showing QASM code
Figure 1: Composer showing QASM code

 

Figure 2: Superposition and Measurement
Figure 2: Superposition and Measurement

My first walk through with the quantum processor was a very simple exercise out of the Beginner’s Guide. This experiment starts with a simple, single qubit, and applies a Hadamard gate to place the qubit into a state of superposition, where the qubit can be both a zero and a one simultaneously. Then a measure step is applied—this step, because it is a measurement, will cause the state of supposition to decohere into a classical bit state, either a zero or a one.

Because of the inherent randomness of quantum processes, each run of an experiment can result in different answers. IBM’s Quantum Experience lets you specify the number of runs (called “shots”) for your experiment and upon completion, shows your results as a histogram (or a QSphere—coming soon).

Figure 3: The results over 100 shots
Figure 3: The results over 100 shots

This of course, is an extremely simple circuit, but there, I have done it; I have written my first quantum code!

Figure 4: Quantum Code
Figure 4: Quantum Code

 

While it isn’t going to win me any awards, I am proud of this. But there is more to try–the Beginner’s Guide has a number of different experiments available—from Bit-flip encoders, to Grover’s and Shor’s algorithms. Am I ready to understand a quantum score like this?  Well, maybe not just yet.  Some day though…

Figure 5: Quantum score
Figure 5: Quantum score

 

One More Cup of Coffee

Idling through my morning, coffee in hand, I can feel where this experience is heading. One day, teams of quantum programmers will work on arranging scores to predict the weather, or simulate nuclear fusion in tokamak reactors. They will, for some time, be like me—thousands of miles away from the actual machine—using a tool similar to the Composer, or perhaps just down in the QASM code itself.

Is the IBM Quantum Experience perfect? No.  It is very much a work in progress. For example, as of this writing, the results of an experiment show the placeholder for IBM’s QSphere (but no Quantum Sphere materializes there).  It is also very likely that the tools will change significantly over time and evolve as these ideas meet the reality of the researchers and enthusiasts who interact with them.

Is it cool?  Heck yeah.

 

Learn more about Quantum Computing


About the Author, Kevin Casey

Kevin Casey, father of two very quantum children, is the president and owner of a small computer consulting firm, NanoLogic, Inc.  He has served as Chief Analytics Officer for a multi-channel marketing firm, Chief Technical Officer of a payments company, and as the Chief Information Officer of an online loan application platform for credit unions.  At home, he’s often referred to as the Chief Bottle Washer.  When not solving riddles in any one of the three start-ups he’s currently involved in, he builds guitars and dreams of mountains in Naples, FL.  You can follow him on LinkedIn at https://www.linkedin.com/in/kevinecasey.

8 comments on"Quantum Computing: A beginner’s notes and overview of IBM’s Quantum Experience"

  1. Want to map the brain using supercomputer to link all the synapses and show how blood, fat and protein make the brain the most creative object in the universe. My project will be called Hx2.

  2. Heyho 🙂
    Figure 5 looks like you triggert the dna funktion 😀

    Lg Andy

  3. Never thought coding as poetizing! interesting!

    • Kevin Casey January 09, 2018

      Lol, is there a difference between code and a poem?

      If you’d like a little more–here’s some qunatum computing meets Finnnegans Wake
      https://developer.ibm.com/dwblog/2017/quantum-computing-shell-game-ibm-q/

      • Garima Madan August 16, 2018

        Hello Kevin,
        I am heartly interested to do my Phd in field of quantum computing . I am basically a physicist working as assistant professor in govt organisation. How can I start my work without having guide. Or tell me the another possibility for doing research in this field.

        • Hi Garima,

          Because you are an assistant professor in physics, I’d probably ask you that question! Seriously though, as with most things on the cutting edge, the internet can be your friend. Read everything you can! The IBM sites listed in the article are great. So too is the documentation online at Microsoft about their Q# programming language–not only does it help you use their language, but the backgrounders on quantum computing are very useful. Google it! Also, if you haven’t already, read everything by Richard Feynman and Charles Bennett that you can get your hands on.

          Second, try to pick a university with a solid quantum physics department. While the internet is good for background information, it is not very interactive–you’ll need and want the help of others who have traveled the road ahead. Not only will your teachers and peers help you challenge your understanding and act as guides when the road gets rough, but they can help provide opportunities to get connected with the research groups who are building the technology. There’s nothing like being part of a team knee-deep in the weeds.

          It also might help to find a focus in the field. At one level, there is theory: what is and isn’t possible to compute in quantum mechanics. The world always will need more people like Shor and Grover to discover the logarithms (or improve on existing ones). At another level is the hardware. Just like in the 1970’s, quantum computing architectures are just beginning to be realized. There is a great demand for people who can contribute at this level. And finally, there will be the need for programmers, those who take the algorithms and implement them on the hardware. Once you have found a focus, it will help guide your research.

          If I could work a little bit of quantum teleportation magic, I myself might travel back in time and complete my undergraduate career in physics–and find myself seeking out a Ph.D. in quantum mechanics. Seems I may have to wait a little longer for someone, perhaps you, to invent that technology though.

          I wish you much luck in your endeavors. And do let me know if you invent a time machine!

          Kevin

  4. Irwin Kraus April 26, 2018

    Supposition? Did you mean superposition?

    • Lol, yes. It was superposition until it decohered under my classically oriented spell-checker, thoughtfully replacing with it “supposition.” A year later almost and I haven’t spent any time figuring out how to get the article edited… seems like once Schrödinger’s cat is dead, it stays that way.

Join The Discussion

Your email address will not be published. Required fields are marked *