cirq
Skill này làm gì
Cirq là công cụ để tạo, mô phỏng và chạy chương trình trên máy tính lượng tử. Nó cho phép bạn xây dựng chuỗi các phép toán lượng tử, gọi là mạch (circuit), và xem chúng hoạt động ra sao.
Khi nào nên dùng
- ✓Khi bạn muốn thử nghiệm với điện toán lượng tử.
- ✓Khi đang học về mạch lượng tử.
- ✓Để kiểm tra ý tưởng thuật toán lượng tử.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cirq/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một mạch lượng tử đơn giản với hai phép toán rồi mô phỏng nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn viết mã Python để định nghĩa các qubit (đơn vị cơ bản của thông tin lượng tử) và các phép toán bạn muốn áp dụng cho chúng. Sau đó, bạn có thể chạy mạch này trên một trình mô phỏng hoặc một máy tính lượng tử thật.
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.
Bundled upstream support
Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.
Cirq - Quantum Computing with Python
Cirq is Google Quantum AI's open-source framework for designing, simulating, and running quantum circuits on quantum computers and simulators.
When to Use
- You are designing, simulating, or executing quantum circuits with the Cirq ecosystem.
- You need Google Quantum AI-style primitives, parameterized circuits, or integrations like
cirq-googleandcirq-ionq. - You are prototyping or teaching quantum workflows in Python and want concrete circuit examples.
Installation
uv pip install cirq
For hardware integration:
# Google Quantum Engine
uv pip install cirq-google
# IonQ
uv pip install cirq-ionq
# AQT (Alpine Quantum Technologies)
uv pip install cirq-aqt
# Pasqal
uv pip install cirq-pasqal
# Azure Quantum
uv pip install azure-quantum cirq
Quick Start
Basic Circuit
import cirq
import numpy as np
# Create qubits
q0, q1 = cirq.LineQubit.range(2)
# Build circuit
circuit = cirq.Circuit(
cirq.H(q0), # Hadamard on q0
cirq.CNOT(q0, q1), # CNOT with q0 control, q1 target
cirq.measure(q0, q1, key='result')
)
print(circuit)
# Simulate
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=1000)
# Display results
print(result.histogram(key='result'))
Parameterized Circuit
import sympy
# Define symbolic parameter
theta = sympy.Symbol('theta')
# Create parameterized circuit
circuit = cirq.Circuit(
cirq.ry(theta)(q0),
cirq.measure(q0, key='m')
)
# Sweep over parameter values
sweep = cirq.Linspace('theta', start=0, stop=2*np.pi, length=20)
results = simulator.run_sweep(circuit, params=sweep, repetitions=1000)
# Process results
for params, result in zip(sweep, results):
theta_val = params['theta']
counts = result.histogram(key='m')
print(f"θ={theta_val:.2f}: {counts}")
Core Capabilities
Circuit Building
For comprehensive information about building quantum circuits, including qubits, gates, operations, custom gates, and circuit patterns, see:
- references/building.md - Complete guide to circuit construction
Common topics:
- Qubit types (GridQubit, LineQubit, NamedQubit)
- Single and two-qubit gates
- Parameterized gates and operations
- Custom gate decomposition
- Circuit organization with moments
- Standard circuit patterns (Bell states, GHZ, QFT)
- Import/export (OpenQASM, JSON)
- Working with qudits and observables
Simulation
For detailed information about simulating quantum circuits, including exact simulation, noisy simulation, parameter sweeps, and the Quantum Virtual Machine, see:
- references/simulation.md - Complete guide to quantum simulation
Common topics:
- Exact simulation (state vector, density matrix)
- Sampling and measurements
- Parameter sweeps (single and multiple parameters)
- Noisy simulation
- State histograms and visualization
- Quantum Virtual Machine (QVM)
- Expectation values and observables
- Performance optimization
Circuit Transformation
For information about optimizing, compiling, and manipulating quantum circuits, see:
- references/transformation.md - Complete guide to circuit transformations
Common topics:
- Transformer framework
- Gate decomposition
- Circuit optimization (merge gates, eject Z gates, drop negligible operations)
- Circuit compilation for hardware
- Qubit routing and SWAP insertion
- Custom transformers
- Transformation pipelines
Hardware Integration
For information about running circuits on real quantum hardware from various providers, see:
- references/hardware.md - Complete guide to hardware integration
Supported providers:
- Google Quantum AI (cirq-google) - Sycamore, Weber processors
- IonQ (cirq-ionq) - Trapped ion quantum computers
- Azure Quantum (azure-quantum) - IonQ and Honeywell backends
- AQT (cirq-aqt) - Alpine Quantum Technologies
- Pasqal (cirq-pasqal) - Neutral atom quantum computers
Topics include device representation, qubit selection, authentication, job management, and circuit optimization for hardware.
Noise Modeling
For information about modeling noise, noisy simulation, characterization, and error mitigation, see:
- references/noise.md - Complete guide to noise modeling
Common topics:
…
Câu hỏi thường gặp
Qubit là gì?
Qubit giống như các “bit” trong máy tính thông thường, nhưng có thể là 0, 1 hoặc kết hợp của cả hai cùng lúc, giúp xử lý nhiều thông tin hơn.
Mạch lượng tử là gì?
Đó là chuỗi các chỉ dẫn cho máy tính lượng tử biết cần áp dụng phép toán nào lên các qubit để thực hiện một phép tính.
Tôi có chạy được trên máy tính của mình không?
Bạn có thể mô phỏng mạch lượng tử trên máy tính bằng Cirq, nhưng để chạy trên một máy tính lượng tử thật, bạn cần có quyền truy cập vào một máy như vậy.
Chi tiết
Mô tả gốc của tác giả
Cirq is Google Quantum AI's open-source framework for designing, simulating, and running quantum circuits on quantum computers and simulators.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4134
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.