Three encoding families
| Encoding | Idea | Trade-off |
|---|---|---|
| Basis | Map bits to |0⟩ and |1⟩. | Simple, but loses continuous information. |
| Angle | Use a feature as a rotation angle. | Few qubits, but repeated features add depth. |
| Amplitude | Normalise a vector into state amplitudes. | Compact, but state preparation can be expensive. |
Angle encoding is a practical first experiment
for wire, value in enumerate(features[:n_qubits]):
qml.RY(np.pi * value, wires=wire)
# add entanglers and trainable rotations after encoding
This is not “putting a whole image into four qubits”. It is a chosen feature map. You still decide how to reduce, scale, and order the original data.
Use a classical front end
A raw image or token sequence is too large for a small circuit. Use PCA, a small CNN, an embedding model, or another task-appropriate encoder to produce a compact vector, and state the compression step explicitly.
Honest claim: “uses a quantum layer” is not the same as “processes the full dataset quantumly”. Report dimensionality reduction, encoding cost, and circuit depth.
Put these choices together in the hybrid quantum–classical CNN architecture.