Skip to main content

Transformations between quantum weight enumerators

Project description

qsalto logo

transform your quantum weight enumerators

PyPI Package MIT License Tests

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

  • Shor-Laflamme enumerators[^1] $a$, $b$,
  • Rains unitary enumerators[^2] $a'$, $b'$,
  • and Rains shadow enumerators[^3] $\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)

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

qsalto-0.2.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

qsalto-0.2.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file qsalto-0.2.2.tar.gz.

File metadata

  • Download URL: qsalto-0.2.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for qsalto-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2d336b577479a97e4e167499e6b8ee2d06427b3126c03ed21f8a7ede9e58eef1
MD5 ea372aa494c446deecf836dd764e31f0
BLAKE2b-256 0640c1c230482aaa5769e4f15915c8760a02ce45c6ffb7901c3972808963a1bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsalto-0.2.2.tar.gz:

Publisher: publish-python.yml on Mc-Zen/qsalto

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

File details

Details for the file qsalto-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: qsalto-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for qsalto-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe1c750d8ad720db2f9f0225f16c5b405737a510152c5cd0bbfccccc867ee645
MD5 a46270f67f7501bb030680856dccc0f8
BLAKE2b-256 621abfb8d6388e49e2db4e7bccc9ceac7203fbfc34218e4ae1f67990113e92cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsalto-0.2.2-py3-none-any.whl:

Publisher: publish-python.yml on Mc-Zen/qsalto

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