A Comprehensive Introduction to Quantum Computing

If you’ve heard about quantum computers, you might get the itch to start working on something in the field. What is quantum computing? How do you get started?

Full disclosure: I’m not an expert in the field. I’m just a regular (self-taught) coder. I compiled this tutorial because I was interested in exploring quantum computing. The goal was to define the use cases that made it stand out from classical computing. I also didn’t want to dive too deep into the quantum physics part. Many of the explanations below will be basic, and assume that you have little context in quantum computing.

Also, if this is inartfully explained, or flagrantly wrong, I welcome feedback and will make corrections. And if this is helpful, I appreciate knowing as well 🙂

Introduction to Quantum Computing

Unlike classical computing, quantum computing uses quantum phenomena that intersect with mechanical properties, such as superposition and entanglement. Binary code stores data in either a definite 0 or definite 1 state. Quantum computing uses qubits: bits of data that can coherently rest in a combination of 0 or 1 state probabilities. A qubit can theoretically hold more data than a classical bit. Unfortunately, it is impractical to store a large amount of information in a qubit due to how measurement disturbs a quantum system. To get any further, we have to define three concepts.

Quantum superposition: Quantum superposition allows quantum bits (qubits) to coherently hold together many states of data until the data is decomposed. A piece of data can coherently be in two states before it is measured as one. The most well-known example of this is Schrödinger’s cat. A which posits that a cat might be simultaneously alive or dead in a sealed box based on the probability that a poison might be leaked inside. Only once the observer lifts the sealed box is the final state of the cat revealed. Quantum superposition works metaphorically the same way.

Quantum superposition is what allows quantum computing to be extraordinary. The ability to superimpose extraordinary amounts of data allows for much faster calculations than can be done in classical computing. Mathematically speaking, quantum superposition allow qubits to be linear combinations of different quantum states rather than fixed, mutually exclusive categories. This is what allows for a qubit to store more classical information than the strictly binary classical bit.

Quantum entanglement: Entanglement refers to the correlation between different quantum-level molecules. If one entangled molecule has a clockwise spin, another entangled one might have a counter-clockwise spin, no matter the distance between them. This happens with large molecules and even some small diamonds.

Entanglement means you have to read a whole system of data rather than individual data points. The “information” contained in entangled quantum data includes how the entire system is structured. You cannot isolate information from individual molecules or parts.

This is the beginning of the constraint of quantum computing. Quantum states can capture more data, but you have to capture the entire entangled system to do something useful with it. Recent scientific advances in maintaining the lifetime of quantum entanglement have helped push quantum computing further.

Quantum decoherence: Decoherence is the bogey-man of quantum computing. Whenever quantum states are exposed to an observer they start decomposing, meaning information gets lost as time goes on. Quantum decoherence is a major bottleneck to quantum computing at scale.

TLDR (too long didn’t read): Quantum computers are amazing because they can collapse a lot of data into quantum states rather than just the old “0,1” of physical binary code. You can make simultaneous calculations orders of magnitude above what you can do with your regular computer.

Yet, you have to deal with the messy problem of entangled quantum molecules. You have to read the state of the whole system rather than its individual components. And you have to do all that before the state of the system loses coherence with the passage of time.

quantum computing
The even more TLDR version

Quantum Use Cases

What can that extraordinary quantum computational power allow you to do beyond classical computing if you’re able to capture the data in a coherent manner? Here are some examples.

Quantum annealers

Perhaps the most well-known example of quantum computing is D-Wave. One common misconception is that D-Wave is building full quantum computers. They’re really building quantum annealers. What’s the difference? In summary, you can use a quantum annealer to find a local “good enough” minimum much faster than a classical computing context, making quantum annealers ideal for factoring numbers and network analysis/optimization. Complex machine learning models can run on a quantum annealer in much less time if you don’t care as much about finding the absolute best answer. Yet, quantum annealers are not set up to run full quantum algorithms.

Boeing uses quantum annealers to facilitate plane research, and healthcare providers use them to calculate the optimal radiology treatment with cancer patients.

Yet, you won’t be able to run Shor’s algorithm on a D-Wave quantum annealer or any full quantum algorithm, and so you wouldn’t be able to use D-Wave to fully crack cryptography patterns (except on a limited basis). That requires a universal gate quantum computer, a different beast than a quantum annealer.

Shor’s algorithm

There is a comprehensive catalog of about 50 quantum algorithms. Among the most interesting of those would be Shor’s algorithm which can solve for the prime factors of very large and complex numbers. When people talk about securing devices, blockchains and more for a “post-Quantum” world, they are talking about a world where a quantum computing device is able to calculate Shor’s algorithm and break certain parts of modern cryptography .

Grover’s algorithm

Grover’s algorithm helps reverse functions: usually, given X input you find Y output, but here, with a given Y output you can find the X input that initiated it. This is useful for database search. You can search to find a given X and whether it is present in a certain set of data. It could also be used to reverse-engineer user credentials. This might allow attackers to create counterfeit blocks on a blockchain or steal user passwords.

Quantum algorithms in general

Algorithms that are better processed in quantum settings than in classical computing are plenty: there are about 50 examples, ranging from verifying matrix products to Pell’s equation, with polynomial to superpolynomial (exponential) speedup over their classical variants — though whether those speedups are still present after rigorous testing is still an academic matter.

Quantum programming frameworks

Now that you’ve run through some of the theory, what programming frameworks are out there to implement quantum computing concepts?

Qiskit

