What quantum computers might do for AI
Quantum machine learning is an active research area with interesting ideas and serious open problems. Learn the main ideas, the data loading problem, and what is not yet known.
In 60 seconds
What quantum computers might do for AI
Quantum machine learning is an active research area with interesting ideas and serious open problems. Learn the main ideas, the data loading problem, and what is not yet known.
The main ideas people explore
| Idea | What it means | Open questions |
|---|---|---|
| Variational quantum circuits | A small quantum circuit with adjustable angles, trained by a normal computer, a bit like a tiny neural network | Training can get stuck on very flat landscapes ("barren plateaus"); noise hurts; unclear advantage |
| Quantum kernels | Use a quantum circuit to measure how similar two data points are, then use a classical method like a support vector machine | Must beat strong classical kernels; some quantum kernels become hard to use as qubits grow |
| Quantum linear algebra | Algorithms that, under strict conditions, handle some matrix problems much faster in theory | The conditions are strict; data loading and reading answers out can cancel the gain |
| Quantum data | Learning from data that already comes from quantum experiments or sensors | Promising in theory, because the data is quantum from the start |
The data loading problem
- n qubits hold 2ⁿ numbers, so big data fits in a few qubits
- The quantum computer then processes all the numbers at once
- So machine learning becomes exponentially faster
- Loading 2ⁿ arbitrary numbers into amplitudes generally takes a lot of steps, often about as many as the numbers themselves
- Measuring gives only n bits per shot, so reading out a big answer takes many runs
- Some claimed quantum speed-ups were later matched by new classical algorithms that make similar assumptions
A simpler encoding you can run
import numpy as np
def angle_encode(x):
return np.array([np.cos(x / 2), np.sin(x / 2)])
for x in [0.0, np.pi / 3, np.pi / 2, np.pi]:
state = angle_encode(x)
p1 = abs(state[1]) ** 2
print(f"x = {x:.3f} state = {np.round(state, 3)} P(1) = {p1:.3f}")It also goes the other way: AI for quantum
Watch and read more
Lab
Two functions: how many qubits amplitude encoding needs, and an encoder that pads and normalises a data vector.
The problem
Run this in the browser, or with Python 3 and numpy.
- Finish
qubits_needed(length): the smallest n with 2ⁿ ≥ length. For length 1, return 1. - Finish
amplitude_encode(x): pad the list with zeros up to length 2ⁿ, then divide by its length (norm) so the squared amplitudes add to 1. Return a numpy array. - Run the starter. How many qubits does a 784-pixel image need? Then write two sentences on why "10 qubits hold 784 pixels" does not by itself make learning faster.
Practice lab
Edit the code and run it. Python runs in your browser — nothing is sent to our server.
No output. Add print(...) to see values.
You are done when
Hard questions
Try to answer before you reveal. If you can answer these, you understood the lesson.
Q1Amplitude encoding divides by the norm. What information about the original data is lost, and when does that matter?Reveal
The overall size (length) of the vector is lost: [3, 4] and [30, 40] give the same state. If the size matters for your task, for example total rainfall, you must store it separately as an ordinary number or add it as an extra feature before encoding.
Q2Why might learning from quantum data be more promising than loading classical data like images?Reveal
With quantum data, such as states produced by a quantum sensor or a chemistry experiment, the data is already in quantum form, so there is no costly step of loading classical numbers into amplitudes. Some theory results suggest real advantages in such settings. With classical images, the loading step and the strength of existing classical methods make an advantage much harder to show.
Questions people ask
Will quantum computers train large chatbot models soon?
There is no known way to do that with a proven advantage, and today's quantum machines are far too small and noisy. Large models need huge amounts of data loaded and processed, which is exactly where quantum computers are weak. This may change with new research, but no one can promise it.
Is quantum machine learning a waste of time, then?
No. It is a real research field asking real questions. Knowing what does not work is also progress. Some directions, like learning from quantum data and AI that helps build quantum hardware, look especially interesting.
What is a barren plateau?
When training some variational quantum circuits with many qubits, the slope of the loss can become extremely small almost everywhere, so the training has almost no signal about which way to move. It is like looking for a valley on a huge, almost perfectly flat field.
Where can students in India study this?
Many universities and research institutes teach quantum information, often through physics, computer science or electrical engineering. India also has a National Quantum Mission that supports research and skills in this area. Check current programmes on official institute websites.
Lesson test
5 questions. Get 3 right (60%) to pass and complete this lesson.