What the tech

Search

/ opens search from anywhere. Esc closes it.

Tools

Get the newsletter
Technology Quantum Tech

Quantum Computing Basics for Beginners

In this story
Quantum Computing Basics for Beginners

A quantum computer uses qubits to represent information. Its gates change how likely different outcomes are when you measure the qubits. Some algorithms use those gates to make contributions to an answer reinforce or cancel. This is called interference, and it helps explain why a quantum computer can work differently from a laptop even though both return ordinary bits.

The simplest example needs just one qubit. Start it at 0, apply a gate called H, and measure. You have an even chance of seeing 0 or 1. Apply that same gate twice before measuring and you get 0 every time in an ideal circuit. The second gate can use information that a single 0-or-1 measurement would have missed. IBM’s Hadamard gate reference.

What is a qubit?

A classical bit stores 0 or 1. A qubit has two reference states, conventionally written |0⟩ and |1⟩. In the usual measurement basis, those are the two possible results. Before measurement, the qubit can be in a superposition described by two amplitudes, one associated with each outcome. An amplitude carries information about both magnitude and phase. Its squared magnitude gives the chance of seeing that result.

Phase matters because gates can combine amplitudes. Two states may both yield a 50/50 split if you measure immediately, yet give opposite results if you apply another gate first. An ordinary coin can give a 50/50 split, too. Everyday software such as our browser password generator can obtain random values through Web Crypto. The distribution alone doesn’t tell you whether you are looking at a quantum process. NIST’s quantum computing explainer.

Related contents:

Quantum Dots

Do quantum computers try every answer?

A general state of three qubits has amplitudes for eight possible bit strings, from 000 through 111. Measuring those qubits once returns just one three-bit string. You can’t read out the full list of amplitudes, so spreading them across many possibilities does not solve a problem by itself. An algorithm needs a way to use interference or other structure to make a useful outcome easier to find. That is why the task and the algorithm matter more than the size of the list of possibilities.

How a quantum circuit works

Read a circuit from left to right. Each line represents a qubit, boxes are gates, and a meter symbol marks measurement. A run starts with a known preparation, often all qubits at 0. It applies the gates in order and then records the measurement. Run that same preparation and circuit again to get another sample, called a shot.

Try one gate, then two

How a quantum circuit works

H is short for Hadamard. The first H prepares equal amplitudes for 0 and 1. With no intervening measurement, the second H combines those amplitudes so they reinforce for 0 and cancel for 1. Add a Z gate between the two H gates and it flips the relative sign. Now they cancel for 0 and reinforce for 1. The extra gate changes the final result even though a measurement right after Z would still be 50/50.

In IBM Quantum Composer, place H on the first qubit wire and inspect the ideal probabilities. Add a second H and check that the probability shifts back to 0. Insert Z between them and check that it moves to 1. View the ideal state before adding a measurement if your tool shows both a probability panel and a shot histogram. On a sampled run, 50/50 describes the expected split. It needn’t be exactly 50 zeros and 50 ones in 100 shots.

Leave any measurement at the end of each circuit. Measuring between the first and second H changes the experiment. The first measurement yields 0 or 1, so the next H acts on that measured state. With the same preparation, the final result is again 50/50 overall. Try this separately if your simulator supports mid-circuit measurements.

Use the three circuits as a troubleshooting check. In a 100-shot ideal run of the first circuit, 52 zeros and 48 ones would be consistent with ordinary sampling variation. If you get ones from the two-H circuit, first check that you started at 0 and placed measurement after both gates. On hardware, gate and readout errors can also create unexpected outcomes. Keep the ideal prediction separate from observed counts and report how many shots you used.

What entanglement adds

A two-qubit circuit can prepare a joint state called a Bell pair. Start at 00, apply H to the first qubit, and apply a controlled-NOT gate, or CNOT, from the first qubit to the second. CNOT flips the target qubit on the branch where the control is 1. After the gate, the ideal circuit gives equal probabilities for 00 and 11 when both qubits are measured in the usual basis.

What entanglement adds

Each individual bit is unpredictable in this circuit, but the two bits match. A pair of prearranged classical bits can also match, so this one histogram alone does not prove entanglement. What makes a Bell pair different is its joint quantum state, which gives correlations you can investigate by changing how you measure. You cannot choose an individual result to send a message. IBM’s Bell-state lesson.

Change the way you measure the pair

To see why the measurement setup matters, add an H gate to each wire just before measuring the Bell pair. In the ideal circuit the pair still yields only 00 and 11. Compare that with an equally weighted classical mixture prepared as 00 or 11 with a coin. After H on both wires, the mixture gives each of the four outputs with 25% probability. This example separates two preparations that originally gave the same histogram. On real hardware, a formal test requires more evidence than matching a single pattern.

Physical qubits, logical qubits, and errors

A physical qubit is the device that holds quantum information. It might be a superconducting circuit kept very cold, or an ion controlled in a trap. Hardware can lose coherence, which means losing the phase relationships a circuit needs. Gates and readout can introduce other errors. An ideal simulator predicts what the circuit should do, so it gives you a baseline for spotting deviations on a real device.

A logical qubit encodes information across physical qubits so the system can detect and correct certain errors. On Google’s Willow processor, researchers reported a quantum memory in which logical errors fell as they increased the size of a surface code. That is evidence of progress in preserving encoded information. Running a long algorithm also requires operations that maintain that protection. Google Quantum AI’s error-correction study.

What quantum computers are used for

Researchers use quantum computers to explore how molecules and materials behave. A quantum processor can represent aspects of a quantum system directly, which is one reason chemistry is a promising area. In an early hardware experiment, researchers estimated energies for small molecules using a quantum circuit and a classical optimization loop. The experiment demonstrates a method. Its practical advantage must be measured against good classical methods for a specified problem and accuracy target. IBM Research’s original chemistry study.

Quantum computing also matters for cryptography. A sufficiently large, fault-tolerant machine running Shor’s algorithm could threaten widely used public-key systems such as RSA. In 2024, NIST approved its first three post-quantum standards for key establishment and digital signatures. These standards are designed to run on ordinary computers. For a refresher on where encryption fits in everyday networking, see our VPN encryption guide. NIST’s standards announcement.

How to read a quantum computing headline

When a claim says

Check this before drawing a conclusion

“More qubits”

Are they physical or logical? Look for error rates and what operations the device completed.

“Faster than a supercomputer”

Which task and which classical method? Check the target accuracy and whether both timings include setup and repeated runs.

“Error correction works”

Did a protected memory improve, or did the device run protected gates or an algorithm? The headline may compress several different milestones.

“Ready for industry”

Did researchers demonstrate a small instance, or solve a problem at a scale and cost that matters to a user?

Read the paper’s benchmark description before quoting a speedup. A fast run on one specially chosen task says little about another task. If you use an AI assistant to read a paper, verify that the cited passage supports the exact claim. Our source-check exercise shows how to separate a measured result from a broader inference.

For a practical benchmark, also ask what happens before and after the circuit runs. A chemistry workflow can include preparing an input, executing many circuits, and using a classical computer to turn the measurements into an energy estimate. A timing result for the quantum step is informative about that step. A claim about completing the whole task should account for the rest of the work at the same level of accuracy.

Do you need a quantum computer to learn the basics?

A classical simulator is enough for the small circuits in this guide. It calculates how ideal quantum states change, so you can predict an outcome, run the circuit, and see where your reasoning diverges. The computational cost of directly storing a general quantum state rises quickly with qubit count. Begin with the one-qubit experiment, then reproduce the Bell pair and check that changing the measurement setup changes what you can learn.