Symmetry & Equivariant

Swap Equivariant Feature Map

Pairwise permutation-equivariant encoding using symmetric CZ gates for paired feature data.

Qubits

4

Depth

6

Total Gates

20

Simulability

Not simulable

Mathematical Formulation

ψ(x)=l=1reps[kCZ2k,2k+1HniRY(xi)]0n|\psi(\mathbf{x})\rangle = \prod_{l=1}^{\text{reps}} \left[ \prod_{k} CZ_{2k, 2k+1} \cdot H^{\otimes n} \cdot \bigotimes_i RY(x_i) \right] |0\rangle^{\otimes n}

Description

The Swap Equivariant Feature Map constructs a circuit equivariant under pairwise permutations: swapping feature pairs (x_0, x_1) ↔ (x_2, x_3) results in the corresponding swap of qubits. This is achieved using only gates that commute with SWAP operations — CZ (symmetric two-qubit gate) and Hadamard (symmetric single-qubit gate).

Each layer applies: (1) RY rotations encoding features x_i on each qubit, (2) Hadamard gates for basis mixing, and (3) CZ gates on the feature pairs (0,1), (2,3), etc. The key insight is that CZ is symmetric (CZ = SWAP · CZ · SWAP), H commutes with SWAP, and RY under SWAP exchanges feature values — together ensuring pairwise swap equivariance.

This encoding requires an even number of features (paired structure) and is well-suited for problems with natural feature pair structure, such as comparing measurement pairs, stereo data processing, or problems with permutation symmetry between groups of variables.

Circuit Diagram

Property Radar

Properties

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

Resource Scaling

How resource requirements grow with the number of input features.

FeaturesQubitsDepthGates2Q Gates
226102
446204
886408
161668016

Code Examples

Swap equivariant encoding with PennyLane using CZ gates on feature pairs.

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

enc = SwapEquivariantFeatureMap(n_features=4, reps=2)
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

  • Problems with natural feature pair structure
  • Stereo data processing (left/right measurements)
  • Comparing measurement pairs with permutation symmetry
  • Molecular property prediction for symmetric atom pairs
  • Any task where swapping feature groups should not change the prediction

Pros & Cons

Advantages

  • Rigorous pairwise swap equivariance — mathematically guaranteed
  • Efficient O(n/2) CZ gates per layer — minimal entanglement overhead
  • Constant depth per repetition (3 layers per rep)
  • Simple circuit structure — easy to implement on hardware
  • CZ symmetry naturally respects SWAP operations

Limitations

  • Requires even number of features (hard constraint)
  • Only captures pairwise permutation — not general permutation symmetry
  • Limited expressibility due to sparse CZ pattern
  • Features must have meaningful pairing structure
  • Not applicable to problems without pair symmetry

References

  1. [1]Schatzki, L., et al. (2022). Theoretical guarantees for permutation-equivariant quantum neural networks. npj Quantum Information, 8, 130.
  2. [2]Nguyen, Q.T., et al. (2022). Theory for equivariant quantum neural networks. PRX Quantum, 3(3), 030322.
  3. [3]Meyer, J.J., et al. (2023). Exploiting symmetry in variational quantum machine learning. PRX Quantum, 4(1), 010328.