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] $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.
Matrix | Function | Transforms from ... | ... to | is self-inverse |
---|---|---|---|---|
$M$ | M(n) |
$\mathbf{a}$ | $\mathbf{b}$ | ✅ |
$M'$ | M1(n) |
$\mathbf{a'}$ | $\mathbf{b'}$ | ✅ |
$M''$ | M2(n) |
$\mathbf{a''}$ | $\mathbf{b''}$ | ✅ |
$T'$ | T1(n) |
$\mathbf{a}$, $\mathbf{b}$ | $\mathbf{a'}$, $\mathbf{b'}$ | ❌ |
$T'^{-1}$ | iT1(n) |
$\mathbf{a'}$, $\mathbf{b'}$ | $\mathbf{a}$, $\mathbf{b}$ | ❌ |
$T''$ | T2(n) |
$\mathbf{a}$, $\mathbf{b}$ | $\mathbf{a''}$, $\mathbf{b''}$ | ❌ |
$T''^{-1}$ | iT2(n) |
$\mathbf{a''}$, $\mathbf{b''}$ | $\mathbf{a}$, $\mathbf{b}$ | ❌ |
$T'''$ | T3(n) |
$\mathbf{a'}$, $\mathbf{b'}$ | $\mathbf{a''}$, $\mathbf{b''}$ | ❌ |
$T'''^{-1}$ | iT3(n) |
$\mathbf{a''}$, $\mathbf{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'$, $a''$, and $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: tba
[^1]: P. Shor and R. Laflamme, Phys. Rev. Lett. 78, 1600 (1997)
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 Distribution
File details
Details for the file qsalto-0.2.0.tar.gz
.
File metadata
- Download URL: qsalto-0.2.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c054e07d7cf43ed627aa950972c5c9217b318a92e291a32b993d587dcadaadf |
|
MD5 | 86ebfd9b03a0bdebff9a0570928ce33c |
|
BLAKE2b-256 | 38f96db20546f416350d230985fc00cc23ad154b3e48d82de86f4c08d6e328a1 |
File details
Details for the file qsalto-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: qsalto-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9af7ebf895ae144244ffea74d72165ee2fd50ca2794634c1ca5df5490c41bbe0 |
|
MD5 | b074867a8c1ba529a82ab12d6b4dbf16 |
|
BLAKE2b-256 | f98b0892898db5592005a03146008573a93f64df81c3eb3eec399a1c3cfd362e |