Skip to main content
skill CX Codex

quantum-expert — Claude Code skill: Qiskit and quantum algorithms

quantum-expert gives the agent working knowledge of quantum circuits: Bell states, teleportation, Grover, VQE and Qiskit classifiers.

Apache-2.0 240 installs ★ 45 updated 2026-10-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add personamanagmentlayer/pcl --skill quantum-expert -a claude-code
Open on GitHub

What quantum-expert does

The skill hands the agent a reference on quantum computing: qubits, superposition, entanglement, measurement, and the usual gate set. Algorithms covered include Grover's search, Shor's factoring, QFT, VQE, QAOA and quantum machine learning. A separate section walks through hardware: superconducting qubits, ion traps, annealing, NISQ devices.

Most of the content is Qiskit code. You get ready functions for a Bell state and for teleportation, a GroverSearch class that builds the oracle and the diffuser separately and works out how many iterations to run, a VQESolver on a TwoLocal ansatz with SLSQP, and a starting point for a variational classifier with a feature map.

Permissions are narrow: Read, Write, Edit and Bash(python:*). Only python calls get through Bash, nothing else. The examples import qiskit and qiskit_machine_learning, so those packages have to sit in your environment.

What it helps with

  • build a Bell-state circuit and read counts off the simulator
  • lay out the teleportation protocol gate by gate
  • write the oracle and diffuser for a Grover search
  • pick an ansatz and optimiser for a VQE run on H2
  • explain where superconducting qubits differ from ion traps

Example prompts for the agent

  • Build a two-qubit Bell circuit and run it on qasm_simulator
  • Help me write the oracle and diffuser for a Grover search over the string 101
  • Estimate the ground state of H2 with VQE and a TwoLocal ansatz

How to install quantum-expert

1Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill quantum-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/quantum-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/quantum-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about quantum-expert

How do I install quantum-expert in Claude Code?

Run npx skills add personamanagmentlayer/pcl --skill quantum-expert -a claude-code. The skill lands at ~/.claude/skills/quantum-expert/SKILL.md.

What does quantum-expert do?

It gives the agent a quantum computing reference: qubit mechanics, algorithms such as Grover and VQE, hardware notes, and runnable Qiskit examples.

What do I need to run the examples?

Python with qiskit and qiskit_machine_learning, since the code imports both. Bash access is limited to python calls.

Source text

SKILL.md · Apache-2.0
---
name: quantum-expert
version: 1.1.0
description: >-
  Expert-level quantum computing, Qiskit, quantum algorithms, and quantum information. Use
  when the user mentions quantum computing, Qiskit, quantum algorithms, or quantum
  information, or when the task involves Quantum Mechanics Basics, Quantum Hardware,
  Circuit Design, or Algorithm Implementation.
category: scientific
tags: [quantum-computing, qiskit, quantum-algorithms, quantum-information]
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(python:*)
---

# Quantum Computing Expert

Expert guidance for quantum computing, quantum algorithms, Qiskit programming, and quantum information theory.

## Core Concepts

### Quantum Mechanics Basics

- Qubits and superposition
- Quantum entanglement
- Quantum interference
- Measurement and collapse
- Quantum gates (Pauli, Hadamard, CNOT)
- Quantum circuits

### Quantum Algorithms

- Grover's search algorithm
- Shor's factoring algorithm
- Quantum Fourier Transform (QFT)
- Variational Quantum Eigensolver (VQE)
- Quantum Approximate Optimization Algorithm (QAOA)
- Quantum machine learning

### Quantum Hardware

- Superconducting qubits
- Ion trap quantum computers
- Quantum annealing
- Noise and error correction
- Quantum volume
- NISQ (Noisy Intermediate-Scale Quantum) devices

## Qiskit Programming

