Entangling Feature Maps

ZZ Feature Map

Qiskit-standard entangling feature map with Hadamard, phase, and ZZ interaction layers.

Qubits

4

Depth

22

Total Gates

52

Simulability

Not simulable

Mathematical Formulation

ψ(x)=[(i,j)ZZ(2(πxi)(πxj))iP(2xi)Hn]reps0n|\psi(\mathbf{x})\rangle = \left[ \prod_{(i,j)} ZZ\big(2(\pi - x_i)(\pi - x_j)\big) \cdot \prod_i P(2x_i) \cdot H^{\otimes n} \right]^{\text{reps}} |0\rangle^{\otimes n}

Description

The ZZ Feature Map is a widely-used entangling encoding that follows the Qiskit convention for quantum feature maps. Each layer applies Hadamard gates to create superposition, single-qubit phase gates P(2x_i) for individual feature encoding, and two-qubit ZZ interactions with a distinctive (π−x_i)(π−x_j) phase convention.

The ZZ interaction is decomposed as CNOT · RZ(2(π−x_i)(π−x_j)) · CNOT, creating pairwise feature correlations through entanglement. This phase convention (different from IQP's direct x_i·x_j product) ensures non-trivial interaction even when individual features are small, as the (π−x) shift moves the operating point away from zero.

The ZZ Feature Map is the standard benchmark encoding in Qiskit's quantum ML ecosystem and is commonly used for quantum kernel methods. Its quantum kernel k(x,x') = |⟨ψ(x)|ψ(x')⟩|² has been shown to achieve quantum advantage on structured learning problems.

Circuit Diagram

Property Radar

Properties

Qubits
4
Circuit Depth
22
Total Gates
52
Single-Qubit Gates
28
Two-Qubit Gates
24
Parameters
20
Entangling
Yes
Simulability
Not Simulable
Expressibility
Entanglement Capability
Trainability
0.65
Noise Resilience

Resource Scaling

How resource requirements grow with the number of input features.

FeaturesQubitsDepthGates2Q Gates
2210144
44225224
8846200112
161694784480

Code Examples

ZZ Feature Map with PennyLane using full entanglement and 2 reps.

python
from encoding_atlas import ZZFeatureMap
import pennylane as qml
import numpy as np

enc = ZZFeatureMap(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 and QSVM classifiers
  • Standard benchmark encoding for quantum ML research
  • Variational quantum classifiers with balanced expressibility
  • Quantum advantage experiments on structured data
  • Feature interaction modeling with ZZ correlations

Pros & Cons

Advantages

  • Qiskit-standard encoding with extensive ecosystem support
  • Non-trivial (π−x) phase convention avoids zero-interaction regions
  • Proven quantum advantage on certain learning problems
  • Flexible entanglement topologies
  • Well-balanced between expressibility and trainability

Limitations

  • O(n²) CNOT gates with full entanglement
  • Higher circuit depth than IQP due to phase gate structure
  • Feature count limited to ~12 for practical use
  • Sensitive to noise on current hardware
  • Trainability decreases with repetitions

References

  1. [1]Havlíček, V., et al. (2019). Supervised learning with quantum-enhanced feature spaces. Nature, 567(7747), 209–212.
  2. [2]Schuld, M. (2021). Supervised quantum machine learning models are kernel methods. arXiv:2101.11020.
  3. [3]Huang, H.-Y., et al. (2021). Power of data in quantum machine learning. Nature Communications, 12, 2631.