Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install hiyenwong-ai-collection-collection-skills-equivariant-rl-quantum-circuit-synthesisgit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-equivariant-rl-quantum-circuit-synthesis/SKILL.md---
name: equivariant-rl-quantum-circuit-synthesis
description: "Equivariant reinforcement learning for Clifford quantum circuit synthesis. Uses symplectic-equivariant neural networks to synthesize Clifford gate sequences that reduce symplectic matrix representation to identity. Use when: quantum circuit synthesis, Clifford group operations, equivariant neural networks for quantum computing, RL for quantum control, or stabilizer circuit compilation."
---
# Equivariant RL for Clifford Quantum Circuit Synthesis
Reinforcement learning approach for synthesizing Clifford quantum circuits using equivariant neural networks that respect the symplectic symmetry of the Clifford group (arXiv: 2605.10910).
## Core Idea
Synthesize Clifford quantum circuits by framing circuit synthesis as an RL problem where an agent discovers gate sequences that reduce a symplectic matrix representation to the identity. Equivariant neural networks respecting the symplectic symmetry of the Clifford group achieve significant improvements over standard RL approaches.
## Mathematical Foundation
### Clifford Group and Symplectic Representation
The Clifford group on n qubits is isomorphic to the symplectic group Sp(2n, F_2). Each Clifford gate corresponds to a symplectic matrix over GF(2):
```
Circuit = G_1 ∘ G_2 ∘ ... ∘ G_k
Symplectic: S = S_1 · S_2 · ... · S_k
```
Goal: Find gate sequence such that S = I (identity matrix).
### Symplectic Equivariance
An equivariant network f satisfies:
```
f(g·x) = g·f(x) for all g in Sp(2n, F_2)
```
This ensures the network respects the symmetry structure of the Clifford group, leading to:
- Better sample efficiency
- Generalization to larger qubit counts
- Physically meaningful representations
## RL Formulation
### State Space
- Current symplectic matrix S ∈ Sp(2n, F_2)
- Encoded as binary matrix or bit representation
### Action Space
- Elementary Clifford gates: {H, S, CNOT, CZ, SWAP}
- Each gate corresponds to a known symplectic transformation
### Reward Function
- Reduction in distance from identity: reward = -||S - I||_F
- Terminal reward when S = I (circuit successfully synthesized)
- Step penalty to encourage shorter circuits
### Training
1. Initialize agent with random Clifford target
2. Agent selects gate actions sequentially
3. Update symplectic matrix: S ← S · S_gate
4. Repeat until S = I or max steps reached
5. Policy gradient or PPO optimization
## Workflow
### Step 1: Define Target Circuit
- Specify desired Clifford operation as symplectic matrix
- Or generate random Clifford for training
### Step 2: Run RL Synthesis
- Agent discovers gate sequence
- Equivariant network ensures symmetry-respecting decisions
### Step 3: Validate Output
- Verify synthesized circuit matches target
- Check gate count and circuit depth
### Step 4: Optimize
- Apply gate cancellation rules
- Merge consecutive compatible gates
- Minimize circuit depth for hardware
## Key Advantages
1. **Symplectic equivariance**: Network respects Clifford group structure
2. **Better generalization**: Trained on small n, works for larger systems
3. **No gate set restrictions**: Works with all-to-all connectivity
4. **Competitive with analytical methods**: RL discovers efficient decompositions
## Implementation Notes
- Use GF(2) arithmetic for symplectic matrix operations
- Equivariant layers can be implemented via symplectic group representations
- Standard RL algorithms (PPO, SAC) work as policy optimizers
- Binary matrix encoding is memory-efficient
## When to Use
- Clifford circuit synthesis for quantum compilation
- Quantum gate sequence optimization
- Symplectic-equivariant neural network architectures
- RL-based quantum control and calibration
- Stabilizer circuit preparation
## Related Concepts
- **Gottesman-Knill theorem**: Clifford circuits classically simulable
- **Stabilizer formalism**: Pauli group evolution under Clifford gates
- **Symplectic group Sp(2n, F_2)**: Mathematical structure of Clifford group
- **Equivariant neural networks**: Networks respecting group symmetries