Skip to main content
qsalto logo

transform your quantum weight enumerators

PyPI Package MIT License Tests

qsalto provides transformations between several (normalized) quantum weight enumerators, including

  • Shor-Laflamme enumerators1 $a$, $b$,
  • Rains unitary enumerators2 $a'$, $b'$,
  • and Rains shadow enumerators3 $\tilde{a}$.

We provide both

Python package

The python package qsalto can be installed via pip install qsalto and features functions to generate nine classes of transformation matrices. You can install it via

pip install qsalto

or

pip install qsalto[Precision]

if you want to make use of high-precision transformation matrices (see below). This variant will also install the optional dependency mpmath.

After installation you can use the package as follows:

import qsalto

a = ..  # some normalized Shor-Laflamme distribution
n = len(a) - 1

# Transform it into Rains shadow enumerators
a2 = qsalto.T2(n) @ a  
Matrix Function Transforms from ... ... to is self-inverse
$M$ M(n) $\mathbf{a}$ $\mathbf{b}$ ✅
$M'$ M1(n) $\mathbf{a'}$ $\mathbf{b'}$ ✅
$\tilde{M}$ M2(n) $\mathbf{\tilde{a}}$ $\mathbf{\tilde{b}}$ ✅
$T'$ T1(n) $\mathbf{a}$, $\mathbf{b}$ $\mathbf{a'}$, $\mathbf{b'}$ ❌
$T'^{-1}$ iT1(n) $\mathbf{a'}$, $\mathbf{b'}$ $\mathbf{a}$, $\mathbf{b}$ ❌
$\tilde{T}$ T2(n) $\mathbf{a}$, $\mathbf{b}$ $\mathbf{\tilde{a}}$, $\mathbf{\tilde{b}}$ ❌
$\tilde{T}^{-1}$ iT2(n) $\mathbf{\tilde{a}}$, $\mathbf{\tilde{b}}$ $\mathbf{a}$, $\mathbf{b}$ ❌
$\tilde{T}'$ T3(n) $\mathbf{a'}$, $\mathbf{b'}$ $\mathbf{\tilde{a}}$, $\mathbf{\tilde{b}}$ ❌
$\tilde{T}'^{-1}$ iT3(n) $\mathbf{\tilde{a}}$, $\mathbf{\tilde{b}}$ $\mathbf{a'}$, $\mathbf{b'}$ ❌

To compute the full matrices, an optimized algorithm making use of recursive patterns is employed. Each matrix generator also features the computation of single elements through, e.g., M(100, entry=[3,4]) where entry specifies the row and column of the entry (in that order).

Single-shot estimators

Furthermore, the function single_shot_estimators(n) generates single-shot estimators for $a$, $b$, $a'$, $b'$, $\tilde{a}$, and $\tilde{b}$ for all possible numbers $m=0,...,n$ of singlets as an outcome of a two-copy Bell measurement. This function returns six 2D-arrays (one for each quantum weight enumerator in the order as given above) with the estimator for $m$ singlets in the $m$-th column.

High-precision transformation matrices

For some applications, a higher precision than 64 bit floating point is needed for the transformation matrices. For this purpose, each transformation features a precise argument (which defaults to false). If set to true, an mpmath.matrix is returned instead of an np.array. This requires mpmath to be installed. The precision can for example be set via mpmath.mp.dps = 120 (more on precision with mpmath, see here) before calling the transformation generator.

License

This library is distributed under the MIT License.

If you want to support work like this, please cite our paper: https://arxiv.org/abs/2408.16914

  1. P. Shor and R. Laflamme, Phys. Rev. Lett. 78, 1600 (1997) ↩

  2. E. M. Rains, IEEE Trans. Inf. Th., 44, 1388 (1998) ↩

  3. E. M. Rains, IEEE Trans Inf. Th. 45, 2361 (1999) ↩

Metadata

Release files for qsalto 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qsalto 0.2.2
File Size Uploaded Provenance Actions
qsalto-0.2.2.tar.gz 9.6 kB With provenance Details for qsalto-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qsalto 0.2.2
File Interpreter ABI Platform Actions
qsalto-0.2.2-py3-none-any.whl Python 3 none any Details for qsalto-0.2.2-py3-none-any.whl

Total release size: 18.1 kB

Release files / qsalto-0.2.2.tar.gz

Download URL qsalto-0.2.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2d336b577479a97e4e167499e6b8ee2d06427b3126c03ed21f8a7ede9e58eef1
BLAKE2b-256 checksum
How to use checksums
0640c1c230482aaa5769e4f15915c8760a02ce45c6ffb7901c3972808963a1bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / qsalto-0.2.2-py3-none-any.whl

Download URL qsalto-0.2.2-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe1c750d8ad720db2f9f0225f16c5b405737a510152c5cd0bbfccccc867ee645
BLAKE2b-256 checksum
How to use checksums
621abfb8d6388e49e2db4e7bccc9ceac7203fbfc34218e4ae1f67990113e92cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Security for qsalto 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qsalto-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page