Skip to main content

Full Rust core quantum circuit simulator with Python bindings

Project description

panta-sim

PyPI Python CI License: MIT

풀 Rust 코어 + Python 바인딩으로 작성한 양자 회로 시뮬레이터. Full state vector 방식으로 20~25큐비트 회로를 정확히 시뮬레이션 한다.

  • Rust 코어: num-complex 기반 상태 벡터, qubit-wise multiplication
  • Python API: PyO3 + maturin, NumPy 연동
  • 검증: 100+ pytest + Qiskit statevector 교차검증 (오차 < 1e-10)

설치

pip install panta-sim

Linux (x86_64, aarch64) / macOS (Apple Silicon) / Windows (x64) 에서 Python 3.9~3.13 미리 빌드된 wheel 을 제공한다. Rust toolchain 은 필요 없다.

소스에서 직접 빌드하려면:

# 사전 요구 사항: Rust toolchain (rustup), Python >= 3.9, maturin
pip install maturin
git clone https://github.com/quantumfia/quantum-sim
cd quantum-sim
maturin develop --release   # 또는 pip install .

빠른 시작

from panta_sim import QuantumCircuit

# Bell state |Φ+⟩ = (|00⟩ + |11⟩)/√2
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

result = qc.run(shots=1024, seed=42)
print(result.counts())          # {'00': ~512, '11': ~512}
print(result.statevector())     # [0.707+0j, 0+0j, 0+0j, 0.707+0j]
print(result.probabilities())   # [0.5, 0, 0, 0.5]

QuantumCircuit 의 게이트 메서드는 모두 self 를 반환하므로 메서드 체이닝도 가능하다:

counts = (
    QuantumCircuit(3)
    .h(0)
    .cx(0, 1)
    .cx(0, 2)
    .measure_all()
    .run(shots=1024, seed=0)
    .counts()
)

pip install panta-sim (배포 이름) → import panta_sim (Python 모듈 이름).

지원 게이트

분류 게이트 메서드
단일 큐비트 Hadamard h(q)
단일 큐비트 Pauli-X / Y / Z x(q), y(q), z(q)
단일 큐비트 Phase / T s(q), t(q)
단일 큐비트 Identity id(q)
회전 Rx / Ry / Rz rx(theta, q), ry(theta, q), rz(theta, q)
2큐비트 CNOT / CZ / SWAP cx(c, t), cz(a, b), swap(a, b)
3큐비트 Toffoli (CCX) ccx(c1, c2, t)
3큐비트 Fredkin (CSWAP) cswap(c, t1, t2)
측정 부분 / 전체 측정 measure(q, c), measure_all()

비트 순서 규약은 Qiskit 과 동일한 little-endian 이다 (q_{n-1} … q_1 q_0). counts() 의 키는 MSB-first 비트 문자열, statevector 의 인덱스는 동일한 비트열을 정수로 해석한 값이다.

빌드 / 테스트

cargo build --release          # Rust 전체 빌드
cargo test                     # Rust 유닛 테스트 (core + simulator)
maturin develop --release      # Python 바인딩 빌드 (개발 모드)
pytest tests/                  # Python 통합 테스트 + Qiskit 교차검증
pytest tests/ -v               # 상세 출력

Qiskit 교차검증 테스트는 qiskit 패키지가 설치되어 있을 때만 실행되며, 설치되어 있지 않으면 자동으로 skip 된다.

예제

examples/ 디렉터리 참고:

  • bell_state.py — Bell 상태 생성 및 측정
  • grover.py — 2큐비트 Grover 탐색
  • qft.py — Quantum Fourier Transform
python examples/bell_state.py
python examples/grover.py
python examples/qft.py

프로젝트 구조

quantum-sim/
├── crates/
│   ├── core/              상태 벡터, 게이트 행렬, 복소수 연산
│   ├── simulator/         시뮬레이션 엔진, 측정, 회로 실행기
│   └── python-binding/    PyO3 바인딩
├── python/panta_sim/      사용자용 Python 라이브러리
├── tests/                 pytest 통합 테스트
├── examples/              사용 예제
└── docs/                  설계 문서 (plan.md, architecture.md, references.md)