```python
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import Aer, execute, transpile
from qiskit.visualization import plot_histogram, plot_bloch_multivector
import numpy as np

# Basic Quantum Circuit
def create_bell_state():
    """Create Bell state (maximally entangled state)"""
    qc = QuantumCircuit(2, 2)

    # Create superposition on qubit 0
    qc.h(0)

    # Entangle qubits 0 and 1
    qc.cx(0, 1)

    # Measure both qubits
    qc.measure([0, 1], [0, 1])

    return qc

# Quantum Teleportation
def quantum_teleportation():
    """Implement quantum teleportation protocol"""
    qc = QuantumCircuit(3, 3)

    # Prepare state to teleport (qubit 0)
    qc.ry(np.pi/4, 0)

    # Create Bell pair between qubits 1 and 2
    qc.h(1)
    qc.cx(1, 2)

    # Bell measurement on qubits 0 and 1
    qc.cx(0, 1)
    qc.h(0)
    qc.measure([0, 1], [0, 1])

    # Apply corrections on qubit 2 based on measurement
    qc.cx(1, 2)
    qc.cz(0, 2)

    # Measure final state
    qc.measure(2, 2)

    return qc

# Grover's Search Algorithm
class GroverSearch:
    def __init__(self, n_qubits: int, marked_state: str):
        self.n_qubits = n_qubits
        self.marked_state = marked_state
        self.circuit = None

    def create_oracle(self):
        """Create oracle that marks the target state"""
        oracle = QuantumCircuit(self.n_qubits)

        # Mark the target state by flipping phase
        for i, bit in enumerate(reversed(self.marked_state)):
            if bit == '0':
                oracle.x(i)

        # Multi-controlled Z gate
        oracle.h(self.n_qubits - 1)
        oracle.mcx(list(range(self.n_qubits - 1)), self.n_qubits - 1)
        oracle.h(self.n_qubits - 1)

        # Uncompute
        for i, bit in enumerate(reversed(self.marked_state)):
            if bit == '0':
                oracle.x(i)

        return oracle

    def create_diffuser(self):
        """Create diffusion operator"""
        diffuser = QuantumCircuit(self.n_qubits)

        # Apply H gates
        diffuser.h(range(self.n_qubits))

        # Apply X gates
        diffuser.x(range(self.n_qubits))

        # Multi-controlled Z
        diffuser.h(self.n_qubits - 1)
        diffuser.mcx(list(range(self.n_qubits - 1)), self.n_qubits - 1)
        diffuser.h(self.n_qubits - 1)

        # Apply X gates
        diffuser.x(range(self.n_qubits))

        # Apply H gates
        diffuser.h(range(self.n_qubits))

        return diffuser

    def build_circuit(self):
        """Build complete Grover's algorithm circuit"""
        self.circuit = QuantumCircuit(self.n_qubits, self.n_qubits)

        # Initialize in superposition
        self.circuit.h(range(self.n_qubits))

        # Calculate optimal number of iterations
        n_iterations = int(np.pi / 4 * np.sqrt(2**self.n_qubits))

        oracle = self.create_oracle()
        diffuser = self.create_diffuser()

        # Apply Grover iteration
        for _ in range(n_iterations):
            self.circuit.compose(oracle, inplace=True)
            self.circuit.compose(diffuser, inplace=True)

        # Measure
        self.circuit.measure(range(self.n_qubits), range(self.n_qubits))

        return self.circuit

    def run(self, shots: int = 1024):
        """Execute circuit"""
        backend = Aer.get_backend('qasm_simulator')
        job = execute(self.circuit, backend, shots=shots)
        result = job.result()
        counts = result.get_counts()

        return counts
```

## Variational Quantum Eigensolver (VQE)

```python
from qiskit.algorithms import VQE
from qiskit.algorithms.optimizers import SLSQP
from qiskit.circuit.library import TwoLocal
from qiskit.primitives import Estimator
from qiskit.quantum_info import SparsePauliOp

class VQESolver:
    """Variational Quantum Eigensolver for finding ground state energy"""

    def __init__(self, hamiltonian: SparsePauliOp, n_qubits: int):
        self.hamiltonian = hamiltonian
        self.n_qubits = n_qubits

    def create_ansatz(self, reps: int = 2):
        """Create parameterized quantum circuit (ansatz)"""
        ansatz = TwoLocal(
            self.n_qubits,
            'ry',
            'cz',
            reps=reps,
            entanglement='linear'
        )
        return ansatz

    def run_vqe(self):
        """Run VQE algorithm"""
        ansatz = self.create_ansatz()
        optimizer = SLSQP(maxiter=100)
        estimator = Estimator()

        vqe = VQE(estimator, ansatz, optimizer)
        result = vqe.compute_minimum_eigenvalue(self.hamiltonian)

        return {
            "eigenvalue": result.eigenvalue,
            "optimal_parameters": result.optimal_parameters,
            "optimal_point": result.optimal_point,
            "cost_function_evals": result.cost_function_evals
        }

# Example: H2 molecule
def create_h2_hamiltonian():
    """Create Hamiltonian for H2 molecule"""
    # Simplified Hamiltonian
    hamiltonian = SparsePauliOp.from_list([
        ("II", -1.0523732),
        ("IZ", 0.39793742),
        ("ZI", -0.39793742),
        ("ZZ", -0.01128010),
        ("XX", 0.18093119)
    ])
    return hamiltonian
```

## Quantum Machine Learning

```python
from qiskit_machine_learning.algorithms import VQC
from qiskit_machine_learning.neural_networks import CircuitQNN
from qiskit.circuit import Parameter
import numpy as np

class QuantumClassifier:
    """Variational Quantum Classifier"""

    def __init__(self, n_features: int, n_classes: int):
        self.n_features = n_features
        self.n_classes = n_classes
        self.vqc = None

    def create_feature_map(self):
        """Create feature map to encode classical data"""
        qc = QuantumCircuit(self.n_features)

        for i in range(self.n_features):
            param = Parameter(f'x[{i}]')
            qc.ry(param, i)

        return qc

    def create_ansatz(self):
        """Create parameterized circuit"""
        ansatz = TwoLocal(
            self.n_features,
            ['ry', 'rz'],
            'cz',
            reps=2,
            entanglement='full'
        )
        return ansatz

    def train(self, X_train, y_train):
        """Train quantum classifier"""
        feature_map = self.create_feature_map()
        ansatz = self.create_ansatz()

        self.vqc = VQC(
            num_qubits=self.n_features,
            feature_map=feature_map,
            ansatz=ansatz,
            optimizer=SLSQP(maxiter=100)
        )

        self.vqc.fit(X_train, y_train)

    def predict(self, X_test):
        """Predict using trained model"""
        return self.vqc.predict(X_test)
```

## Best Practices

### Circuit Design

- Minimize circuit depth for NISQ devices
- Use native gates when possible
- Consider qubit connectivity
- Implement error mitigation
- Optimize transpilation
- Use efficient state preparation

### Algorithm Implementation

- Start with small quantum circuits
- Validate with classical simulation
- Use noise models for realistic testing
- Implement proper error handling
- Monitor quantum volume metrics
- Document quantum advantage claims

### Production Usage

- Use quantum cloud services (IBM, AWS Braket)
- Implement hybrid classical-quantum algorithms
- Cache quantum results when possible
- Monitor job queue times
- Handle quantum hardware limitations
- Plan for error correction overhead

## Anti-Patterns

❌ Deep circuits on NISQ devices
❌ Ignoring hardware connectivity
❌ No error mitigation
❌ Claiming quantum advantage without proof
❌ Not validating with simulation first
❌ Ignoring decoherence times
❌ Inefficient state preparation

## Resources

- Qiskit: https://qiskit.org/
- IBM Quantum: https://quantum-computing.ibm.com/
- Quantum Computing Stack Exchange: https://quantumcomputing.stackexchange.com/
- AWS Braket: https://aws.amazon.com/braket/

© personamanagmentlayer · Apache-2.0 · personamanagmentlayer/pcl

Similar skills

All skills for Science and research →

From the same set104

The whole set →
research-expert research-expert — a skill that hands the agent working Python for study design and statistics, plus guidance on writing the paper afterwards. CX Codex +1 256installs helm-expert helm-expert is a Claude Code skill for building Helm charts and managing Kubernetes releases. It activates for requests involving charts, templates, or deployments. CX Codex +1 251installs cpp-expert cpp-expert — an agent skill for C++20/23 work: STL, ownership, concurrency and CMake. Handy when the agent has to write or repair modern C++. CX Codex +1 250installs ai-engineer-expert The ai-engineer-expert skill covers LLM integration, RAG, and production AI systems. Use it when an agent needs to design or deploy AI features. CX Codex +1 242installs finops-expert The finops-expert skill helps analyze cloud spending and explore cost-saving options. Use it for AWS cost reviews, forecasts, and EC2 sizing recommendations. CX Codex +1 239installs snowflake-expert snowflake-expert — a skill that walks your agent through Snowflake warehouse sizing, clustering, streams and query tuning. CX Codex +1 239installs iot-expert iot-expert is a Claude Code skill for IoT architecture, MQTT, embedded firmware, and edge computing. It generates architecture guides and microcontroller code. CX Codex +1 239installs biological-expert biological-expert configures the coding agent for computational biology, genetics, and sequence analysis. It assists with DNA parsing, alignment, and variant annotation. CX Codex +1 235installs

Project sponsors

Companies that keep this analytics open