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

Uploaded CPython 3.14Windows x86-64

qec_loss-0.1.0-cp314-cp314-win32.whl (587.5 kB view details)

Uploaded CPython 3.14Windows x86

qec_loss-0.1.0-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.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (625.6 kB view details)

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

qec_loss-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (423.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

qec_loss-0.1.0-cp314-cp314-macosx_10_15_x86_64.whl (459.6 kB view details)

Uploaded CPython 3.14macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: qec_loss-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2a70d0ab4c31f69de459c78f2583ec3c8b4810ab965275d25ba4d54e1498ff36
MD5 3d53428c73c6bf8171e33b99a4f2999d
BLAKE2b-256 21595023df5bff919d1801f29c1f51efd4a1a3143dc0e844bad0dbb4b23795d3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: qec_loss-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 668.9 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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 bb37da472ad3bfc46ae53bb705e25712ada227c70ba948c29714cfb7fd8d58f6
MD5 f7e6f3d4b130bea0bba14c0c2a328a8d
BLAKE2b-256 526e1fd065b2c7ebcd91987badd0a1cfc24e39835781acf9a7a16907451f7011

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: qec_loss-0.1.0-cp314-cp314-win32.whl
  • Upload date:
  • Size: 587.5 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.0-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 900de7c539d6ebfc77098447abc62bfaeca425746e5eea58ec1284bb0df38bfd
MD5 745b0048cf68ccc5547deb3514f2081e
BLAKE2b-256 2ee89b50470a55eeece9f12e4346fded14c178ad5c343fd3330f8a28b695cd2f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qec_loss-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2ed3ad4f0ab1bef875a446cffdba36ad4bbb55a727571236033461d5a9a21116
MD5 560ad45947c2433efefe4fdd23b54223
BLAKE2b-256 595a7cf99004e27e648ebd898c480689b128555686cd23b8d08e57a1c1f1f962

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qec_loss-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 684eb50d2a7d41243f09b71f3a4c4b32d294ce3140542f8988eac8c495c911b3
MD5 e644a2643f2d381f49bf91a799077dda
BLAKE2b-256 7c920088907b371cdf0805a379dfe4beab64f824aca179ed469f4f89d2307f8b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qec_loss-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71bf13d7276445d43b0677db13f83dcef539baf1c230eccb8286e3cc88052382
MD5 fbc483716ee5ab21b1b6c8d96171f9ea
BLAKE2b-256 014507abb9269ef8c21855143b64d91cee5fea65c9be469982900242387707dc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qec_loss-0.1.0-cp314-cp314-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a6de231e86d893423ce5f19bc059fd046a8b0c91cd9d2072ccff9c8d75d291db
MD5 70616cece278920e7259d5e85ee393c7
BLAKE2b-256 f0c236497e397d3d5c051a970669056141c3214c174c67fb4557be5acead77ab

See more details on using hashes here.

Provenance

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