cirq
하는 일
Cirq는 양자 컴퓨터 프로그램을 만들고 테스트하는 도구입니다. 양자 회로를 만들고, 그것이 어떻게 작동할지 시뮬레이션하며, 특히 Google의 실제 양자 컴퓨터에서 실행할 수 있습니다.
사용하는 경우
- ✓Python으로 양자 회로를 만들고 테스트하고 싶을 때.
- ✓Google의 양자 하드웨어에서 실험을 실행해야 할 때.
- ✓오류를 포함해 양자 회로가 어떻게 행동할지 시뮬레이션하고 싶을 때.
스킬 링크
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/cirq/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“큐비트 두 개로 된 간단한 양자 회로를 만들고, 한 큐비트에 아다마르 게이트를, 두 큐비트 사이에 CNOT 게이트를 적용한 뒤 측정 결과를 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
Cirq를 사용하면 큐비트와 논리 게이트 같은 양자 컴퓨터의 기본 구성 요소를 정의할 수 있습니다. 이 구성 요소들을 회로로 조립하고, 시뮬레이터나 실제 하드웨어를 사용해 결과를 볼 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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 This Skill
Use this skill when:
- Building, simulating, or optimizing NISQ circuits in Python
- Running jobs on Google Quantum AI processors (via
cirq-google) or partner backends (IonQ, Azure Quantum, AQT, Pasqal) - Modeling noise, compiling to hardware gatesets, or designing characterization experiments
- Using parameter sweeps, transformers, or the ReCirq experiment patterns
For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.
Installation
Examples target Cirq 1.7.0 on Python 3.11+. Keep Cirq vendor packages on the matching release; independently versioned integrations such as Azure Quantum need their own compatibility check.
uv pip install "cirq-core==1.7.0"
# Optional OpenQASM import dependency
uv pip install ply
For hardware integration (pin matching versions for reproducibility):
# Google Quantum Engine (requires approved GCP project access)
uv pip install "cirq-google==1.7.0"
# IonQ
uv pip install "cirq-ionq==1.7.0"
# AQT (Alpine Quantum Technologies)
uv pip install "cirq-aqt==1.7.0"
# Pasqal
uv pip install "cirq-pasqal==1.7.0"
# Azure: use a SEPARATE environment; its current extras require Cirq <1.7.
uv pip install "qdk[azure,cirq]==1.32.3" "azure-quantum==3.13.0"
Pin all cirq-* packages in an environment to the same release. The Azure
example targets its supported Cirq 1.6.1 stack separately; do not force Cirq 1.7.0
into it. Cirq 1.7.0 updates the IonQ adapter to API v0.4.
Local examples were checked with synthetic circuits. Hardware examples are illustrative and were checked against released source and provider documentation, without submitting cloud jobs. See review evidence.
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(seed=42)
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
…
자주 묻는 질문
양자 회로란 무엇인가요?
양자 컴퓨터를 위한 프로그램과 같습니다. 큐비트(양자 정보의 기본 단위)와 양자 게이트(큐비트의 상태를 바꾸는 연산)로 구성됩니다.
어떤 양자 컴퓨터에서든 Cirq를 쓸 수 있나요?
Cirq는 Google의 하드웨어에 최적화되어 있지만, IonQ, Azure Quantum 같은 다른 제공업체에서도 쓸 수 있습니다. IBM 하드웨어에는 Qiskit을 쓰는 것이 가장 좋습니다.
잡음 시뮬레이션이란 무엇인가요?
양자 컴퓨터는 오류(잡음)에 민감합니다. Cirq의 잡음 시뮬레이션은 이런 오류가 회로 결과에 어떤 영향을 줄지 예측하도록 돕습니다.
상세 정보
작성자의 원본 설명
Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.
인기도
- GitHub 스타
- 51k
- 순위
- #3438
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
13c-metabolic-flux
51k탄소-13 동위원소 추적 데이터를 사용해 대사 흐름(플럭스)을 추정합니다. 세포 대사와 생화학 경로를 분석할 때 유용합니다.
adaptyv
51kAdaptyv API를 사용해 단백질 특성 분석 실험을 설계합니다. 비용을 추정하고, 서열을 제출하며, 실험실 결과를 확인하는 데 도움이 됩니다.
aeon
51k시계열 데이터에 대해 머신러닝 작업을 수행합니다. 순차 데이터를 분류하고, 예측하고, 이상을 탐지하고, 패턴을 찾을 때 유용합니다.
alphagenome
51k유전 변이에 대해 미리 계산된 게놈 영향을 조회합니다. 변이가 게놈에 주는 영향을 이해하도록 점수와 설명을 제공합니다.