Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explore quantum computing research with Qiskit and Cirq frameworks
.claude/skills/brycewang-stanford-quantum-computing-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 42% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-24 | ✓→✓ | = Same ✓ | -9% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 49% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 61% | 0% |
A skill for conducting quantum computing research using Qiskit (IBM) and Cirq (Google) frameworks. Covers quantum circuit construction, fundamental algorithms, noise simulation, and practical considerations for running experiments on quantum hardware.
Qubit: The basic unit of quantum information
- Superposition: A qubit can be in a state |0>, |1>, or any
linear combination alpha|0> + beta|1> where |alpha|^2 + |beta|^2 = 1
- Measurement: Collapses to |0> with probability |alpha|^2
or |1> with probability |beta|^2
Entanglement: Two qubits can be correlated in ways impossible classically
- Bell state: (|00> + |11>) / sqrt(2)
- Measuring one qubit instantly determines the other
Quantum gates: Unitary operations that transform qubit states
- Single-qubit: H (Hadamard), X (NOT), Z, S, T, Rx, Ry, Rz
- Two-qubit: CNOT, CZ, SWAP
- Multi-qubit: Toffoli (CCNOT), Fredkin (CSWAP)pythonfrom qiskit import QuantumCircuit from qiskit_aer import AerSimulator def create_bell_state() -> QuantumCircuit: """ Create a Bell state (maximally entangled pair). """ qc = QuantumCircuit(2, 2) # Apply Hadamard to qubit 0 (creates superposition) qc.h(0) # Apply CNOT with qubit 0 as control, qubit 1 as target qc.cx(0, 1) # Measure both qubits qc.measure([0, 1], [0, 1]) return qc def run_circuit(qc: QuantumCircuit, shots: int = 1024) -> dict: """ Run a quantum circuit on a simulator. Args: qc: Quantum circuit to execute shots: Number of measurement repetitions """ simulator = AerSimulator() result = simulator.run(qc, shots=shots).result() counts = result.get_counts() return { "counts": counts, "probabilities": { state: count / shots for state, count in counts.items() } }
pythondef quantum_teleportation() -> QuantumCircuit: """ Implement quantum teleportation protocol. Transfers the state of qubit 0 to qubit 2 using entanglement. """ qc = QuantumCircuit(3, 3) # Prepare an arbitrary state on qubit 0 qc.rx(1.2, 0) qc.rz(0.7, 0) qc.barrier() # Create entangled pair (qubits 1 and 2) qc.h(1) qc.cx(1, 2) qc.barrier() # Bell measurement on qubits 0 and 1 qc.cx(0, 1) qc.h(0) qc.measure([0, 1], [0, 1]) qc.barrier() # Conditional corrections on qubit 2 qc.cx(1, 2) qc.cz(0, 2) qc.measure(2, 2) return qc
| Algorithm | Speedup | Problem | |-----------|---------|---------| | Grover's | Quadratic (sqrt(N)) | Unstructured search | | Shor's | Exponential | Integer factorization | | VQE | Heuristic | Ground state energy | | QAOA | Heuristic | Combinatorial optimization | | Quantum Phase Estimation | Exponential | Eigenvalue estimation | | HHL | Exponential (conditions apply) | Linear systems |
pythonfrom qiskit.circuit.library import TwoLocal def build_vqe_circuit(n_qubits: int, depth: int = 2) -> dict: """ Build a parameterized ansatz circuit for VQE. Args: n_qubits: Number of qubits depth: Circuit depth (repetitions) """ ansatz = TwoLocal( n_qubits, rotation_blocks=["ry", "rz"], entanglement_blocks="cx", entanglement="linear", reps=depth ) return { "circuit": ansatz, "n_parameters": ansatz.num_parameters, "description": ( "VQE uses a classical optimizer to minimize " "<psi(theta)|H|psi(theta)> where psi(theta) is the " "parameterized quantum state and H is the Hamiltonian." ) }
pythonfrom qiskit_aer.noise import NoiseModel, depolarizing_error def create_noisy_simulator(error_rate: float = 0.01) -> dict: """ Create a noise model for realistic quantum simulation. Args: error_rate: Depolarizing error probability per gate """ noise_model = NoiseModel() # Single-qubit gate error error_1q = depolarizing_error(error_rate, 1) noise_model.add_all_qubit_quantum_error(error_1q, ["h", "rx", "ry", "rz"]) # Two-qubit gate error (typically higher) error_2q = depolarizing_error(error_rate * 10, 2) noise_model.add_all_qubit_quantum_error(error_2q, ["cx"]) return { "noise_model": noise_model, "single_qubit_error": error_rate, "two_qubit_error": error_rate * 10, "mitigation_strategies": [ "Zero-Noise Extrapolation (ZNE)", "Probabilistic Error Cancellation (PEC)", "Measurement error mitigation", "Dynamical decoupling", "Quantum error correction (surface codes)" ] }
1. Qubit connectivity:
Real devices have limited qubit connections (not all-to-all)
SWAP gates are needed to route operations -> increases circuit depth
2. Gate fidelity:
Single-qubit gates: ~99.9% fidelity
Two-qubit gates: ~99-99.5% fidelity
Limits useful circuit depth to ~100-1000 gates
3. Coherence times:
T1 (energy relaxation): 100-500 microseconds
T2 (dephasing): 50-200 microseconds
Circuit must complete before decoherence
4. Queue times:
Real quantum computers have job queues (minutes to hours)
Use simulators for development; reserve hardware for final runsReport the exact device used (name, calibration date), number of qubits and connectivity, gate set and fidelities, transpilation settings, number of shots, error mitigation techniques applied, and comparison with classical simulation where tractable. Provide Qiskit or Cirq code in a public repository for reproducibility.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→fail | 22,080 | 20,595 | -7% | 1 | 1 | 0% | 3,532 | 5,042 | +43% | 0 | 0 | — |
case-24 | pass→pass | 24,234 | 13,152 | -46% | 1 | 1 | 0% | 4,750 | 4,302 | -9% | 0 | 0 | — |
case-01 | fail→fail | 16,911 | 14,799 | -12% | 1 | 1 | 0% | 3,147 | 4,059 | +29% | 0 | 0 | — |
case-02 | fail→pass | 13,851 | 10,178 | -27% | 1 | 1 | 0% | 2,750 | 3,894 | +42% | 0 | 0 | — |
case-03 | fail→pass | 12,055 | 7,493 | -38% | 1 | 1 | 0% | 2,449 | 3,146 | +28% | 0 | 0 | — |
case-04 | fail→fail | 17,127 | 17,479 | +2% | 1 | 1 | 0% | 3,235 | 5,091 | +57% | 0 | 0 | — |
case-05 | pass→pass | 18,033 | 14,592 | -19% | 1 | 1 | 0% | 2,790 | 4,171 | +49% | 0 | 0 | — |
case-06 | pass→pass | 9,971 | 6,153 | -38% | 1 | 1 | 0% | 1,651 | 2,661 | +61% | 0 | 0 | — |
case-07 | pass→pass | 17,831 | 16,715 | -6% | 1 | 1 | 0% | 3,149 | 4,507 | +43% | 0 | 0 | — |
case-09 | pass→pass | 19,992 | 14,384 | -28% | 1 | 1 | 0% | 3,301 | 4,223 | +28% | 0 | 0 | — |
case-10 | pass→pass | 19,207 | 19,317 | +1% | 1 | 1 | 0% | 2,778 | 4,332 | +56% | 0 | 0 | — |
case-11 | pass→pass | 24,086 | 19,211 | -20% | 1 | 1 | 0% | 3,519 | 4,895 | +39% | 0 | 0 | — |
case-12 | pass→pass | 14,397 | 10,760 | -25% | 1 | 1 | 0% | 2,190 | 3,286 | +50% | 0 | 0 | — |
case-13 | pass→pass | 15,493 | 13,280 | -14% | 1 | 1 | 0% | 3,051 | 4,293 | +41% | 0 | 0 | — |
case-14 | pass→pass | 17,644 | 11,682 | -34% | 1 | 1 | 0% | 3,173 | 3,667 | +16% | 0 | 0 | — |
case-15 | pass→pass | 16,892 | 19,754 | +17% | 1 | 1 | 0% | 3,584 | 5,938 | +66% | 0 | 0 | — |
case-16 | pass→pass | 13,034 | 13,295 | +2% | 1 | 1 | 0% | 2,478 | 4,318 | +74% | 0 | 0 | — |
case-17 | pass→pass | 21,764 | 19,645 | -10% | 1 | 1 | 0% | 3,095 | 4,911 | +59% | 0 | 0 | — |
case-18 | pass→pass | 16,788 | 18,562 | +11% | 1 | 1 | 0% | 3,055 | 4,876 | +60% | 0 | 0 | — |
case-19 | fail→fail | 13,881 | 12,273 | -12% | 1 | 1 | 0% | 2,271 | 3,977 | +75% | 0 | 0 | — |
case-20 | pass→pass | 18,423 | 21,142 | +15% | 1 | 1 | 0% | 3,201 | 5,620 | +76% | 0 | 0 | — |
case-21 | pass→pass | 40,662 | 16,564 | -59% | 1 | 1 | 0% | 3,454 | 4,541 | +31% | 0 | 0 | — |
case-22 | pass→pass | 7,472 | 12,377 | +66% | 1 | 1 | 0% | 1,532 | 3,899 | +155% | 0 | 0 | — |
case-23 | pass→pass | 16,849 | 15,459 | -8% | 1 | 1 | 0% | 2,840 | 3,920 | +38% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.