🔄 Quantum Data Encoding

Transform classical data into quantum states

Your Progress

0 / 5 completed
Previous Module
QML Algorithms Overview

🌟 The Bridge to Quantum States

Quantum data encoding transforms classical information into quantum states—the first critical step in any quantum algorithm. A vector x = [0.5, 0.3, 0.7, 0.2] becomes |ψ⟩ = 0.5|00⟩ + 0.3|01⟩ + 0.7|10⟩ + 0.2|11⟩. Encoding efficiency determines quantum advantage—logarithmic qubit usage versus linear classical bits.

💡 Why Encoding Matters

Classical data lives in bits—0s and 1s. Quantum algorithms need quantum states in superposition. Poor encoding wastes qubits (basis encoding: n features = n qubits). Smart encoding exploits amplitude encoding: n features = log₂(n) qubits—exponential compression! For 1024 features: 1024 classical bits vs 10 qubits.

Classical (1024 features):
1024 bits required
Quantum (amplitude encoding):
10 qubits only!

🎯 What You'll Learn

⚛️
Amplitude Encoding
Exponential compression
🔢
Basis Encoding
Binary integers to qubits
📐
Angle Encoding
Rotation-based features
🚀
QRAM & Advanced
Efficient data loading

📊 Encoding Efficiency Comparison

Amplitude Encodingn features → log₂(n) qubits

Most efficient—exponential compression

Angle Encodingn features → n qubits

Linear scaling—one feature per qubit

Basis Encodingn bits → n qubits

Least efficient—direct binary mapping

🔬 Key Insight: The Encoding Tradeoff

Amplitude encoding is most efficient but requires O(n) gates to prepare n amplitudes. Angle encoding uses more qubits but only O(n) gates with simple rotations. Basis encoding wastes qubits but prepares instantly. Choose encoding based on your hardware constraints and data structure.