본문으로 건너뛰기
Skillpedia
에이전트51k · #3551

qiskit

하는 일

Qiskit은 양자 컴퓨터에서 실행할 프로그램을 만들고 실행하는 도구입니다. 양자 회로를 만들고, 실제로 어떻게 작동할지 시뮬레이션하며, 실제 장비에 보내 실행할 수 있습니다.

사용하는 경우

  • ✓로컬에서 양자 컴퓨팅 아이디어를 시험하고 싶을 때.
  • ✓IBM 양자 컴퓨터에 실험을 준비하고 제출할 때.
  • ✓시뮬레이션이나 하드웨어 실행이 필요한 양자 알고리즘을 개발할 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/qiskit/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/qiskit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“큐비트 두 개로 된 간단한 양자 회로를 만들고, 첫 번째 큐비트에 H 게이트를 적용하고 두 큐비트 사이에 CX 게이트를 넣은 뒤 결과를 시뮬레이션해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Qiskit은 사용자의 지시를 양자 컴퓨터가 이해하는 양자 연산으로 번역해 작동합니다. 일반 컴퓨터에서 이 연산을 시뮬레이션하거나 실제 양자 프로세서로 보낼 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Qiskit

Use current Qiskit 2.x APIs to build circuits, prepare hardware-compatible instruction set architecture (ISA) circuits, and execute them through V2 primitives.

Reviewed 2026-10-01 with local tests on qiskit==2.5.2, qiskit-ibm-runtime==0.50.0, and qiskit-aer==0.17.2. IBM account, QPU, session, and batch examples are illustrative and documentation/source-checked; no remote workloads were submitted. See references/sources.md for the verification boundary.

Runtime 0.50 deprecates the top-level SamplerV2/EstimatorV2 implementations. New code imports Sampler from qiskit_ibm_runtime.executor_sampler and Estimator from qiskit_ibm_runtime.executor_estimator. These still implement the V2 PUB interface, using client-side processing and Executor. Use option models from qiskit_ibm_runtime.options_models.

Choose the Right Path

Goal Recommended interface
Ideal evolution with finite-shot sampling qiskit.primitives.StatevectorSampler
Exact local expectation values qiskit.primitives.StatevectorEstimator
High-performance or noisy simulation Qiskit Aer
IBM QPU sampling qiskit_ibm_runtime.executor_sampler.Sampler
IBM QPU expectation values and mitigation qiskit_ibm_runtime.executor_estimator.Estimator
Backend without native primitives BackendSamplerV2 or BackendEstimatorV2
Open-system or master-equation dynamics Prefer QuTiP
Differentiable quantum machine learning Prefer PennyLane unless Qiskit integration is required

Installation

Create an isolated environment and install only the components needed:

uv venv --python 3.13
source .venv/bin/activate

# Core SDK plus plotting support
uv pip install "qiskit[visualization]==2.5.2"

# Add only when needed
uv pip install "qiskit-ibm-runtime==0.50.0"
uv pip install "qiskit-aer==0.17.2"

Do not install qiskit-terra; it was superseded by the qiskit distribution. Qiskit Runtime, Aer, Nature, Machine Learning, Optimization, and Algorithms are separate distributions.

For IBM account setup, CI-safe credential handling, optional packages, and environment repair, read references/setup.md.

Core Workflow

Follow this sequence for every hardware-oriented workload:

  1. Map the problem to a circuit and, for Estimator, one or more observables.
  2. Optimize the parameterized circuit once for the selected backend.
  3. Apply the layout to every observable.
  4. Execute ISA circuits through a V2 primitive using Primitive Unified Blocs (PUBs).
  5. Analyze register-aware results, metadata, uncertainty, and resource usage.

Do not bind and retranspile a parameterized circuit inside every optimizer iteration. Transpile the parameterized circuit once, then pass parameter arrays in PUBs.

Quick Local Sampling

from qiskit import QuantumCircuit
from qiskit.primitives import StatevectorSampler

circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure_all()  # creates the classical register named "meas"

sampler = StatevectorSampler(seed=7)
pub_result = sampler.run([circuit], shots=1024).result()[0]
counts = pub_result.data.meas.get_counts()
print(counts)

Sampler V2 preserves shots and classical-register structure. Access the register by its actual name; measure_all() uses meas.

For circuits with multiple classical registers, each register’s counts are a marginal distribution. Preserve shot alignment when computing cross-register correlations; multiplying marginal frequencies destroys those correlations. Use SamplerPubResult.join_data with an explicit register order for joint bitstrings and record that order in the result labels. Qiskit 2.5.2 puts the first joined BitArray register in the least-significant bits, contrary to the current docstring; verify with an asymmetric state. See references/primitives.md.

Quick Local Estimation

import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit import Parameter
from qiskit.primitives import StatevectorEstimator
from qiskit.quantum_info import SparsePauliOp

theta = Parameter("theta")
circuit = QuantumCircuit(2)
circuit.ry(theta, 0)
circuit.cx(0, 1)

observable = SparsePauliOp.from_list([("ZZ", 1.0), ("XX", 0.5)])
parameter_values = [[0.0], [np.pi / 4], [np.pi / 2]]

estimator = StatevectorEstimator(seed=7)
pub = (circuit, observable, parameter_values)

…
자주 묻는 질문

Qiskit의 ‘프리미티브(primitives)’란 무엇인가요?

양자 시뮬레이터와 하드웨어를 더 쉽게 다루도록 해 주는 기본 구성 요소입니다. 예를 들어 샘플링 결과나 기댓값을 얻을 수 있습니다.

‘트랜스파일레이션(transpilation)’이란 무엇인가요?

사용하는 특정 양자 하드웨어에서 효율적으로 실행되도록 양자 회로를 최적화하는 과정입니다.

제 컴퓨터에서 Qiskit을 쓸 수 있나요?

네, 실제 양자 컴퓨터 없이도 로컬에서 양자 회로를 시뮬레이션할 수 있습니다.

상세 정보

작성자의 원본 설명

Builds, simulates, transpiles, and executes quantum circuits with Qiskit and IBM Quantum Runtime. Use for Qiskit 2.x circuits and operators, V2 Sampler or Estimator primitives, target-aware transpilation, local or noisy simulation, IBM QPU execution, Runtime sessions or batches, error mitigation, and Qiskit ecosystem packages.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3551
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