Variational

QAOA Encoding

QAOA-inspired encoding with alternating cost and mixer layers for combinatorial data.

Qubits

4

Depth

9

Total Gates

26

Simulability

Not simulable

Mathematical Formulation

ψ(x)=p=1repsUM(β)UC(γ,x)+n|\psi(\mathbf{x})\rangle = \prod_{p=1}^{\text{reps}} U_M(\beta) \cdot U_C(\gamma, \mathbf{x}) |+\rangle^{\otimes n}

Description

QAOA (Quantum Approximate Optimization Algorithm) encoding adapts the QAOA circuit structure for data encoding. It alternates between cost layers that encode features through data-dependent rotations and mixer layers that spread information across qubits via entangling gates. This structure is particularly well-suited for combinatorial optimization problems.

The circuit begins with Hadamard gates to create equal superposition, then repeats p layers of: (1) data rotation gates R_data(γ·x_i) encoding features as phase-like rotations, (2) entangling gates (CZ, CX, or RZZ) coupling qubits, and (3) mixer rotation gates R_mixer(β) for exploration. The γ and β parameters control the encoding strength and mixing, respectively.

The encoding supports both linear and quadratic feature maps: linear maps φ(x_i) = γ·x_i, while quadratic uses φ(x_i) = γ·x_i². An edge-coloring-based algorithm optimizes the circuit depth for the entanglement pattern, yielding near-optimal parallel gate scheduling.

Circuit Diagram

Property Radar

Properties

Qubits
4
Circuit Depth
9
Total Gates
26
Single-Qubit Gates
20
Two-Qubit Gates
6
Parameters
0
Entangling
Yes
Simulability
Not Simulable
Expressibility
Entanglement Capability
Trainability
0.77
Noise Resilience

Resource Scaling

How resource requirements grow with the number of input features.

FeaturesQubitsDepthGates2Q Gates
227122
449266
8895414
1616911030

Code Examples

QAOA encoding with PennyLane using linear entanglement and CZ gates.

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

enc = QAOAEncoding(n_features=4, reps=2, entanglement="linear")
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

  • Encoding data for combinatorial optimization problems
  • Graph-structured data encoding (e.g., MaxCut, TSP)
  • QAOA-inspired variational classifiers
  • Problems with natural cost-function structure
  • Quantum optimization benchmarks

Pros & Cons

Advantages

  • Natural fit for combinatorial optimization problems
  • Flexible entangling gate choices (CX, CZ, RZZ)
  • Edge-coloring optimized depth for parallel gate scheduling
  • Supports both linear and quadratic feature maps
  • Good trainability with linear entanglement

Limitations

  • Specialized structure — may not be optimal for general ML tasks
  • Full entanglement scales poorly for large feature counts
  • Fixed γ and β parameters limit adaptability without optimization
  • Barren plateau risk increases with reps > 10
  • Not designed for continuous feature-intensive tasks

References

  1. [1]Farhi, E., Goldstone, J., & Gutmann, S. (2014). A Quantum Approximate Optimization Algorithm. arXiv:1411.4028.
  2. [2]Hadfield, S., et al. (2019). From the Quantum Approximate Optimization Algorithm to a Quantum Alternating Operator Ansatz. Algorithms, 12(2), 34.
  3. [3]Zhou, L., et al. (2020). Quantum Approximate Optimization Algorithm: Performance, Mechanism, and Implementation on Near-Term Devices. Physical Review X, 10(2), 021067.