5월 스코프 밖 (현재 미구현)

트랜스파일러, 노이즈 모델, OpenQASM 파싱, GPU/멀티스레딩 가속, 회로 시각화, tensor network/MPS, 실제 QPU 연동.

참고 자료

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panta_sim-0.2.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

panta_sim-0.2.0-cp313-cp313-win_amd64.whl (220.0 kB view details)

Uploaded CPython 3.13Windows x86-64

panta_sim-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (385.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

panta_sim-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

panta_sim-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (328.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

panta_sim-0.2.0-cp312-cp312-win_amd64.whl (220.3 kB view details)

Uploaded CPython 3.12Windows x86-64

panta_sim-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

panta_sim-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

panta_sim-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (328.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

panta_sim-0.2.0-cp311-cp311-win_amd64.whl (219.8 kB view details)

Uploaded CPython 3.11Windows x86-64

panta_sim-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

panta_sim-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

panta_sim-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (330.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

panta_sim-0.2.0-cp310-cp310-win_amd64.whl (219.9 kB view details)

Uploaded CPython 3.10Windows x86-64

panta_sim-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (386.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

panta_sim-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

panta_sim-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (331.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

panta_sim-0.2.0-cp39-cp39-win_amd64.whl (220.1 kB view details)

Uploaded CPython 3.9Windows x86-64

panta_sim-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (387.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

panta_sim-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

panta_sim-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (332.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file panta_sim-0.2.0.tar.gz.

File metadata

  • Download URL: panta_sim-0.2.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for panta_sim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aff1a1e8455b811924fe2ccfe615359ec1371bacc6821a8b170e1f29f706c7e1
MD5 f80dfc47eacbcccc1ce61df254988d63
BLAKE2b-256 17c9c61becb8f0e0073b3013c0404732f83c467d7dbfc305397a6e98a77715da

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 47056a320eb6b2c05da72e076635288a79c5c3cf12f3993349ce2083b43a3ff0
MD5 93b73a187440eaebc865307fee77ee7b
BLAKE2b-256 48859a544b2fd10be9565da514aa539902ff74275eb43cc8428aa83d129e8d39

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4eeb9bf365c1a486e7ddc079f0c96487cab9080494c4dfaf9736e8b62f96ea9f
MD5 e6868f3a454af848671e393c29c8d06c
BLAKE2b-256 14cb1d58c46dd7ada3e5733f9acbe1a5585699746c7ac8ade12f32615f61dd16

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 70174e6be7c6b437c9442cbe30bcf3929a2a13b6bae372683d500993a24068d8
MD5 cf5ea750aeda4498853e92ee8ebbbfd7
BLAKE2b-256 f6fc943771536bcca3222996a52c40e07d74d976d15e224a41a9c526eb0cebf9

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b6f8467cb812606ec02ebe80d8aeed80d2f067c0e7ce1f0e846ce3e4dd6f6ff
MD5 82fc84cc89e9030b22fe08e1406706b9
BLAKE2b-256 a38bfd36a532d96a679e9dc40b807d391734f1494855594cd21d0bfe44259643

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 237f5fd0408b348647e759830845cc232cb9e414ee2d17955d96fa56cad3ddd5
MD5 c78e2147467d40640ccd26e84e5c1a34
BLAKE2b-256 22c686ce0375e5fe6130e5a97f2b322fa826203dd52ce983a92c116e8c7e8fd0

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15bc4d66c3cca96b941f54fe06cafdfb3421356aba4b6967549e9b14882cccb5
MD5 f323517c89881bafe7e59babf7c2fff8
BLAKE2b-256 d48dd54add2196a39953be35f2783c262109c07a5476a61846ec90b923e4db0f

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 519f34b1c4de7945f90e11fa8212c093f90870bd1d0dff72a7475161b579a51b
MD5 cb2cd1bf8f9903a0e4d8b2530b31ae36
BLAKE2b-256 8eda856b8b1e3df4c3d0413fc4433ec856e149bd8ae073dd90460552b2d2d7fe

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f1da446f436c641fab3462f4dace52037fa2ab5eec869d84c99b39abdaf788e
MD5 b0505ba3454705f9e729f2a77a2e0325
BLAKE2b-256 0370d8f096a5444052b463a0a9d88c348c8bc110d6dbee1b2803a55f38e24430

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9742fad6af5ac8b1b7c38ce819873066abaeedaf814028484f5f7e57298a39e3
MD5 0f9c7666ad63a2cd37a100558ce75567
BLAKE2b-256 e6cfe9688f64cf2a74b2402faee81d1fa89fdb93002db5d1cabde278cbd13fa5

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2310ce52539928678d7a5faf74ea16f2de316eb96b2b5426992e51d34d3b33fa
MD5 96d7c9aede01815089b720f17759c16e
BLAKE2b-256 e2d16f7131388666a13eb0714897619ac5ce63e7c859d81e58bd8c670cd3d48e

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7cdc8cebc3c6f70d90eb9254246705b6e79c3b1540da45c2ee6dc5b861893870
MD5 9a637a225c8f7e006bca0accfb943e08
BLAKE2b-256 9d394c36d877f0fb5e5c92b7b0b52b0ebb882e57e998e8a8ec21f937192a7a70

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4ef844f0d4b11bf97afd9f67742e2f7c53615d3383a956fad02a352241719fc
MD5 774f8ecd1fea69481e76f39d9b077c9c
BLAKE2b-256 9d7afabff7d6337872f291cb184441707c806ffa00a353659c82ffdd3fbf9c76

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 50c792f10af5fcc2d62792a4ce8231228f94af9dd53a31c153aca01947c79368
MD5 84b26b37033375284ed795d695f83c1a
BLAKE2b-256 edbe9695a75df4ad62891b877da9243d8c7dfd6680503acf14d02e3b04e455be

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 484717e7f1a3d560d787f1681604c6cc9d345328b6991e1caff7467304823d80
MD5 7986b987ddf40dab991b2928fdc987d2
BLAKE2b-256 fe6d98de1aa5e51ae3305242aa3e85e3e08a2c855a7b97ff6ba1670e32e63cbe

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 327ce32927b44c6459aa1c510d78f8d54677391fa030510d029315d034958b2f
MD5 05f3e9775a60ae3b2a42f23b41b446a6
BLAKE2b-256 b1abb2cf9d9afb43eefe382409166a1654c1dd65e1763a9d7a73d728aea68ae6

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b043bed2699945173e37aee7ac36e88148c2d3d1b8506628a75be0758e5ed10a
MD5 44d01cb2aca55ef363770639b5a3ae13
BLAKE2b-256 6da6cfa5d495881997874838da878988da4e88b3d2d6b991effd368971e31fee

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: panta_sim-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 220.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for panta_sim-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6a91bde764452f688029b22a43674378f4c851813bb7e82e64bd23b660bb7ce2
MD5 12d6472388122d27dee0a24283a2b9a6
BLAKE2b-256 d6cda452201b9a35e7045674b5c49b5508b28b1308a6c14459837aeb312589eb

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 910202df8572d0ee3b0dc0e32967535e13cd0c227e917930893e6806082adf29
MD5 e209ae181d8eac0dc9eb144c291a3ab5
BLAKE2b-256 3d16257dfa73c7032530721a42344e9567bb76a70acf31aa8e27436de201d04a

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c6a9fcadd56bdfe14a48fc24d30c178333faf0c83aa34ea3550414baaa1b6c1e
MD5 365a9642dffbbd8c75f63c4cf8939644
BLAKE2b-256 ca15dcaa19935a12499d8004bbbb7abc41efd7b7e61bcf70dff7a0df68776255

See more details on using hashes here.

File details

Details for the file panta_sim-0.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for panta_sim-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb9e4d61b700315210029b95d67cf848bf0b25ad4615c967397b3d3e950ce8e0
MD5 fa688eab46e5333429859ec7867e287b
BLAKE2b-256 6d4f7daa3e859ad64572a343b507bba705145efd6af25fdab2095ae5abd4e716

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page