Encodings Reference¶
The Quantum Encoding Atlas implements 16 quantum data encoding methods with a unified API across PennyLane, Qiskit, and Cirq backends. Each encoding transforms classical feature vectors into quantum states using different circuit structures, offering distinct tradeoffs in expressibility, trainability, hardware cost, and noise resilience.
At a Glance¶
| Encoding | Qubits | Entangling | Depth | Best For |
|---|---|---|---|---|
| Angle | n | No | O(1) | Low-noise baselines, few features |
| Amplitude | log n | Yes | O(2^n) | Qubit-limited regimes, many features |
| Basis | n | No | O(1) | Binary / categorical data |
| IQP | n | Yes | O(n^2) | Quantum kernels, provable hardness |
| ZZ Feature Map | n | Yes | O(n^2) | Pairwise interactions, kernel methods |
| Pauli Feature Map | n | Yes | O(n^2) | Configurable Pauli rotations |
| Data Re-uploading | n | Yes | O(L) | Universal approximation, small circuits |
| Hardware Efficient | n | Yes | O(L) | NISQ devices, native gate sets |
| Higher-Order Angle | n | No | O(n^d) | Polynomial features without entanglement |
| QAOA-Inspired | n | Yes | O(L) | Combinatorial structure in data |
| Hamiltonian | n | Yes | O(L) | Physics-informed encoding |
| Trainable | n | Yes | O(L) | Learnable encoding layers |
| Symmetry-Inspired | n | Yes | O(L) | Heuristic symmetry-aware bias |
| SO(2) Equivariant | n | Yes | O(L) | 2D rotational symmetry |
| Cyclic Equivariant | n | Yes | O(L) | Z_n cyclic shift symmetry |
| Swap Equivariant | n | Yes | O(L) | S_2 pair-swap symmetry |
Choosing an Encoding¶
Not sure where to start? The Decision Guide walks you through selecting an encoding based on your data, hardware, and priorities.
As a quick rule of thumb:
Do your features have known symmetry?
├── Yes ──► SO(2) / Cyclic / Swap Equivariant
└── No
│
Do you need provable quantum advantage?
├── Yes ──► IQP / ZZ Feature Map
└── No
│
Are you qubit-limited?
├── Yes ──► Amplitude Encoding
└── No
│
Do you want a trainable feature map?
├── Yes ──► Data Re-uploading / Trainable
└── No ──► Angle Encoding (safe default)
Taxonomy¶
By Circuit Structure¶
Product-state encodings — no entanglement, classically simulable:
- Angle Encoding — single-qubit rotations
- Basis Encoding — computational basis mapping
- Higher-Order Angle — polynomial rotations
Diagonal-phase encodings — Hadamard + phase + entanglement layers:
- IQP Encoding — provably hard to simulate
- ZZ Feature Map — pairwise ZZ interactions
- Pauli Feature Map — configurable Pauli strings
Variational encodings — interleaved data and parametric layers:
- Data Re-uploading — repeated data injection
- Hardware Efficient — native gate sets
- Trainable Encoding — learnable parameters
- QAOA-Inspired — cost-mixer structure
Global state preparation — amplitude-level encoding:
- Amplitude Encoding — exponential compression
Equivariant encodings — symmetry-preserving circuits:
- SO(2) Equivariant — continuous rotations
- Cyclic Equivariant — discrete cyclic shifts
- Swap Equivariant — pairwise permutations
- Symmetry-Inspired — heuristic symmetry
By Simulability¶
| Classically Simulable | Not Classically Simulable |
|---|---|
| Angle, Basis, Higher-Order Angle | IQP, ZZ, Pauli, Amplitude, Data Re-uploading, Hardware Efficient, QAOA, Hamiltonian, Trainable, all Equivariant maps |
Unified API¶
Every encoding shares the same interface:
from encoding_atlas import IQPEncoding
enc = IQPEncoding(n_features=4, reps=2)
# Properties
enc.n_qubits # Number of qubits
enc.depth # Circuit depth
enc.properties # Full EncodingProperties dataclass
# Circuit generation
circuit = enc.get_circuit(x, backend='pennylane')
# Configuration
enc.config # Read-only dict of parameters
See the Quick Start for a hands-on introduction and the API Reference for the complete programmatic interface.