You Never Get Your Angles Back
What Quantum Angle Encoding Really Is
Angle encoding looks simple. You take numbers and convert them into angles. You apply rotations. Later, you measure.
What is not obvious is that the angles entered never reappear. They are not stored. They are not read out. And yet they determine everything you observe.
Why nothing is actually stored
Most people start with the wrong idea.
They imagine a qubit as a tiny container. You put information in. You take information out. Just like a classic bit. But more powerful. In this idea, angle encoding sounds like a strange way of writing numbers.
But this idea fails immediately.
A qubit does not contain any values. There is nothing in it that can be examined. A qubit is not a data storage. What exists is a quantum state. And the only thing that can ever be accessed from this state is how often certain results occur when it is measured.
This becomes clearly visible when looking at the qubits in a quantum circuit.
import numpy as np
from qiskit import QuantumCircuit
x = np.array([0.3, 1.1])
qc = QuantumCircuit(2)When we create a quantum circuit object, Qiskit is only interested in how many qubits we want to have. There is no way to initialize a quantum circuit with classical inputs.
Qiskit initializes all qubits to |0⟩. This is the basis state of the computational basis, which lets us measure the qubit as 0. Almost all quantum circuit diagrams adhere to the same convention, as you can see if you look at the state to the left of the qubit wire.
All you can do is apply quantum gates to the qubits. Some of these gates have parameters that you can use to provide your data.
qc.ry(x[0], 0)
qc.ry(x[1], 1)One might think that these gates write the data into the qubits. However, they do not. If encoding were simply a matter of writing numbers, that would be the end of the story.
However, quantum gates do not write numbers into quantum memory. Never.




