IQP Encoding
Instantaneous Quantum Polynomial circuits with provable classical hardness for sampling.
Qubits
4
Depth
6
Total Gates
52
Simulability
Not simulable
Mathematical Formulation
Description
IQP (Instantaneous Quantum Polynomial) encoding creates quantum states through cycles of Hadamard gates, single-qubit RZ phase gates, and two-qubit ZZ interaction gates. The circuit structure — diagonal unitaries sandwiched between Hadamard layers — is provably hard to simulate classically under standard complexity-theoretic assumptions.
Each layer applies three stages: (1) Hadamard gates create equal superposition, (2) single-qubit RZ(2x_i) gates encode individual features as phases, and (3) ZZ(x_i · x_j) gates encode pairwise feature interactions. The resulting state has equal amplitudes across all basis states but feature-dependent phases, making the quantum kernel k(x,x') = |⟨ψ(x)|ψ(x')⟩|² classically intractable to compute.
The entanglement topology (full, linear, or circular) controls the trade-off between expressibility and circuit cost. Full entanglement captures all O(n²) pairwise interactions but requires O(n²) CNOT gates per layer, while linear entanglement uses only O(n) gates.
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 | 6 | 14 | 4 |
| 4 | 4 | 6 | 52 | 24 |
| 8 | 8 | 6 | 200 | 112 |
| 16 | 16 | 6 | 784 | 480 |
Code Examples
IQP encoding with PennyLane using full entanglement and 2 reps.
from encoding_atlas import IQPEncoding
import pennylane as qml
import numpy as np
enc = IQPEncoding(n_features=4, reps=2, entanglement="full")
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
- Quantum kernel methods (QSVM) with provable classical hardness
- Quantum advantage benchmarking and demonstrations
- Feature interaction modeling (captures pairwise x_i·x_j terms)
- Variational quantum classifiers requiring expressive feature maps
- Quantum reservoir computing
Pros & Cons
Advantages
- Provably hard to simulate classically (polynomial hierarchy collapse argument)
- High expressibility with entangled, phase-modulated states
- Captures both individual and pairwise feature interactions
- Flexible entanglement topologies (full, linear, circular)
- Well-studied theoretical properties
Limitations
- Full entanglement requires O(n²) CNOT gates per layer
- Barren plateaus risk increases with repetitions
- Not NISQ-friendly for large feature counts with full entanglement
- Feature count limited to ~12 for practical use
- Phase-only encoding — all basis states have equal amplitude
References
- [1]Havlíček, V., et al. (2019). Supervised learning with quantum-enhanced feature spaces. Nature, 567(7747), 209–212.
- [2]Bremner, M.J., Montanaro, A., & Shepherd, D.J. (2016). Average-case complexity versus approximate simulation of commuting quantum computations. Physical Review Letters, 117(8), 080501.
- [3]Shepherd, D. & Bremner, M.J. (2009). Temporally unstructured quantum computation. Proceedings of the Royal Society A, 465(2105), 1413–1439.