<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_
[](https://pypi.org/project/qsalto/)
[](https://github.com/Mc-Zen/qsalto/blob/main/LICENSE)
[](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] $\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.
<a href="https://mc-zen.github.io/qsalto"><img src="https://github.com/Mc-Zen/qsalto/raw/main/docs/media/transformation-diagram.svg" width="420"></a>
## 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'}$ |✅ |
|$\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`](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: https://arxiv.org/abs/2408.16914
[^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.8",
"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/57/4b/3a7221920e9a5fd9269e49d292ca123ff761fb9b281a7b802f9141b3cf4f/qsalto-0.2.1.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[](https://pypi.org/project/qsalto/)\n[](https://github.com/Mc-Zen/qsalto/blob/main/LICENSE)\n[](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] $\\tilde{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<a href=\"https://mc-zen.github.io/qsalto\"><img src=\"https://github.com/Mc-Zen/qsalto/raw/main/docs/media/transformation-diagram.svg\" width=\"420\"></a>\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|$\\tilde{M}$ |`M2(n)` |$\\mathbf{\\tilde{a}}$ |$\\mathbf{\\tilde{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|$\\tilde{T}$ |`T2(n)` |$\\mathbf{a}$, $\\mathbf{b}$ |$\\mathbf{\\tilde{a}}$, $\\mathbf{\\tilde{b}}$ |\u274c |\n|$\\tilde{T}^{-1}$ |`iT2(n)` |$\\mathbf{\\tilde{a}}$, $\\mathbf{\\tilde{b}}$ |$\\mathbf{a}$, $\\mathbf{b}$ |\u274c |\n|$\\tilde{T}'$ |`T3(n)` |$\\mathbf{a'}$, $\\mathbf{b'}$ |$\\mathbf{\\tilde{a}}$, $\\mathbf{\\tilde{b}}$ |\u274c |\n|$\\tilde{T}'^{-1}$|`iT3(n)` |$\\mathbf{\\tilde{a}}$, $\\mathbf{\\tilde{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'$, $\\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. \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: https://arxiv.org/abs/2408.16914\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.1",
"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": null,
"digests": {
"blake2b_256": "a61265f92e70430b0094858e6d1e2a020508d9e2ba5104a0a7595fced139c353",
"md5": "f3e3be9bc1fefd998b92b9b52ba56184",
"sha256": "02fce1db3f4897b232a65d0ddda31c515aca5e2fb9ec9065f8cae9140568c546"
},
"downloads": -1,
"filename": "qsalto-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f3e3be9bc1fefd998b92b9b52ba56184",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8351,
"upload_time": "2025-01-26T11:32:38",
"upload_time_iso_8601": "2025-01-26T11:32:38.319798Z",
"url": "https://files.pythonhosted.org/packages/a6/12/65f92e70430b0094858e6d1e2a020508d9e2ba5104a0a7595fced139c353/qsalto-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "574b3a7221920e9a5fd9269e49d292ca123ff761fb9b281a7b802f9141b3cf4f",
"md5": "41ce305f27db5dbc1841501258025b58",
"sha256": "05e43269d07d68f6722a4f0b0313fd1bf6c56521866bdc0d4a1d4c9f7b261995"
},
"downloads": -1,
"filename": "qsalto-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "41ce305f27db5dbc1841501258025b58",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9200,
"upload_time": "2025-01-26T11:32:40",
"upload_time_iso_8601": "2025-01-26T11:32:40.011266Z",
"url": "https://files.pythonhosted.org/packages/57/4b/3a7221920e9a5fd9269e49d292ca123ff761fb9b281a7b802f9141b3cf4f/qsalto-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-26 11:32:40",
"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"
}