Qiskit is an open-source quantum computing platform developed in collaboration with IBM’s Q platform. You can run it on quantum computers built by IBM. This allows educators, researchers and businessmen a first look at the possibilities of quantum computing without having one themselves.

Resource:  Qiskit-tutorials, available on Github, is a series of Jupyter notebooks that go into the basics of programming with Qiskit. They are community notebooks that serve as both interactive tutorial and a wiki of sorts on quantum computing in general.

Q#

Called “Q Sharp”, this is Microsoft’s effort to join the quantum computing fray. Most Q# subroutines will run on a simulator instead of an actual quantum chip. Microsoft’s Visual Basic Studio supports Q#. As Microsoft offers more quantum products, it will become the de facto language of the Microsoft quantum computing ecosystem.

Resource: With this quickstart tutorial, Microsoft gets you up to speed with how to use Q#.

QCL

QCL is a high-level programming framework for quantum computing that abstracts away some of the physics associated with quantum phenomenon.

Resource: This simple primer offers an explanation for the roots of QCL and its similarity to existing traditional computer science languages, with a few specific differences (such as the dump function which returns the current quantum state of all qubits) that make it suited to quantum computing, but comfortable enough for traditional computer scientists.

Project Q

Project Q is an open-source programming framework for quantum computing developed at ETH Zurich. It features a high-level programming language for quantum programming, the ability to customize the compiler, and specific libraries to solve for quantum problems. You can run Project Q on quantum simulators or run it on IBM’s 5-qubit quantum computer.

Resource: This Github repo filled with examples from Project Q code serves as a useful reference and tutorial to explore.

Cirq

Cirq is Google’s effort to address a chronic problem with limited-qubit quantum computers (namely error-correction). It’s a Python library you can install via pip (pip install cirq). It’s a useful tool that you can access right away if you’re running a Python environment.

Resource: Use this step-by-step tutorial on using Cirq on Medium to understand its capabilities.

D-Wave Leap

D-Wave Leap offers an interactive cloud platform where you can operate on D-Wave annealers online. You can work in Python and Jupyter notebooks and have immediate access to a D-Wave 2000Q quantum computer. You get a minute of free QPU time which you can use to solve between 400 and 4000 problems.

Resource: This link allows you access to a set of Jupyter notebooks where you can try D-Wave Leap.

Quantum Computing Careers

What are the career prospects of working with quantum computing? For now, the field is mostly academic in nature — and there are few commercial use cases. A search on Indeed.com returns no results for quantum computer or quantum programmer. There are some research roles/internships such as the following from Microsoft. With IBM, Microsoft and Google making big bets in the space however, more quantum careers are surely coming.

quantum computing

Quantum Computing Resources

If you want to follow the space, here are a few great communities and resources to keep track of.

Quantum Bits

This Medium publication hasn’t been updated recently, but it features many interesting articles on quantum computing concepts. Anastasia Marchenkova, a quantum physicist whose passion is quantum computing, writes most of the content.

Microsoft Quantum Computing Newsletter

Microsoft offers a newsletter dedicated around the latest quantum computing updates as well as industry news. While it’s focused on selling Microsoft products, you can gain valuable insights here.

Quanta Magazine (Quantum Computing Section)

Quanta Magazine takes a different approach from the rest of the resources in this space, focused on quality storytelling. It acts as a compelling story-driven overview into advances in quantum computing and the people who make them.

Stack Exchange (Quantum Computing)

The Stack Exchange for Quantum Computing offers deeper answers on quantum computing theory and quantum programming frameworks.

Reddit Quantum Computing

Check out this subreddit for the latest trending quantum computing discussions and articles. With over 10,000 subscribers, it is one of the largest communities dedicated to quantum computing.

Quantum Computing Courses

Quantum Learning Algorithms (Coursera)

Coursera offers this course from Saint Petersburg State University. It covers quantum algorithms, including the two most common discussed (Shor’s algorithm, and Grover’s Algorithm).

Quantum Machine Learning (edX)

This free course offered by University of Toronto (it offers a verified certificate for $49 USD) will go over the use cases of quantum computing in machine learning, and where machine learning can benefit from quantum computing advantages.

Quantum Computing for the Determined

This free video series from Michael Nielsen goes over the theory of qubits in detail, allowing you to get an introductory view to quantum computing theory. Buckle up, finish the whole series, and you’ll be capable of tackling basic implementation of that theory.

Quantum Computation (MIT Open Courseware)

This free course on MIT’s open platform teaches the theory behind quantum computation. Professor Peter Shor , who was the inventor of Shor’s Algorithm, teaches it.

Quantum Computing: Lecture Notes

These set of notes about quantum computing by Ronald de Wolf (a full-time professor at the University of Amsterdam) serve as a text-heavy and notation-heavy deep dive into quantum computing topics. Regard it as a textbook for whenever you need a deep dive on a particular subject.


I hope you enjoyed this introduction — I’d love feedback on what specific topics and resources I can build in the space. Comment below if you have any ideas!

[ssba]

The author

Roger is an entrepreneur who has co-founded a social network entitled ThoughtBasin that looks to connect students looking to make a difference with organizations looking for difference makers. This experience has given him some setbacks, but also some priceless insights. He is deferring admission from the law school of University of Toronto to pursue his dream of creating impact through entrepreneurship, and he is constantly looking to learn and create, and to do more. He contributes to social entrepreneurship projects with his fellow Global Shapers, coordinates a volunteer tutoring site, and on his off time he unwinds by reading, writing, and dancing---sometimes, all at the same time. Follow him on Twitter at https://twitter.com/Rogerh1991.