> Prerequisites: episodes 046 (HHL and encoding pitfalls), 014/015 (the ledger), 020 (the language of angles), 032 (the inner-product black box). > Next: episode 048, "When Is It Actually Useful: Quantum Machine Learning II".
Three Ways to Encode Data into Qubits: Quantum Machine Learning I
Anyone who has moved house knows: half of moving efficiency is the truck; the other half is how you load it. Carrying one item per person (quick but low capacity); a shipping container (huge capacity but you need a crane); or prepping ingredients while cooking (no storage needed, but you must stay at the stove).
The foundation of the "quantum machine learning" edifice is exactly this loading job: how to fit classical data into the quantum ledger. The previous episode already exposed the first HHL pitfall—data loading can swallow an exponential speedup whole. This episode lays out the three mainstream "loading styles" and tallies each one's rent. Understanding them gives you your first yardstick for judging the truth of quantum machine learning headlines.
Why Loading Is the Critical Bottleneck
Let's set the books straight. A data point with N features (N pixels of an image, N metrics of a customer) can only "live" in a quantum machine as an n-qubit state. An n-qubit ledger has 2^n amplitude slots—all the temptation of quantum machines is here: in theory, n qubits can hold N = 2^n features.
But the flip side of the temptation is two fixed costs: loading (state preparation—writing classical numbers into amplitudes, the qRAM problem of episode 046) and retrieval (measurement only allows sampling—the iron rule of episode 016). The three styles are three different trade-offs against these two costs.
Style 1: Angle Encoding — One Item Per Person
The most naive loading: one qubit per feature, with the feature value becoming a rotation angle on that wire (the angle language of episode 020, cashed in literally)—a datum of 0.37 twists some qubit's gate by 0.37 of an angle. N features use n = N qubits, loaded with a few shallow gate layers.
- Rent: loading is cheap (shallow circuits, noise-robust); retrieval is plain;
- Price: the ledger didn't grow—n qubits hold only n features; the 2^n exponential space is never used.
- Rent: space savings are exponential;
- Price: loading and unloading need a crane—preparing an arbitrary classical vector as an amplitude state is exactly episode 046's bottleneck of "O(N) loading eating the speedup"; without practical quantum memory (qRAM), the container just sits at the dock.
- Rent: loading is cheap (each step "adds a little ingredient", shallow gates); expressive power is surprisingly strong—it has been proven that even a single qubit, with repeated uploading, suffices to represent a broad class of functions;
- Price: circuit depth grows with precision (depth traded for expressiveness—still racing decoherence on noisy machines), and the theoretical map of "where it's strong" is still being drawn.
- Disanalogy 1: a container holds physical goods you can unpack and inspect; amplitude encoding stores "numbers living inside interference structures"—retrieval only permits sampling (pitfall one of episode 046). "Compression" is not lossless packing; it changes the very mode of information's existence.
- Disanalogy 2: loading style is independent of destination; encoding style is deeply tied to "what the downstream wants to do"—for sampling estimation (HHL-style), choose amplitude encoding; for training classifiers (shallow circuits), choose angle/re-uploading. There is no best style, only the style that matches the task.
It is the default encoding in QML papers run on real hardware today: travel light, but the "exponential capacity" quantum bait is never cashed in. This isn't stupidity—it's a trade-off: shallow circuits are a hard requirement on noisy machines (the NISQ reality of episode 030).
Style 2: Amplitude Encoding — The Container, Waiting for the Crane
The aggressive approach: N features written directly as the amplitude distribution of n = log₂N qubits—1000 features need only 10 qubits. Exponential compression; the ledger is fully used.
This is what HHL uses. The watershed between the theorem world and the engineering world is often precisely this loading step.
Style 3: Data Re-uploading — Adding Ingredients While Cooking
The third style has the most "culinary flair": instead of loading all data first and then processing, data is "sandwiched" into every layer of the circuit—layer 1's gates rotate with the data, layer 2 rotates again, flavoring layer by layer. Each layer's gates differ slightly (because the ingredients differ), stacking up rich interference patterns.
It is the most active style in QML experiments of the last four years—the middle road of "light loading + strong expressiveness".
The Rent Table and a Key Insight
| Style | Loading cost | Ledger capacity | Circuit depth | Real-world status | | :--- | :--- | :--- | :--- | :--- | | Angle encoding | Cheap | Exponential space unused | Shallow | Default on real hardware | | Amplitude encoding | Expensive (waits for qRAM) | Exponentially full | Medium | Theorem-world, engineering suspended | | Data re-uploading | Cheap | Expressiveness traded for capacity | Medium-deep | Most active in experiments |
With all three styles laid out, this episode's key insight can be posted:
> Much of quantum machine learning's "quantumness" lives in the encoding.
The first criterion for whether a QML model might beat classical ones is not how fancy the circuit is (however odd a shallow circuit looks, it can often be classically simulated—the main act of episode 048), but: which room of the ledger the data entered. With angle encoding, data occupies only n slots, and classical simulators keep up easily (the 2^n ceiling of episode 030 was never stepped on); with amplitude encoding, you truly stand in the exponential space classical machines cannot enter—then immediately hit the crane problem. This push and pull is the entire current battlefield of quantum machine learning.
Tearing Down the Analogy
Where the moving-truck analogy breaks:
Luggage to Take Home
1. Three loadings, three rents: angle encoding (one item per person: shallow loading, capacity unused), amplitude encoding (container: exponential capacity, unloading waits for a crane), data re-uploading (adding ingredients while cooking: light loading + expressiveness, depth traded for precision). 2. Encoding determines quantumness: whether a model wins hinges first on "which room the data entered"—anything not touching the 2^n space can be matched by classical simulators. 3. Reconciling with 046: amplitude encoding corresponds to HHL's theorem world (qRAM suspended), angle/re-uploading to the NISQ experimental world (shallow circuits)—each front has its own ceiling.
Hook for the next stop: the styles are laid out; now the most painful question: when are these models actually useful? One line of results has poured cold water on the field: many "quantum neural networks" have been proven simulable wholesale on classical computers—dequantization. It is not a scandal; it is the most valuable lesson. Episode 048, "When Is It Actually Useful: Quantum Machine Learning II".
*Series: Quantum Computing · From Coins to Error Correction. Tags: quantum-computing, from-coins-to-error-correction, quantum-machine-learning, data-encoding.*