Skip to main content

Full Rust core quantum circuit simulator with Python bindings

Project description

panta-sim

풀 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

위 명령은 PyPI 에 wheel 이 등록된 이후 동작합니다. 아직 publish 전이라면 소스에서 빌드하세요:

# 사전 요구 사항: 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.0.tar.gz (17.0 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.0-cp313-cp313-win_amd64.whl (165.3 kB view details)

Uploaded CPython 3.13Windows x86-64

panta_sim-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (310.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

panta_sim-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (303.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

panta_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (265.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

panta_sim-0.1.0-cp312-cp312-win_amd64.whl (165.7 kB view details)

Uploaded CPython 3.12Windows x86-64

panta_sim-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

panta_sim-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (303.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

panta_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (265.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

panta_sim-0.1.0-cp311-cp311-win_amd64.whl (165.6 kB view details)

Uploaded CPython 3.11Windows x86-64

panta_sim-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

panta_sim-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

panta_sim-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (268.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

panta_sim-0.1.0-cp310-cp310-win_amd64.whl (165.7 kB view details)

Uploaded CPython 3.10Windows x86-64

panta_sim-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

panta_sim-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

panta_sim-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (269.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

panta_sim-0.1.0-cp39-cp39-win_amd64.whl (166.1 kB view details)

Uploaded CPython 3.9Windows x86-64

panta_sim-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (311.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

panta_sim-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (304.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

panta_sim-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (269.8 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for panta_sim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 593f16508409814cb3cca87459ba4914bfab55f06eb04eba76de30dc61bcaa9a
MD5 10180ec9e62086893d1ea0c4188370e9
BLAKE2b-256 c4b02229ea1a6dede251f13623be929cf734891415ffe3f43948a6b328a673fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8da7e125d37b889bcb67ceeed894c5385069dfbb91f5fda0dc424a88e35afaff
MD5 496636c44a5d5639b7427295260f72ed
BLAKE2b-256 93eafae29b4512666ec12a009f8af604fd1319d387f7850491c45bf269bceb8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9785e2bdb90ea784ffee58f6df219eb948d899f3dad02382f6415d8c3374ac1f
MD5 545759b9f7e1c803f867bf90d3bacae9
BLAKE2b-256 97d590357dc11bc20840e0d95ed1e664952d486f6fc99df9558e5df9289691bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ce1e048ba0e2669e4e96b856df9766d85b95cedf879bfc0c4a806e9f8c8d0b8e
MD5 a793fc371d8972c9849318e3536e2afd
BLAKE2b-256 8097a8c6cb9c220130945c682db40777cce9cc78f7156f8f16ad34a3aa259f5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36a9085bf3e93bccd7b3726798eaf08206aaf8a1e10e05bf342a26925cdd4703
MD5 fba482e5d92bf0804cd75c11df15da92
BLAKE2b-256 e32541a9e6441959f21e69b44a290b4ec920c1d19fcafd33efb0636b26481f81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6f9f01e2a3ec8cf0f71beae9ffde0eb7984649e0e4010a8be3923036a1b3088d
MD5 b8e577bf657e1bbadd51b9b8d3fb3aff
BLAKE2b-256 bb36be5b55173bff4da1bec46545b4f7442131f2102d59c5e70ee794d4707e6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b608f2c93914779b97d2dc0d654e52484eb2662ff266a70f5750a00f344799bb
MD5 b37d2d0c2ad7b582cf8cbae971d1f9c6
BLAKE2b-256 8bd4947c806b6ad491c6ad90798f450f05f3ba01286e430bdeb95bb8910d037a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 83ebf0f5f21df69317f95fd0b92060476edb762ec53ea76cbe1a2d9595385235
MD5 b4f6006787a5daa504ce9d538f128225
BLAKE2b-256 931315ce5eaa5633491736e7611aa0c6ba553a23bafe61b577350c13f51baa6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58db24a4d632221e0a9443642f2184db75e6551607b63da8d937cca10e75f9e5
MD5 7c97f900520f0e4ca8c2a21fe1ba84d9
BLAKE2b-256 aedba724c72b72ec9c1081d12b1d5aeb9afa531c2e2ebc525ccc550a345ba732

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9606624312729b495aa4aa2c2f65ef3294d54343a80bef6968d0a7d4b50e4026
MD5 a2ef498bfc49bf70a2daf2e99111b494
BLAKE2b-256 dc5af3a1db23cee9e64ea24066dcb349cde7c6f512ec27914a9bda452308c6b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ff7d0be57e2decdeb227bc4c597d18cf8e767ee05b8551ee40a381a49d3ce6c
MD5 15e2ee962cc4f8835119af7d92d4aa83
BLAKE2b-256 59b4f2e5d904d2cf8acfcfe156ca92ee362db6edafbd8327f10e0a0c86cb5cb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 acbc7edb366e8bb44d895518b9a359fa854d1906092431cbe993d5a9bb009427
MD5 0f925886992e1107448f2f3da8844a4b
BLAKE2b-256 fc9e41ce703b8df61673157eaa98ff533aeba510ef20f65076212048bcc48770

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 123658b6afa743f95cbb2c8b3be12ec4242c0f68f2a0366051daa3a5797d87d9
MD5 8b3133759579e078467e52509c897121
BLAKE2b-256 f995af4b3cb2a68becdcb81b92c83ead7d908a170004bb4483d951fdd9da09bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e1be71e3afb4e117d3757d9d1b74a81e316e163e295d6d0853ee4d83b2674a16
MD5 c351e7e00e10897e0363f83ea390b3b1
BLAKE2b-256 a32c831e3707caf46b950b43af47f90a930b56c5bfdc845d4e7e1314c262dd90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c7c78647ec54faab30629fec9555701ecf897905394b0dc1cab027ca5e34d91
MD5 1c22ae04b551db2c8611ad852a5cd2fa
BLAKE2b-256 f5d5f9f06cb9110795986ad78bb92fa37cd79e65b1840101c3b626f3f07aad78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 26f2f694883910e11a2b1988512dfce89ef4591c7be02de447ad2ca9b5950982
MD5 3844108fc283904504f754a7f824d795
BLAKE2b-256 bf9797597a31b27a22ea84f9994588e4d6bba4cbcca9813709be48775969fa86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f776938d5217ed6b618da70dca064148618b9fce8ba7add80d5bda7840b82bc3
MD5 d7e2a579ae9038018c885855f412c13d
BLAKE2b-256 ff9ac6e6de5f31f793fe8fe85770b3a8eef9fce053823193b5b6e0086f8fde5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panta_sim-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 166.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.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5ddcb6a747c2dd0b96469fc28c3a10b49ba62cea7d35a510c008b2eec6ccdec3
MD5 24ded9ab43fab6aad686b225e8137f1e
BLAKE2b-256 52b7d7e3f36ac7a88de42b29b862ec5d93c3ef6c7a6c393bb908f022a382c312

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 463e872505250486e770101a193c07bb38934fc36e1ac4d5ceec13dd6fe11ac0
MD5 cd775df8f1dbf55499953f55888d3d37
BLAKE2b-256 0287c8358e499d3aa356a8f241ffe4003733ba87be36b9d32dc96f9ac4e66960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c4c584a21114cb05aefae2f83fea5bc11e88193ecb996ba7a90420b852aa5287
MD5 44eabdfef8ebb0388c9259bfcaf83b63
BLAKE2b-256 b5809326199e58550d737b2a19c829a91ecd8e432cdda46213c388b94cdaacf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for panta_sim-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 704a3d8131458d43eb5f886f7bdea482d5abf089503e95b5e4a14e7bc0b1973b
MD5 a2b9fa2d14efd7c3c2a22d37dffc9f62
BLAKE2b-256 0485029489f9fab4252754243f1480c566141e58b02b37822d926b811c12dca2

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