Chuyển đến nội dung
Skillpedia
Lập trình chung33k · #9012

qiskit

Skill này làm gì

Skill này cho agent của bạn Qiskit, một framework mã nguồn mở về điện toán lượng tử của IBM. Nó bao gồm mạch, thuật toán và chạy tác vụ trên phần cứng. Skill dành cho lập trình viên và nhà nghiên cứu học hoặc dùng điện toán lượng tử.

Khi nào nên dùng

  • ✓Khi bạn muốn xây dựng một mạch lượng tử với cổng và phép đo.
  • ✓Khi bạn cần chạy một thuật toán lượng tử như VQE, QAOA hoặc tìm kiếm Grover.
  • ✓Khi bạn muốn tối ưu một mạch cho một thiết bị lượng tử cụ thể.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/qiskit/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/qiskit/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Xây dựng mạch tìm kiếm Grover bằng Qiskit cho bài toán ba qubit, chạy trên máy mô phỏng, và vẽ kết quả.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent viết code Qiskit để xây dựng mạch, biên dịch lại mạch cho thiết bị mục tiêu, rồi chạy trên máy mô phỏng hoặc backend đám mây. Sau đó nó hiển thị kết quả đo được.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Qiskit

Overview

Qiskit is the world's most popular open-source quantum computing framework with 13M+ downloads. Build quantum circuits, optimize for hardware, execute on simulators or real quantum computers, and analyze results. Supports IBM Quantum (100+ qubit systems), IonQ, Amazon Braket, and other providers.

Key Features:

  • 83x faster transpilation than competitors
  • 29% fewer two-qubit gates in optimized circuits
  • Backend-agnostic execution (local simulators or cloud hardware)
  • Comprehensive algorithm libraries for optimization, chemistry, and ML

Quick Start

Installation

uv pip install qiskit
uv pip install "qiskit[visualization]" matplotlib

First Circuit

from qiskit import QuantumCircuit
from qiskit.primitives import StatevectorSampler

# Create Bell state (entangled qubits)
qc = QuantumCircuit(2)
qc.h(0)           # Hadamard on qubit 0
qc.cx(0, 1)       # CNOT from qubit 0 to 1
qc.measure_all()  # Measure both qubits

# Run locally
sampler = StatevectorSampler()
result = sampler.run([qc], shots=1024).result()
counts = result[0].data.meas.get_counts()
print(counts)  # {'00': ~512, '11': ~512}

Visualization

from qiskit.visualization import plot_histogram

qc.draw('mpl')           # Circuit diagram
plot_histogram(counts)   # Results histogram

Core Capabilities

1. Setup and Installation

For detailed installation, authentication, and IBM Quantum account setup:

  • See references/setup.md

Topics covered:

  • Installation with uv
  • Python environment setup
  • IBM Quantum account and API token configuration
  • Local vs. cloud execution

2. Building Quantum Circuits

For constructing quantum circuits with gates, measurements, and composition:

  • See references/circuits.md

Topics covered:

  • Creating circuits with QuantumCircuit
  • Single-qubit gates (H, X, Y, Z, rotations, phase gates)
  • Multi-qubit gates (CNOT, SWAP, Toffoli)
  • Measurements and barriers
  • Circuit composition and properties
  • Parameterized circuits for variational algorithms

3. Primitives (Sampler and Estimator)

For executing quantum circuits and computing results:

  • See references/primitives.md

Topics covered:

  • Sampler: Get bitstring measurements and probability distributions
  • Estimator: Compute expectation values of observables
  • V2 interface (StatevectorSampler, StatevectorEstimator)
  • IBM Quantum Runtime primitives for hardware
  • Sessions and Batch modes
  • Parameter binding

4. Transpilation and Optimization

For optimizing circuits and preparing for hardware execution:

  • See references/transpilation.md

Topics covered:

  • Why transpilation is necessary
  • Optimization levels (0-3)
  • Six transpilation stages (init, layout, routing, translation, optimization, scheduling)
  • Advanced features (virtual permutation elision, gate cancellation)
  • Common parameters (initial_layout, approximation_degree, seed)
  • Best practices for efficient circuits

5. Visualization

For displaying circuits, results, and quantum states:

  • See references/visualization.md

Topics covered:

  • Circuit drawings (text, matplotlib, LaTeX)
  • Result histograms
  • Quantum state visualization (Bloch sphere, state city, QSphere)
  • Backend topology and error maps
  • Customization and styling
  • Saving publication-quality figures

6. Hardware Backends

For running on simulators and real quantum computers:

  • See references/backends.md

Topics covered:

  • IBM Quantum backends and authentication
  • Backend properties and status
  • Running on real hardware with Runtime primitives
  • Job management and queuing
  • Session mode (iterative algorithms)
  • Batch mode (parallel jobs)
  • Local simulators (StatevectorSampler, Aer)
  • Third-party providers (IonQ, Amazon Braket)
  • Error mitigation strategies

7. Qiskit Patterns Workflow

For implementing the four-step quantum computing workflow:

  • See references/patterns.md

Topics covered:

  • Map: Translate problems to quantum circuits
  • Optimize: Transpile for hardware
  • Execute: Run with primitives
  • Post-process: Extract and analyze results
  • Complete VQE example
  • Session vs. Batch execution
  • Common workflow patterns

8. Quantum Algorithms and Applications

For implementing specific quantum algorithms:

  • See references/algorithms.md

Topics covered:

  • Optimization: VQE, QAOA, Grover's algorithm
  • Chemistry: Molecular ground states, excited states, Hamiltonians
  • **Machine Learnin
Câu hỏi thường gặp

Tôi có cần máy tính lượng tử thật không?

Không. Skill bao gồm máy mô phỏng cục bộ, nên mạch có thể chạy mà không cần phần cứng.

Biên dịch lại mạch (transpiling) là gì?

Đó là bước viết lại mạch để nó khớp với các cổng và bố cục của một thiết bị cụ thể.

Những nhà cung cấp nào được hỗ trợ?

Skill đề cập đến IBM Quantum, IonQ và Amazon Braket, cùng các nhà cung cấp khác.

Chi tiết

Mô tả gốc của tác giả

Comprehensive quantum computing toolkit for building, optimizing, and executing quantum circuits. Use when working with quantum algorithms, simulations, or quantum hardware including (1) Building quantum circuits with gates and measurements, (2) Running quantum algorithms (VQE, QAOA, Grover), (3) Transpiling/optimizing circuits for hardware, (4) Executing on IBM Quantum or other providers, (5) Quantum chemistry and materials science, (6) Quantum machine learning, (7) Visualizing circuits and results, or (8) Any quantum computing development task.

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#9012
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự