Software, Applications & the Frontier
Programming real devices, near-term algorithms, and what quantum will (and won’t) do.
You can program a real quantum computer from a laptop today. What actually happens to your program, what comes back, and which of the famous promises (breaking codes, designing molecules, solving optimization problems) are proven, which are plausible, and which are hype?
What you’ll learn
- Trace a quantum program from code to measured counts: circuit, compiler, control pulses, hardware, shots.
- Explain why every quantum result is a statistic, and how the error bar shrinks with the number of shots.
- Run a variational algorithm in which a classical optimizer tunes a quantum circuit toward a ground-state energy.
- Sort claimed applications into proven speedups, plausible ones and hype, and explain why NP-complete problems are not expected to become easy.
A quantum program is a circuit
Every quantum computer you can use today, in the cloud or in a lab, runs the same kind of program: a quantum circuit. You write it in an ordinary programming language with a software development kit (SDK) such as Qiskit or Cirq, and classical computers do almost all of the work of getting it onto the device.
The quantum hardware does one narrow job: start its qubits in , apply the gates, measure, and hand back one bit string. Then it does it again, thousands of times.
| Layer | What happens there |
|---|---|
| Algorithm | You decide what to compute, e.g. "make an entangled pair and check its correlations". |
| Circuit in code | An SDK turns your code into gates on numbered qubits. |
| Compiler | Rewrites the circuit into the device's native gates and wiring, then simplifies it. |
| Control electronics | Turn every gate into precisely timed microwave or laser pulses. |
| Qubits | Evolve, get measured, and return one bit string per run, called a shot. |
| Results | Counts of each bit string, from which you estimate probabilities and averages. |
Think first The ideal output is exactly 50% and 50% . Why did your 1024 shots not split exactly 512 : 512?
Each shot is an independent random draw (the Born rule). The count of fluctuates around 512 by about . On real hardware you would also see a few and shots, caused by gate and readout errors.
Every answer is a statistic
The device never shows you the amplitudes ; it shows you samples. Most algorithms need an average rather than a single bit: the expectation value of a measurement. Score outcome as and outcome as ; the average over shots estimates , with a statistical error that shrinks like
That square root is a price you pay for quantum mechanics: amplitudes are hidden, and you only get information about them back by sampling.
With 1,000 shots your estimate has an error bar of . By what factor must you multiply the number of shots to halve the error bar to ?
Show the answer
4 × more shots
The error scales as , so halving it needs times as many shots: 4,000. A tenfold improvement needs 100 times more. Shot counts are one of the main costs of near-term algorithms; the Excited State and Rydberg State lessons count them carefully.
The compiler meets the hardware
Real devices cannot run any gate on any pair of qubits. Each platform offers a small set of native gates and fixed connectivity: on many superconducting chips a qubit can only interact with its nearest neighbors. A compiler (Qiskit calls it the transpiler) rewrites your circuit to fit:
- it decomposes every gate into native gates;
- it chooses which physical qubit plays the role of each of your qubits;
- when two qubits that must interact are not neighbors, it inserts SWAP gates to move quantum states around, at three CNOTs per SWAP;
- it simplifies the result, because every extra gate adds error.
Be the compiler. For several years IBM's superconducting processors exposed exactly the native set : no Hadamard. Build the Bell state from these gates alone.
Which hardware the compiler targets matters. Trapped ions connect every qubit to every other but run slow gates; superconducting chips are fast but nearest-neighbor. Explore the trade-offs:
Variational algorithms: a quantum–classical loop
If circuits must be shallow, how can a noisy device do anything useful? The most popular near-term answer is the variational approach. A short circuit with adjustable rotation angles prepares a trial state; the quantum computer measures its energy; a classical optimizer adjusts the angles; repeat. This is the variational quantum eigensolver (VQE), proposed in 2014 for finding the ground-state energies of molecules.
Try it on the one-qubit Hamiltonian , whose ground-state energy is exactly . Two rotation angles and define the trial state. Every energy estimate is built from a finite number of shots, so it is noisy.
During a run the widget's noisy estimate reads , below the ground-state energy . What does that mean?
- The optimizer found a state with energy below the ground state
- Shot noise: a finite-sample estimate can dip below even though the true energy cannot
- The Hamiltonian must have been entered incorrectly
- Entangled states can violate the variational principle
Show the answer
B. Shot noise: a finite-sample estimate can dip below even though the true energy cannot
The variational principle bounds the true expectation value: for every state. An estimate from shots fluctuates by roughly around it, so near the minimum it often lands below . Always quote an error bar.
A sibling algorithm, the quantum approximate optimization algorithm (QAOA), runs the same loop on combinatorial problems such as MaxCut: split a network into two groups with as many links between them as possible. Variational algorithms are flexible and fit on today's hardware, but there is no proof that they beat the best classical methods on any practical problem.
Proven speedups, plausible ones, and hype
Quantum computers are not faster classical computers. They speed up problems with special structure that interference can exploit. Here is an honest scorecard:
| Problem | Best quantum algorithm | Speedup | Status |
|---|---|---|---|
| Factoring and discrete logarithms (breaks RSA and elliptic-curve cryptography) | Shor (1994) | Exponential over the best known classical algorithms | Proven algorithm; needs a large fault-tolerant machine. Classical hardness is believed, not proven. |
| Simulating quantum physics and chemistry | Hamiltonian simulation, phase estimation | Exponential over known classical methods for many dynamics problems | The most natural application. For chemistry ground states, the size of the advantage is actively debated. |
| Unstructured search | Grover (1996) | Quadratic: instead of | Provably optimal; error-correction overheads may eat it in practice. |
| Optimization (scheduling, logistics, MaxCut) | QAOA, annealing, Grover-type search | Unknown for heuristics; at most quadratic for generic search | No proven or demonstrated advantage on practical instances. |
| Machine learning | Many proposals | Several claimed exponential speedups were later matched classically ("dequantized") | Provable advantages exist only for special tasks, such as learning from quantum data. |
Which statement is supported by what is currently known?
- Quantum computers will solve NP-complete problems exponentially faster than classical computers.
- Today's noisy devices have demonstrated a practical speedup for logistics optimization.
- Shor's algorithm factors integers exponentially faster than the best known classical algorithm, given a large fault-tolerant quantum computer.
- Grover's algorithm searches an unsorted database exponentially faster.
Show the answer
C. Shor's algorithm factors integers exponentially faster than the best known classical algorithm, given a large fault-tolerant quantum computer.
Shor's algorithm runs in polynomial time, while the best known classical factoring algorithms are super-polynomial. It needs error-corrected hardware far beyond today's devices, and the classical hardness of factoring is believed rather than proven.
The frontier and the road ahead
In 2019 Google's 53-qubit Sycamore processor sampled from random circuits, a task designed to be hard for classical computers, and claimed quantum advantage. Improved classical algorithms soon narrowed the claimed gap dramatically, and the contest between quantum experiments and classical simulation continues.
The lesson so far: advantage on contrived tasks is within reach; advantage on useful tasks most likely needs fault-tolerant machines running many logical qubits on top of error correction. The Excited State level of this topic takes each thread apart:
| Excited State lesson | What you will do there |
|---|---|
| Programming Quantum Computers | Write circuits as code, estimate expectation values from shots, and see how transpilers map circuits onto native gates and coupling maps. |
| Variational Algorithms: VQE & QAOA | Prove the variational principle, derive the parameter-shift rule, and solve a MaxCut instance with QAOA. |
| Quantum Chemistry & Materials | Turn molecules into qubit Hamiltonians, and estimate what it really takes to beat classical chemistry. |
| Quantum Machine Learning & Optimization | Separate genuine speedups from the fine print of quantum linear algebra and dequantization. |
| Quantum Advantage & the Road Ahead | Weigh advantage experiments against classical spoofing, and learn how to verify a computer you cannot simulate. |
Think first Large-scale Shor machines do not exist yet. Why should encrypted data recorded today already worry us?
"Harvest now, decrypt later": an adversary can store ciphertexts now and decrypt them once a large quantum computer exists. That is why post-quantum cryptography (classical schemes believed to resist quantum attacks, standardized by NIST in 2024) is being deployed before the machines arrive.
Key takeaways
- A quantum program is a circuit: written in code with an SDK, compiled to native gates and connectivity, executed as many shots.
- Every result is a statistic: error bars shrink like with the number of shots.
- Today's devices are noisy (NISQ), so circuits must be shallow and compilers fight to remove every gate.
- Variational algorithms (VQE, QAOA) loop a short quantum circuit with a classical optimizer: flexible, but with no proven advantage yet.
- Proven exponential speedups exist for structured problems such as factoring and quantum simulation; NP-complete problems are not expected to become easy.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why does a cloud quantum computer run your circuit thousands of times?
- To average away the compiler's rounding errors
- Each run returns one random bit string, so probabilities and averages must be estimated from many samples
- The qubits need a warm-up period before they give the right answer
- To copy the final state so that it can be read out
Show the answer
B. Each run returns one random bit string, so probabilities and averages must be estimated from many samples
Measurement samples one outcome according to the Born rule and destroys the superposition. Statistics need repetition, with errors shrinking like .
A compiler inserts SWAP gates into your circuit. Why?
- To make the circuit run faster
- To correct errors in the qubits
- To randomize the measurement outcomes
- Two qubits that must interact are not physically connected, so their states have to be moved next to each other
Show the answer
D. Two qubits that must interact are not physically connected, so their states have to be moved next to each other
Hardware connectivity is limited. A SWAP (three CNOTs) exchanges the states of neighboring qubits, so routing adds gates, depth and error. Good compilers choose the initial placement and the SWAPs to keep that overhead small.
In the variational quantum eigensolver, which job does the quantum computer do?
- Prepare the trial state with the parameterized circuit and sample the terms of its energy
- Choose the next parameters with an optimization algorithm
- Diagonalize the Hamiltonian matrix
- Store the history of all measured energies
Show the answer
A. Prepare the trial state with the parameterized circuit and sample the terms of its energy
The quantum device prepares states that may be hard to represent classically and samples their energy. The classical computer runs the optimizer and the bookkeeping. Nobody diagonalizes the exponentially large matrix.
A startup claims its quantum computer will solve every instance of an NP-complete scheduling problem exponentially faster than any classical computer. What is the best response?
- Plausible: qubits try all schedules in parallel
- Plausible: Grover's algorithm gives exponential speedups
- Very unlikely: NP-complete problems are not believed to be efficiently solvable by quantum computers, and generic search gains only a quadratic speedup
- Impossible: quantum computers cannot run optimization algorithms at all
Show the answer
C. Very unlikely: NP-complete problems are not believed to be efficiently solvable by quantum computers, and generic search gains only a quadratic speedup
No quantum algorithm is known to solve NP-complete problems in polynomial time, and the quadratic Grover speedup is provably optimal for unstructured search. Heuristics like QAOA may help on some instances, but no exponential advantage is known or expected.
Grover-type algorithms give a proven quadratic speedup. Why might it still not pay off for practical problems any time soon?
- Quadratic speedups only work on small inputs
- Error-corrected quantum operations are many orders of magnitude slower than classical ones, so the crossover point may lie at impractically long running times
- Grover's algorithm needs to know the answer in advance
- Quadratic speedups have been disproven
Show the answer
B. Error-corrected quantum operations are many orders of magnitude slower than classical ones, so the crossover point may lie at impractically long running times
A fault-tolerant logical operation is expected to take on the order of microseconds or longer, versus nanoseconds for a classical one. beats eventually, but with constant factors that large the crossover can require running times of days or more (Babbush et al., 2021).
Go deeper
- Programming Quantum Computers · From circuits in code to jobs on real hardware.
- Variational Algorithms: VQE & QAOA · Hybrid quantum–classical loops for near-term devices.
- Quantum Chemistry & Materials · The most natural application: simulating molecules and materials.
- Quantum Machine Learning & Optimization · Promise, hype, and the theorems in between.
- Quantum Advantage & the Road Ahead · Milestones, claims, counter-claims and the path to useful machines.
Further reading
- J. Preskill, "Quantum Computing in the NISQ era and beyond", Quantum 2, 79 (2018).
- M. Cerezo et al., "Variational quantum algorithms", Nature Reviews Physics 3, 625 (2021).