Transformations between quantum weight enumerators
Project description
transform your quantum weight enumerators
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
- a python package, available on PyPI: https://pypi.org/project/qsalto,
- a web viewer for visualizing the transformation matrices at https://mc-zen.github.io/qsalto.
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)
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
Built Distribution
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d336b577479a97e4e167499e6b8ee2d06427b3126c03ed21f8a7ede9e58eef1
|
|
| MD5 |
ea372aa494c446deecf836dd764e31f0
|
|
| BLAKE2b-256 |
0640c1c230482aaa5769e4f15915c8760a02ce45c6ffb7901c3972808963a1bf
|
Provenance
The following attestation bundles were made for qsalto-0.2.2.tar.gz:
Publisher:
publish-python.yml on Mc-Zen/qsalto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qsalto-0.2.2.tar.gz -
Subject digest:
2d336b577479a97e4e167499e6b8ee2d06427b3126c03ed21f8a7ede9e58eef1 - Sigstore transparency entry: 166008535
- Sigstore integration time:
-
Permalink:
Mc-Zen/qsalto@d41b2767fede6ef082785bb3a29d2e60aef1d163 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mc-Zen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@d41b2767fede6ef082785bb3a29d2e60aef1d163 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe1c750d8ad720db2f9f0225f16c5b405737a510152c5cd0bbfccccc867ee645
|
|
| MD5 |
a46270f67f7501bb030680856dccc0f8
|
|
| BLAKE2b-256 |
621abfb8d6388e49e2db4e7bccc9ceac7203fbfc34218e4ae1f67990113e92cd
|
Provenance
The following attestation bundles were made for qsalto-0.2.2-py3-none-any.whl:
Publisher:
publish-python.yml on Mc-Zen/qsalto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qsalto-0.2.2-py3-none-any.whl -
Subject digest:
fe1c750d8ad720db2f9f0225f16c5b405737a510152c5cd0bbfccccc867ee645 - Sigstore transparency entry: 166008539
- Sigstore integration time:
-
Permalink:
Mc-Zen/qsalto@d41b2767fede6ef082785bb3a29d2e60aef1d163 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mc-Zen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@d41b2767fede6ef082785bb3a29d2e60aef1d163 -
Trigger Event:
workflow_dispatch
-
Statement type: