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.1.1.tar.gz (17.2 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.1.1-cp313-cp313-win_amd64.whl (165.5 kB view details)

Uploaded CPython 3.13Windows x86-64

panta_sim-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

panta_sim-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (303.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

panta_sim-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (265.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

panta_sim-0.1.1-cp312-cp312-win_amd64.whl (165.8 kB view details)

Uploaded CPython 3.12Windows x86-64

panta_sim-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

panta_sim-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (303.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

panta_sim-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (266.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

panta_sim-0.1.1-cp311-cp311-win_amd64.whl (165.8 kB view details)

Uploaded CPython 3.11Windows x86-64

panta_sim-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

panta_sim-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

panta_sim-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (269.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

panta_sim-0.1.1-cp310-cp310-win_amd64.whl (165.9 kB view details)

Uploaded CPython 3.10Windows x86-64

panta_sim-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

panta_sim-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

panta_sim-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (269.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

panta_sim-0.1.1-cp39-cp39-win_amd64.whl (166.2 kB view details)

Uploaded CPython 3.9Windows x86-64

panta_sim-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

panta_sim-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

panta_sim-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (269.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for panta_sim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06922d63c1c1b4ea1cd252bb01a20d5a67b8d8b19b33d0dc9ffd4426bb9019b7
MD5 3a8a76cb7d47c5b477ed1e8c9c7ba1a1
BLAKE2b-256 a753c30545770447fc93bfec8828926737ce2a5f8edbc7867ba4fd5d21294591

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bb28cb61ebddb3db513797b89f2d26823e3fc6a59c2a60f6232b3cdc67b83c5f
MD5 bb4812b96b7249fc1beb8652f8763325
BLAKE2b-256 3b62810cbbac0eb0ae4d635e12a1bc5151f2ab7b58fd49a3022ef93ec5313e60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea7d33527eae203df421168a611fbcc4b5722e22f699ef925337539db39563d6
MD5 1f23f8bc2fa479414e41ed6d7bfc3683
BLAKE2b-256 b4296cff39d7bf405d75f596c1cd8ced28f1dd5720621bc3635057be41195a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e34f870fb4f4b3772b96840d1f570be6563e565b554f23c828a9217b7ecab4b2
MD5 a3030ac903da447f1d161719d3766aaa
BLAKE2b-256 706b4e18adcbd7d86349640e0de10d26007c0ce126ab331bf4e8dfe0b63c9e32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d34bc62e48a88d97198aa9fa948c6b1be7118172c89441cb34d6cef3b6a85bb6
MD5 ed1861b68b385df00cba3141e52ca455
BLAKE2b-256 1fb7c6ddf506d67dd613e5011fecdc6e1d74bd2cc1798b36d60d595b807ce0e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5452da999f3e2ae545676b75c776187045e326f7f1fbfcc8677196cdb6caf447
MD5 d1bf929898ae5fe6b198b6f4f8ac1471
BLAKE2b-256 adbdc10fb3a045f7f107b4512d6420301ad3641fb69841c0e5f2857e52ba3ea9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa55594cd86ce04a10cca3f815adc259c4e539e7aad1b68832b822a93199edcf
MD5 20c53d5e6b6a59ea572c4137288876cf
BLAKE2b-256 d7c2a843a9e77a15b012f3342e2378773c57dc4a923fb2d6443901c905086ea6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 49b134925fb078453e69e2bc5ea54fe40696fa9c4df625acb29e529e5d9734ae
MD5 59ed501545dba69813b6951e43da4ec4
BLAKE2b-256 b6ac4d3038a820fe81e819600070dc7420d99e670c5ba78555323710dfadc5ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b47822852d0730f807ccc06ec69027d9d6eff1bf8857c2b973a07724e462df58
MD5 525ba3d7abbecbf2899725ea7418c494
BLAKE2b-256 c8dc0707be0da83dd995e5e5eebb5e508c0e60441a075a199cdaf81b4ba71d7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7de620be150e1b2a53cc338f9f1c2ee301cf63fbe2b14fdfdc51e0c911522d38
MD5 24db8e1b62a8f89a6b29c348b9665fb4
BLAKE2b-256 49aa79b89b866ab60b79b991c1fb683890853167b4daacba3e4941b3a1ef6789

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64e66e3bfd9e43c3d8e6c61d91ac1eff2c3d6a5bd6350debdbba65d0e3058270
MD5 163c2ad3c7c3682a116eb1cfdeccd694
BLAKE2b-256 5c4a18cb3bfaf0b209773e56e42598a5716400bebcfefe827e9b370ffad13ea9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f7763b31b4acafdbec6847fa796158a0ac0e1ef1a93f54f348ae4e98d77ebfe7
MD5 97bffb9702c8f308c8257685547321d1
BLAKE2b-256 91edecac1558d26cd62829e597132bdec866b71c8d24d4c823545a1776019e0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6491f24f26cd86f6cb92dda0583fbc42617a8fe330f34c4f9584e529713aaa3
MD5 50f3e23c9e390e945b067e1beff504b1
BLAKE2b-256 2bf1c453dee3d87fe19ab0e85d83e637c822f7553765ff876ba3cdcfcca9ece6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 319c4af3a8590b3720ca1bf8cdfe7c12c41dcb51b27aeb1d7de1b8da0df581ad
MD5 0596ac175e36934e57d5238b3a15d08e
BLAKE2b-256 b552dd21ee7f5a011f962c01ebdf057f8ec9a8cbd51f6a8ca1cd27189a02432a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c97efa9a6b148c1afec97113ccad903a7aebad15523c5c7be9b2bf90e6676762
MD5 bcebb6ef9f718a050bd76aee3ef02fee
BLAKE2b-256 f02741f2c85e4f35620011d6950791ecd340c62ce60a7cc858e2fb27115eb807

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db1aa3a2a230e99d5363ecba002e4fa07d7444dd1aa2ce0fd1214492bebf19c0
MD5 e94c94ee493971c810812ad73c737c47
BLAKE2b-256 98bcd99eaffeb7e65a001e3a0278defc00d23404d627d42499e49e948a626209

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 535e871b786f713e0a2540202c03047140830e3a86f75eec90c1d07a656b9f22
MD5 d121ae53a4e8b1a9cd9d5101ad728149
BLAKE2b-256 4e5315853a5dc14dc72a1466dc36b68fc4cd064e0fdd54b08306477affc451d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panta_sim-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 166.2 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.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 efb5e99892b4815209860714f868d450fbf3e19c31711217b656cb9a4ea0fe3c
MD5 93c5b3cabe6059a85bddde3be4323683
BLAKE2b-256 56e3c7bb507bed85bf59e08949c9b0ee48327ccc488555ac691bce3f09cc25ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f554f95be91293b6788a2490f943de5e56d27711e27fae57728b0d08bd6171d7
MD5 a629ea6cd36628df670466524bb43127
BLAKE2b-256 f117351be1b392bf41478e2d201283f816fc9704f0f57556d26c17a919a9f3be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4b60d4569307c35be4730e0a943fcbe0c92086968dc96fe4d8e2485eb6a4c1fd
MD5 696cd9649f33442bf3b00da5f6014cca
BLAKE2b-256 d6e9b98e5dbae51a0b8e78ca2876e4bc9f4fc480e1a148c9566264b61a152dc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0b43011641c7676021de0f318946167603ad70b3fe0ae4b90d3930dec6527d4
MD5 d654e18c1207fa8a4218430f7ad258ec
BLAKE2b-256 a3c1742b56e19ebaeb0bd31d89b96a3493aaa474371a295ab93cd4b246a4f565

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