<picture>
<source media="(prefers-color-scheme: light)" srcset="https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo-dark.svg">
<img alt="qsalto logo" src="https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo.svg">
</picture>
_transform your quantum weight enumerators_
[![PyPI Package](https://img.shields.io/pypi/v/qsalto)](https://pypi.org/project/qsalto/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/Mc-Zen/qsalto/blob/main/LICENSE)
[![Tests](https://github.com/Mc-Zen/qsalto/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Mc-Zen/qsalto/actions/workflows/run-tests.yml)
---
**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.
<img src="https://github.com/Mc-Zen/qsalto/raw/main/docs/media/transformation-diagram.svg" width="420">
## 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`](https://mpmath.org/) to be installed. The precision can for example be set via `mpmath.mp.dps = 120` (more on precision with mpmath, see [here](https://mpmath.org/doc/current/basics.html#setting-the-precision)) 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)](http://dx.doi.org/10.1103/PhysRevLett.78.1600)
[^2]: [E. M. Rains, IEEE Trans. Inf. Th., **44**, 1388 (1998)](http://dx.doi.org/10.1109/18.681316)
[^3]: [E. M. Rains, IEEE Trans Inf. Th. **45**, 2361 (1999)](http://dx.doi.org/10.1109/18.796376)
Raw data
{
"_id": null,
"home_page": null,
"name": "qsalto",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "quantum information, quantum weight enumerators, Shor-Laflamme, Rains unitary, Rains shadow",
"author": "Mc-Zen",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/38/f9/6db20546f416350d230985fc00cc23ad154b3e48d82de86f4c08d6e328a1/qsalto-0.2.0.tar.gz",
"platform": null,
"description": "\n<picture>\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo.svg\">\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo-dark.svg\">\n <img alt=\"qsalto logo\" src=\"https://github.com/Mc-Zen/qsalto/raw/main/docs/media/logo.svg\">\n</picture>\n\n\n_transform your quantum weight enumerators_\n\n\n\n[![PyPI Package](https://img.shields.io/pypi/v/qsalto)](https://pypi.org/project/qsalto/)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/Mc-Zen/qsalto/blob/main/LICENSE)\n[![Tests](https://github.com/Mc-Zen/qsalto/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Mc-Zen/qsalto/actions/workflows/run-tests.yml)\n---\n\n\n\n**qsalto** provides transformations between several (normalized) quantum weight enumerators, including\n- Shor-Laflamme enumerators[^1] $a$, $b$,\n- Rains unitary enumerators[^2] $a'$, $b'$,\n- and Rains shadow enumerators[^3] $a''$.\n\n\nWe provide both \n- a python package, available on PyPI: https://pypi.org/project/qsalto,\n- a web viewer for visualizing the transformation matrices at https://mc-zen.github.io/qsalto.\n\n\n<img src=\"https://github.com/Mc-Zen/qsalto/raw/main/docs/media/transformation-diagram.svg\" width=\"420\">\n\n## Python package\n\nThe python package `qsalto` can be installed via `pip install qsalto` and features functions to generate nine classes of transformation matrices. \n\n\n|Matrix | Function | Transforms from ... | ... to |is self-inverse|\n|-----------|----------|-------------------------------|-------------------------------|---------------|\n|$M$ |`M(n)` |$\\mathbf{a}$ |$\\mathbf{b}$ |\u2705 |\n|$M'$ |`M1(n)` |$\\mathbf{a'}$ |$\\mathbf{b'}$ |\u2705 |\n|$M''$ |`M2(n)` |$\\mathbf{a''}$ |$\\mathbf{b''}$ |\u2705 |\n|$T'$ |`T1(n)` |$\\mathbf{a}$, $\\mathbf{b}$ |$\\mathbf{a'}$, $\\mathbf{b'}$ |\u274c |\n|$T'^{-1}$ |`iT1(n)` |$\\mathbf{a'}$, $\\mathbf{b'}$ |$\\mathbf{a}$, $\\mathbf{b}$ |\u274c |\n|$T''$ |`T2(n)` |$\\mathbf{a}$, $\\mathbf{b}$ |$\\mathbf{a''}$, $\\mathbf{b''}$ |\u274c |\n|$T''^{-1}$ |`iT2(n)` |$\\mathbf{a''}$, $\\mathbf{b''}$ |$\\mathbf{a}$, $\\mathbf{b}$ |\u274c |\n|$T'''$ |`T3(n)` |$\\mathbf{a'}$, $\\mathbf{b'}$ |$\\mathbf{a''}$, $\\mathbf{b''}$ |\u274c |\n|$T'''^{-1}$|`iT3(n)` |$\\mathbf{a''}$, $\\mathbf{b''}$ |$\\mathbf{a'}$, $\\mathbf{b'}$ |\u274c |\n\nTo 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). \n\n### Single-shot estimators\n\nFurthermore, 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. \n\n### High-precision transformation matrices\n\nFor 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`](https://mpmath.org/) to be installed. The precision can for example be set via `mpmath.mp.dps = 120` (more on precision with mpmath, see [here](https://mpmath.org/doc/current/basics.html#setting-the-precision)) before calling the transformation generator. \n\n\n## License\n\nThis library is distributed under the MIT License.\n\nIf you want to support work like this, please cite our paper: tba\n\n\n\n[^1]: [P. Shor and R. Laflamme, Phys. Rev. Lett. **78**, 1600 (1997)](http://dx.doi.org/10.1103/PhysRevLett.78.1600)\n\n[^2]: [E. M. Rains, IEEE Trans. Inf. Th., **44**, 1388 (1998)](http://dx.doi.org/10.1109/18.681316)\n\n[^3]: [E. M. Rains, IEEE Trans Inf. Th. **45**, 2361 (1999)](http://dx.doi.org/10.1109/18.796376)\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Transformations between quantum weight enumerators",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/Mc-Zen/qsalto/issues",
"Homepage": "https://github.com/Mc-Zen/qsalto"
},
"split_keywords": [
"quantum information",
" quantum weight enumerators",
" shor-laflamme",
" rains unitary",
" rains shadow"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f98b0892898db5592005a03146008573a93f64df81c3eb3eec399a1c3cfd362e",
"md5": "b074867a8c1ba529a82ab12d6b4dbf16",
"sha256": "9af7ebf895ae144244ffea74d72165ee2fd50ca2794634c1ca5df5490c41bbe0"
},
"downloads": -1,
"filename": "qsalto-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b074867a8c1ba529a82ab12d6b4dbf16",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8306,
"upload_time": "2024-07-29T08:48:09",
"upload_time_iso_8601": "2024-07-29T08:48:09.779130Z",
"url": "https://files.pythonhosted.org/packages/f9/8b/0892898db5592005a03146008573a93f64df81c3eb3eec399a1c3cfd362e/qsalto-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "38f96db20546f416350d230985fc00cc23ad154b3e48d82de86f4c08d6e328a1",
"md5": "86ebfd9b03a0bdebff9a0570928ce33c",
"sha256": "4c054e07d7cf43ed627aa950972c5c9217b318a92e291a32b993d587dcadaadf"
},
"downloads": -1,
"filename": "qsalto-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "86ebfd9b03a0bdebff9a0570928ce33c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9083,
"upload_time": "2024-07-29T08:48:10",
"upload_time_iso_8601": "2024-07-29T08:48:10.607201Z",
"url": "https://files.pythonhosted.org/packages/38/f9/6db20546f416350d230985fc00cc23ad154b3e48d82de86f4c08d6e328a1/qsalto-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-29 08:48:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Mc-Zen",
"github_project": "qsalto",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "qsalto"
}