Skip to main content

Sample lossy quantum error correction code.

Project description

Simulations of QEC codes with loss

Python package for sampling and decoding quantum error correction circuits with photon loss.

Install

From pypi:

pip install qec-loss
# or with uv
uv add qec-loss

Local install

Please first install uv.

git submodule update --init --recursive
uv pip install -e . --no-build-isolation --group dev
uv run pre-commit install

The last command installs a git pre-commit hook that runs ruff format on Python and clang-format on C++ under src/qec_loss/_native/.

To format everything manually:

uv run pre-commit run --all-files

Quick start

import stim
from qec_loss import LossyCircuit, ForwardSampler, MonakaBuilder, add_loss_noise

stim_circuit = stim.Circuit.generated(
    "surface_code:rotated_memory_z", rounds=5, distance=5
)
circuit = add_loss_noise(stim_circuit, loss_after_2_qubit_gate=0.01)

sampler = ForwardSampler(circuit, seed=7)
batch = sampler.sample(1000)

builder = MonakaBuilder(circuit, model_path="/tmp/monaka")
predictions = builder.decode_batch(batch)

See docs/api.md for the full API.

Test

uv run pytest tests/

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

qec_loss-0.1.2.tar.gz (8.4 MB view details)

Uploaded Source

Built Distributions

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

qec_loss-0.1.2-cp314-cp314-win_amd64.whl (685.8 kB view details)

Uploaded CPython 3.14Windows x86-64

qec_loss-0.1.2-cp314-cp314-win32.whl (597.8 kB view details)

Uploaded CPython 3.14Windows x86

qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (642.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl (440.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl (491.7 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

File details

Details for the file qec_loss-0.1.2.tar.gz.

File metadata

  • Download URL: qec_loss-0.1.2.tar.gz
  • Upload date:
  • Size: 8.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qec_loss-0.1.2.tar.gz
Algorithm Hash digest
SHA256 97895371d79f47ed619bfca392e61bc9bfadc3afc7d8f3f0865ec0d147201a38
MD5 330dcf72faf9f0a55a3c0109561e096a
BLAKE2b-256 335471fbac4fd3d93c383517af6b453c216c85588cf6032867a169d7d656bfcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2.tar.gz:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: qec_loss-0.1.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 685.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 671c5b5ecf29d3b512e55fd3ebe6f6638016a81ce13f4e7af240320d98774287
MD5 2cfd85062fdc81b254f0dc8f193a8574
BLAKE2b-256 3f113ee35be6a02475527810a6a291d9b22293c492d8685c25f81b6eb2c6ac51

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-win_amd64.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-win32.whl.

File metadata

  • Download URL: qec_loss-0.1.2-cp314-cp314-win32.whl
  • Upload date:
  • Size: 597.8 kB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 5bdae9df6313bd93b38d46736003f8e092aa1765a9d79b68563aa62bcb56e922
MD5 16a3e577ba9d9df1055ed7d9cac60970
BLAKE2b-256 30f956956fb1fe0b19ec61d055d6a98b6fe2bf13fa44d93603605fd9c017cfab

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-win32.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5074d9aa4367d0fd6864b1206ef76d7ab4ebd3f6e0b00a1134df83af9678ff62
MD5 43149cd4d4fa356c52b91a7477bcba93
BLAKE2b-256 6191fc63c4922c9bc75a405bc0e39d7a782ba93cc4b4fb436ec8c5ccc8878fdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0610e6ce2db7b64b3fe804b2dc71002d1d0535a26a5514ca5b58c5e169d5a99f
MD5 1f91553f1a1343ce91753772503d4a3c
BLAKE2b-256 71cd187531d388ed97cd0df5413a0a2b29de93c053a5025960b0876b25ce5d46

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82871dde9ddc1913f15c02911d24b7fd36cd646cd40aa2cdcd24d0bba2c85a56
MD5 8d92acfff19a68095f606f8622f0cda7
BLAKE2b-256 58913b23382dd562b8f77477d3e962bd76489f7c2d1d917ca4bdce05b92d9223

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fa3cc22c6732a6db0ccc1ceff7ad37f196a31f062127be6e464eecd1e8e17d7a
MD5 fdddbaf9caed8566cbbd25ab8571cd27
BLAKE2b-256 68f148542e877a38e684b5331fdf47c1642156a646b1ed989af587e8c1eb093e

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl:

Publisher: release.yml on Jaymun723/qec-loss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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