Angle Encoding
Maps each classical feature to a single-qubit rotation gate angle.
Qubits
4
Depth
1
Total Gates
4
Simulability
Simulable
Mathematical Formulation
Description
Angle encoding is the simplest and most widely used quantum encoding strategy. Each classical feature value is mapped to the rotation angle of a single-qubit gate (RX, RY, or RZ), creating a product state with no entanglement between qubits. The resulting quantum state is a tensor product of independently rotated qubits.
Because angle encoding produces product states, it is classically simulable in O(n) time and cannot provide quantum advantage on its own. However, it serves as an excellent building block when combined with entangling layers in variational circuits, and its shallow depth and high noise resilience make it ideal for near-term NISQ hardware.
The encoding maps each feature x_i to a rotation R_a(x_i) on qubit i, where a is the chosen rotation axis. Features should be scaled to [0, 2π] or [-π, π] for optimal coverage of the Bloch sphere.
Circuit Diagram
Property Radar
Properties
Resource Scaling
How resource requirements grow with the number of input features.
| Features | Qubits | Depth | Gates | 2Q Gates |
|---|---|---|---|---|
| 2 | 2 | 1 | 2 | 0 |
| 4 | 4 | 1 | 4 | 0 |
| 8 | 8 | 1 | 8 | 0 |
| 16 | 16 | 1 | 16 | 0 |
Code Examples
Angle encoding with PennyLane using RY rotations on 4 qubits.
from encoding_atlas import AngleEncoding
import pennylane as qml
import numpy as np
enc = AngleEncoding(n_features=4, rotation="Y")
dev = qml.device("default.qubit", wires=enc.n_qubits)
@qml.qnode(dev)
def circuit(x):
enc.get_circuit(x, backend="pennylane")
return qml.state()
x = np.array([0.1, 0.5, 1.2, 2.3])
state = circuit(x)When to Use This Encoding
- Baseline encoding for benchmarking quantum ML models
- Building block in variational quantum classifiers (VQC)
- NISQ-friendly experiments requiring minimal gate depth
- Hybrid classical-quantum architectures where entanglement is added separately
- Quick prototyping of quantum feature maps
Pros & Cons
Advantages
- Simplest possible encoding — one gate per feature
- Constant depth (O(1) per repetition), highly NISQ-compatible
- High trainability (~0.9) with no barren plateau risk
- High noise resilience due to shallow circuits
- Supports all three rotation axes (RX, RY, RZ)
Limitations
- No entanglement — produces only product states
- Classically simulable, cannot provide quantum advantage alone
- Low expressibility (limited to product state manifold)
- Linear qubit scaling (one qubit per feature)
- Periodic encoding can cause information loss without proper feature scaling
References
- [1]Schuld, M., Sweke, R., & Meyer, J.K. (2021). Effect of data encoding on the expressive power of variational quantum machine learning models. Physical Review A, 103(3), 032430.
- [2]Stoudenmire, E. & Schwab, D.J. (2016). Supervised Learning with Tensor Networks. NeurIPS.
- [3]Havlíček, V., et al. (2019). Supervised learning with quantum-enhanced feature spaces. Nature, 567(7747), 209–212.