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.1.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.1-cp314-cp314-win_amd64.whl (686.1 kB view details)

Uploaded CPython 3.14Windows x86-64

qec_loss-0.1.1-cp314-cp314-win32.whl (597.9 kB view details)

Uploaded CPython 3.14Windows x86

qec_loss-0.1.1-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.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (643.5 kB view details)

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

qec_loss-0.1.1-cp314-cp314-macosx_11_0_arm64.whl (437.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

qec_loss-0.1.1-cp314-cp314-macosx_10_15_x86_64.whl (475.6 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: qec_loss-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c94140eb6b82f0a80f3e03f0c47968dbd143866c215568b1cedde392d1deced7
MD5 de2969c2a773e9139fb7131585e49477
BLAKE2b-256 2c26849cca710a05aab426289fa0ef4b9b5d34926486672f2627faf25dd43ef4

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1.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.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: qec_loss-0.1.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 686.1 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.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 149b55b00704681095225ebd85a9556164399763e9170eec5d19e17876f6ba8c
MD5 9d62dad4955124afc0436120b365ab31
BLAKE2b-256 265856d662de9f7264b563d032336bd1cad34c2c77f49813aea2a3c0d437ca2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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.1-cp314-cp314-win32.whl.

File metadata

  • Download URL: qec_loss-0.1.1-cp314-cp314-win32.whl
  • Upload date:
  • Size: 597.9 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.1-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 3253d8fb4ce8a989c73f97305ab7b1b20a686d17a432ef4d3fe693612e951eab
MD5 0f7898605beddcf9e90282c198f735d6
BLAKE2b-256 37a7b9a24eeb07cf7c6685526d792cde6091d2a7150f3de43cc7cc1d07eb978c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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.1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 477a13248a516182a3241b9dc5a4027c9b990cf999abc7c30239210d6765f278
MD5 83bb1fb7fb43c8560006691871a57158
BLAKE2b-256 50f7545204ec478d199877f04f221e14272b0328b2e7fe72a7292b3c1c339222

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8c903a34a56dbac47ddaf312c8ae3e415689d1a882d058d4532bf1b0c3c096fa
MD5 4c877aadfb98800995d317a130926ea7
BLAKE2b-256 ae5faf86cd78ec46f4d6653e3f1c870534413d89f623838a2e4df15b8755df89

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e4b16e0057a367edaa2abc07f05f7abf1f7e237dbb1dcf2b99b2c77328a2d0c
MD5 6055afcdcee7ff8b9ae2f3583ba8a94f
BLAKE2b-256 1f6035522fa652f81972b0389f1d96fdf1d0714c822b985b938dbc0feb7eb175

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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.1-cp314-cp314-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for qec_loss-0.1.1-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 814e4beb68fee35e247e5b2ed0636bbe1be47b40d13707efa402f3a341478d17
MD5 fc46aed8e3fa97fc4bb1ee5fa04db4fe
BLAKE2b-256 dc504852686f9eea595d80dd20fadbe0feb826198d57d4fe3afce7937811a538

See more details on using hashes here.

Provenance

The following attestation bundles were made for qec_loss-0.1.1-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