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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97895371d79f47ed619bfca392e61bc9bfadc3afc7d8f3f0865ec0d147201a38
|
|
| MD5 |
330dcf72faf9f0a55a3c0109561e096a
|
|
| BLAKE2b-256 |
335471fbac4fd3d93c383517af6b453c216c85588cf6032867a169d7d656bfcc
|
Provenance
The following attestation bundles were made for qec_loss-0.1.2.tar.gz:
Publisher:
release.yml on Jaymun723/qec-loss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2.tar.gz -
Subject digest:
97895371d79f47ed619bfca392e61bc9bfadc3afc7d8f3f0865ec0d147201a38 - Sigstore transparency entry: 2095040460
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
671c5b5ecf29d3b512e55fd3ebe6f6638016a81ce13f4e7af240320d98774287
|
|
| MD5 |
2cfd85062fdc81b254f0dc8f193a8574
|
|
| BLAKE2b-256 |
3f113ee35be6a02475527810a6a291d9b22293c492d8685c25f81b6eb2c6ac51
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-win_amd64.whl -
Subject digest:
671c5b5ecf29d3b512e55fd3ebe6f6638016a81ce13f4e7af240320d98774287 - Sigstore transparency entry: 2095042094
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bdae9df6313bd93b38d46736003f8e092aa1765a9d79b68563aa62bcb56e922
|
|
| MD5 |
16a3e577ba9d9df1055ed7d9cac60970
|
|
| BLAKE2b-256 |
30f956956fb1fe0b19ec61d055d6a98b6fe2bf13fa44d93603605fd9c017cfab
|
Provenance
The following attestation bundles were made for qec_loss-0.1.2-cp314-cp314-win32.whl:
Publisher:
release.yml on Jaymun723/qec-loss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-win32.whl -
Subject digest:
5bdae9df6313bd93b38d46736003f8e092aa1765a9d79b68563aa62bcb56e922 - Sigstore transparency entry: 2095041296
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
File details
Details for the file qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.14, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5074d9aa4367d0fd6864b1206ef76d7ab4ebd3f6e0b00a1134df83af9678ff62
|
|
| MD5 |
43149cd4d4fa356c52b91a7477bcba93
|
|
| BLAKE2b-256 |
6191fc63c4922c9bc75a405bc0e39d7a782ba93cc4b4fb436ec8c5ccc8878fdd
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-musllinux_1_2_x86_64.whl -
Subject digest:
5074d9aa4367d0fd6864b1206ef76d7ab4ebd3f6e0b00a1134df83af9678ff62 - Sigstore transparency entry: 2095040663
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
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
- Download URL: qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 642.9 kB
- Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0610e6ce2db7b64b3fe804b2dc71002d1d0535a26a5514ca5b58c5e169d5a99f
|
|
| MD5 |
1f91553f1a1343ce91753772503d4a3c
|
|
| BLAKE2b-256 |
71cd187531d388ed97cd0df5413a0a2b29de93c053a5025960b0876b25ce5d46
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
0610e6ce2db7b64b3fe804b2dc71002d1d0535a26a5514ca5b58c5e169d5a99f - Sigstore transparency entry: 2095041074
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
File details
Details for the file qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 440.7 kB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82871dde9ddc1913f15c02911d24b7fd36cd646cd40aa2cdcd24d0bba2c85a56
|
|
| MD5 |
8d92acfff19a68095f606f8622f0cda7
|
|
| BLAKE2b-256 |
58913b23382dd562b8f77477d3e962bd76489f7c2d1d917ca4bdce05b92d9223
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-macosx_11_0_arm64.whl -
Subject digest:
82871dde9ddc1913f15c02911d24b7fd36cd646cd40aa2cdcd24d0bba2c85a56 - Sigstore transparency entry: 2095042397
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type:
File details
Details for the file qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl.
File metadata
- Download URL: qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl
- Upload date:
- Size: 491.7 kB
- Tags: CPython 3.14, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa3cc22c6732a6db0ccc1ceff7ad37f196a31f062127be6e464eecd1e8e17d7a
|
|
| MD5 |
fdddbaf9caed8566cbbd25ab8571cd27
|
|
| BLAKE2b-256 |
68f148542e877a38e684b5331fdf47c1642156a646b1ed989af587e8c1eb093e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qec_loss-0.1.2-cp314-cp314-macosx_10_15_x86_64.whl -
Subject digest:
fa3cc22c6732a6db0ccc1ceff7ad37f196a31f062127be6e464eecd1e8e17d7a - Sigstore transparency entry: 2095041479
- Sigstore integration time:
-
Permalink:
Jaymun723/qec-loss@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Jaymun723
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0d772954f8bb5fba4e5bc00c58ccf9994c3fe62 -
Trigger Event:
release
-
Statement type: