Circuit Examples
Bell State (Entanglement)
Creates a maximally entangled 2-qubit Bell state.Simple 2-Qubit Circuit
RX → RY → CNOT → Hadamard sequence:Medium Circuit (3 Qubits)
Demonstrates Hadamard, CNOT, RX, CRZ, T, Toffoli, SWAP sequence:13-Qubit Full Adder
Implements quantum addition via QFT-based phase encoding:Grover’s Algorithm (Integer Factorization)
Uses quantum amplitude amplification to find prime factors:Shor’s Algorithm
Period-finding circuit for integer factorization of N:- Hadamard gates for superposition over estimate qubits
- Controlled modular exponentiation unitaries
- Inverse QFT to extract period information
- Post-processing to derive prime factors
Quantum Self-Attention Transformer
Quantum analogue of the transformer attention mechanism for NLP: The circuit:- Tokenizes sentences into word embeddings (Word2Vec, 8-dim)
- Encodes embeddings via
BasisEmbedding - Applies 3 rotation layers (RX, RY, RZ) with entanglement (CRZ, CNOT)
- Applies QFT + Grover operator for amplitude amplification
- Measures Z-basis expectation values → softmax → attention weights
- Generates new sentence by combining weights with word embeddings
All circuit notebooks
| Circuit | Qubits | Description |
|---|---|---|
| Simple PennyLane | 2 | RX, RY, CNOT, H |
| Simple OpenQASM | 2 | Same in QASM format |
| Simple Qiskit | 2 | Same in Qiskit |
| Medium | 3 | H, CNOT, T, Toffoli, SWAP |
| Complex 1 | 4 | Full entanglement + controlled rotations |
| Complex 2 | 12 | Large-scale entanglement |
| Full Adder | 13 | QFT-based addition |
| Grover | 12 | Integer factorization |
| Shor | 8 | Period finding, N=35 |
| Quantum Transformer | 8 | NLP self-attention |