Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 39 ยท Getting Started

What Is Quantum Computing?

Learn what quantum computing is, how qubits differ from bits, what superposition, interference and entanglement mean, and what quantum computers can and cannot do.

A quantum computer is a machine that stores and processes information using the rules of quantum physics instead of the rules of everyday electronics. Where an ordinary computer manipulates bits that are either 0 or 1, a quantum computer manipulates qubits, whose states can be combined and reshaped in ways that have no counterpart in classical logic.

This course teaches the subject by building it. You do not need a physics degree or access to a lab: every idea is turned into a few lines of Python and NumPy that run right in your browser. By the end of this first lesson you will know the three ingredients that give quantum computers their power, the myths you can safely ignore, and what to expect from the rest of the course.

The big picture

Most popular explanations say "a qubit is 0 and 1 at the same time, so a quantum computer tries every answer in parallel". That sentence is misleading enough that it is worth replacing right away. A better description is this:

  1. A register of qubits is described by a list of numbers called amplitudes, one for every possible bit string.
  2. Quantum operations transform that list in a precise, reversible way.
  3. When you finally measure, you get just one bit string, chosen at random with probabilities derived from the amplitudes.

A useful quantum algorithm arranges the amplitudes so that the wrong answers cancel each other out and the right answer becomes very likely. Nothing is tried "in parallel and then picked": you cannot read all the amplitudes, and a single measurement gives one sample. The skill of quantum programming is the choreography of cancellation.

Three ingredients of quantum computing

Superposition A state is a list of amplitudes
Interference Amplitudes add and cancel
Entanglement Qubits share one joint state

Each ingredient gets its own lessons in this course.

1 / 2

Superposition: states are lists of amplitudes

A classical byte holds one of 256 values at a time. The state of 8 qubits is described by 256 amplitudes at once, one per bit string from 00000000 to 11111111. Each amplitude is a (possibly complex) number, and the squares of their sizes add up to 1. This list is called a state vector.

You can feel how fast this grows with a few lines of code. The number of amplitudes doubles with every qubit.

Python The state vector doubles with every qubit

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

At about 45 to 50 qubits an ordinary supercomputer runs out of memory when it tries to store the full state vector. That is one reason quantum hardware is interesting: the machine holds that structure natively. It is also a warning: simulating on a laptop (as we do in this course) is fine for small examples, but it does not scale.

Interference: amplitudes add and cancel

Amplitudes are not probabilities. A probability is never negative, but an amplitude can be negative or complex, which means two different "paths" to the same outcome can add up or cancel. This is interference, the same phenomenon that makes water waves reinforce or flatten each other.

The smallest example uses one qubit and the Hadamard operation H (you will meet it properly in Single-Qubit Gates). Applying H to the state 0 gives an equal mix. Applying it a second time brings the qubit back to 0 with certainty, because the two paths to outcome 1 cancel.

Python Two Hadamards cancel the path to 1

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A fair coin flipped twice does not return to heads with certainty. This operation does, because it is not randomness: it is reversible wave-like mixing. The difference is the essence of the field.

Entanglement: joint states you cannot split

With two qubits there are four amplitudes. Some four-number lists can be split into "a state for qubit A and a state for qubit B"; others cannot. The ones that cannot are entangled. An entangled pair has a definite joint behavior (measurements are perfectly correlated, say) without either qubit having a state of its own. Entanglement is the resource behind teleportation, superdense coding and most speedups. It gets its own chapter, starting at Bell States and Entanglement.

What quantum computers are good at

Today we know of a limited but important set of problems where quantum algorithms are provably or plausibly faster than the best known classical ones:

  • Simulating quantum systems, such as molecules and materials. This is the original motivation.
  • Factoring integers and computing discrete logarithms (Shor's algorithm), which threatens much of today's public-key cryptography.
  • Searching unstructured data with a quadratic speedup (Grover's algorithm).
  • Some problems in linear algebra, optimization and sampling, where the evidence is still evolving.

Equally important is what they are not: they are not faster at everything, they do not run your web server or spreadsheet, and they do not solve NP-complete problems efficiently as far as anyone knows. The later chapters on algorithms and applications give an honest assessment of each claim.

Myths to drop right now

  • "It tries all answers at once." Only one result comes out of each run, and you cannot copy the hidden state.
  • "Qubits are just faster bits." Gate speed is not the point; the structure of the state is.
  • "Quantum computers will replace laptops." They will be specialized accelerators.
  • "Quantum means random." Quantum operations are deterministic and reversible; only measurement is random.

How this course works

Chapters 1 to 4 build the foundation: the math, qubits, gates and entanglement. Later chapters cover algorithms, noise, tools like Qiskit and Cirq, applications and projects. Every runnable example uses only Python and NumPy, so there is no installation. Code for libraries such as Qiskit is shown read-only, because those packages cannot run in the browser here.

If you already know Python, NumPy arrays will feel natural. If matrices or complex numbers worry you, the next two lessons cover exactly what you need.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the best description of a state of n qubits?

    An n-qubit state vector contains one complex amplitude for each of the 2^n bit strings; squared sizes of the amplitudes sum to 1.
  2. 2. Why does applying the Hadamard operation twice return the qubit to 0?

    H is a reversible operation. Its second application makes the amplitude contributions to outcome 1 add up to zero, a real interference effect.
  3. 3. Which statement about quantum computers is accurate?

    Speedups are known only for specific problem structures. A measurement returns one sample, not all answers.
  4. 4. Roughly how many amplitudes describe 20 qubits?

    2^20 = 1,048,576.

Summary

  • A quantum computer processes qubits whose joint state is a vector of 2^n amplitudes.
  • The three ingredients are superposition, interference and entanglement.
  • Quantum operations are reversible; measurement gives one random bit string.
  • Algorithms work by making wrong answers cancel and right answers reinforce.
  • Quantum computers are specialists, not general speedup machines.

Next: Complex Numbers and Vectors for Quantum Computing