{"id":13536239,"url":"https://github.com/vprusso/toqito","last_synced_at":"2026-03-03T01:03:49.260Z","repository":{"id":37520016,"uuid":"235493396","full_name":"vprusso/toqito","owner":"vprusso","description":"|toqito\u003e (Theory of Quantum Information Toolkit) in Python :snake:","archived":false,"fork":false,"pushed_at":"2025-04-08T01:17:32.000Z","size":4508,"stargazers_count":241,"open_issues_count":77,"forks_count":110,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-08T02:25:09.489Z","etag":null,"topics":["matrix-analysis","physics","python","python-3","quantum","quantum-computing","quantum-information","unitaryhack"],"latest_commit_sha":null,"homepage":"https://toqito.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vprusso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.rst","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"docs/code_of_conduct.rst","threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["vprusso"],"custom":["https://www.paypal.me/vincentrusso1"]}},"created_at":"2020-01-22T03:47:16.000Z","updated_at":"2025-04-08T01:17:37.000Z","dependencies_parsed_at":"2023-12-09T20:28:06.959Z","dependency_job_id":"c28ad4b0-7a3a-41cd-8aae-a106bdbbbd2d","html_url":"https://github.com/vprusso/toqito","commit_stats":{"total_commits":1428,"total_committers":46,"mean_commits":"31.043478260869566","dds":"0.48949579831932777","last_synced_commit":"72d98fc0f2cdfe8e2340071c2a599b96bb0b6cab"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vprusso%2Ftoqito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vprusso%2Ftoqito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vprusso%2Ftoqito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vprusso%2Ftoqito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vprusso","download_url":"https://codeload.github.com/vprusso/toqito/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765226,"owners_count":20992267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matrix-analysis","physics","python","python-3","quantum","quantum-computing","quantum-information","unitaryhack"],"created_at":"2024-08-01T09:00:36.338Z","updated_at":"2026-03-03T01:03:49.247Z","avatar_url":"https://github.com/vprusso.png","language":"Python","funding_links":["https://github.com/sponsors/vprusso","https://www.paypal.me/vincentrusso1"],"categories":["Quantum Software Packages","Python","Quantum tools"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/vprusso/toqito/master/docs/content/figures/logo-dark.svg\" width=\"60%\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/vprusso/toqito/master/docs/content/figures/logo.svg\" width=\"60%\"\u003e\n \u003c/picture\u003e\n \u003c/p\u003e\n\n\u003c!-- --8\u003c-- [start:badges] --\u003e\n# |toqito⟩: Theory of Quantum Information Toolkit\n\n[![build status](https://github.com/vprusso/toqito/actions/workflows/build-test-actions.yml/badge.svg)](https://github.com/vprusso/toqito/actions/workflows/build-test-actions.yml)\n[![doc status](https://img.shields.io/badge/docs-passing-brightgreen)](https://vprusso.github.io/toqito/)\n[![codecov](https://codecov.io/gh/vprusso/toqito/branch/master/graph/badge.svg)](https://app.codecov.io/gh/vprusso/toqito)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4743211.svg)](https://doi.org/10.5281/zenodo.4743211)\n[![Downloads](https://static.pepy.tech/personalized-badge/toqito?style=platic\u0026period=total\u0026units=none\u0026left_color=black\u0026right_color=brightgreen\u0026left_text=Downloads)](https://pepy.tech/project/toqito)\n[![Unitary Foundation](https://img.shields.io/badge/Supported%20By-Unitary%20Foundation-FFFF00.svg)](https://unitary.foundation)\n\nThe |toqito⟩ package is an open-source Python library for studying various\nobjects in quantum information, namely, states, channels, and measurements.\n\u003c!-- --8\u003c-- [end:badges] --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://vprusso.github.io/toqito/\"\u003e\n  \u003cimg width=30% src=\"https://img.shields.io/badge/documentation-blue?style=for-the-badge\u0026logo=material%20for%20mkdocs\" alt=\"Documentation\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c!-- --8\u003c-- [start:content] --\u003e\n|toqito⟩ focuses on providing numerical tools to study problems\nabout entanglement theory, nonlocal games, matrix analysis, and other\naspects of quantum information that are often associated with computer science.\n\n|toqito⟩ aims to fill the needs of quantum information researchers who want\nnumerical and computational tools for manipulating quantum states,\nmeasurements, and channels. It can also be used as a tool to enhance the\nexperience of students and instructors in classes about quantum\ninformation.\n\n## Installing\n\n|toqito⟩ is available via [PyPi](https://pypi.org/project/toqito/) for Linux, and macOS, with support for Python 3.10 to\n3.13.\n\n```sh\npip install toqito\n```\n\n## Examples\n\nFor the full documentation, please consult: [Documentation](https://vprusso.github.io/toqito/) | [Examples](https://vprusso.github.io/toqito/generated/gallery/)\n\n### Example: Nonlocal games\n\n[Nonlocal games](https://vprusso.github.io/toqito/generated/gallery/nonlocal_games/) are a mathematical framework\nthat abstractly models a physical system. The CHSH game is a subtype of nonlocal game referred to as an XOR game that\ncharacterizes the seminal [CHSH inequality](https://en.wikipedia.org/wiki/CHSH_inequality). \n\nFor XOR games, there exist optimization problems (that are provided via |toqito⟩) that one can compute to attain the\noptimal values of such games when the players use either a classical or quantum strategy.  \n\n```python\n# Calculate the classical and quantum value of the CHSH game.\nimport numpy as np\nfrom toqito.nonlocal_games.xor_game import XORGame\n\n# The probability matrix.\nprob_mat = np.array([[1/4, 1/4], [1/4, 1/4]])\n\n# The predicate matrix.\npred_mat = np.array([[0, 0], [0, 1]])\n\n# Define CHSH game from matrices.\nchsh = XORGame(prob_mat, pred_mat)\n\nchsh.classical_value()\n# 0.75\nchsh.quantum_value()\n# 0.8535533\n```\nIndeed, using a quantum strategy for the CHSH game gives the known optimal result of $\\frac{1}{4}\\left(2 +\n\\sqrt{2}\\right) \\approx 0.8535...$\n\n### Example: Quantum state distinguishability\n\nQuantum state distinguishability is a fundamental task in quantum information theory. Consider the set of four [Bell\nstates](https://en.wikipedia.org/wiki/Bell_state):\n\n$$\n\\begin{equation}\n    \\begin{aligned}\n        |\\psi_0\\rangle = \\frac{1}{\\sqrt{2}} \\left(|00\\rangle + |11\\rangle\\right), \\quad\n        |\\psi_1\\rangle = \\frac{1}{\\sqrt{2}} \\left(|00\\rangle - |11\\rangle\\right), \\\\ \n        |\\psi_2\\rangle = \\frac{1}{\\sqrt{2}} \\left(|01\\rangle + |10\\rangle\\right), \\quad\n        |\\psi_3\\rangle = \\frac{1}{\\sqrt{2}} \\left(|01\\rangle - |10\\rangle\\right).\n    \\end{aligned}\n\\end{equation}\n$$\n\nThe optimal probability of globally distinguishing the four Bell states (assuming an equal weighting of probability) is\n1 (i.e., it can be performed perfectly). However, under a more restrictive set of measurements (such as PPT measurement\noperators), the optimal probability of distinguishing the four Bell states using PPT operators is 1/2.\n\n|toqito⟩ offers a wide suite of functionality for computing the distinguishability of quantum states:\n\n```python\nfrom toqito.states import bell\nfrom toqito.state_opt import state_distinguishability, ppt_distinguishability\n\n# Define the set of states as the four Bell states:\nstates = [bell(0), bell(1), bell(2), bell(3)]\n\n# Distinguishing four Bell states (global measurements): 0.9999999999767388\npos_res, _ = state_distinguishability(states)\nprint(f\"Distinguishing four Bell states (global measurements): {pos_res}\")\n\n# Distinguishing four Bell states (PPT measurements): 0.5000000000098367\nppt_res, _ = ppt_distinguishability(states, subsystems=[0], dimensions=[2, 2])\nprint(f\"Distinguishing four Bell states (PPT measurements): {ppt_res}\")\n```\n\nConsult the [quantum state tutorials](https://vprusso.github.io/toqito/generated/gallery/quantum_states/) for\nadditional examples and information about quantum states within the context of |toqito⟩.\n\n## Testing\n\nThe `pytest` module is used for testing. To run the suite of tests for |toqito⟩,\nrun the following command in the root directory of this project.\n\n```\npytest --cov-report term-missing --cov=toqito\n```\n\n## Citing\n\nYou can cite |toqito⟩ using the following DOI:\n`10.5281/zenodo.4743211`\n\n\nIf you are using the |toqito⟩ software package in research work, please include\nan explicit mention of |toqito⟩ in your publication. Something along the lines\nof:\n\n```\nTo solve problem \"X\", we used |toqito⟩; a package for studying certain\naspects of quantum information.\n```\n\nA BibTeX entry that you can use to cite |toqito⟩ is provided here:\n\n```bib\n@misc{toqito,\n   author       = {Vincent Russo},\n   title        = {toqito: A {P}ython toolkit for quantum information},\n   howpublished = {\\url{https://github.com/vprusso/toqito}},\n   month        = May,\n   year         = 2021,\n   doi          = {10.5281/zenodo.4743211}\n }\n```\n\n## Research\n\nThe |toqito⟩ project is, first and foremost, a quantum information theory research tool. Consult the following [open\nproblems wiki\npage](https://github.com/vprusso/toqito/wiki/Research-open-problems-in-quantum-information-theory-using-%7Ctoqito%E2%9F%A9)\nfor a list of certain solved and unsolved problems in quantum information theory in which |toqito⟩ could be potentially\nhelpful in probing. Feel free to add to this list and/or contribute solutions!\n\nThe |toqito⟩ project has been used or referenced in the following works:\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2510.20789\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2510.20789) Lovitz, Benjamin and Johnston, Nathaniel and Russo, Vincent and Sikora, Jamie\n*\"The complexity of perfect quantum state classification\"*, arXiv:2510.20789, (2025).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2311.17047\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2311.17047) Johnston, Nathaniel and Russo, Vincent and Sikora, Jamie\n*\"Tight bounds for antidistinguishability and circulant sets of pure quantum states\"*, Quantum 9, 1622, (2025).\n\n- [![a](https://img.shields.io/static/v1?label=thesis\u0026message=31639397\u0026color=inactive\u0026style=flat-square)](https://www.proquest.com/openview/eb0021dd3eb463b5fb12b7fc71d920eb/1?cbl=18750\u0026diss=y\u0026pq-origsite=gscholar) Philip, Aby\n*\"On Multipartite Entanglement and Its Use\"*, (2024).\n\n- [![a](https://img.shields.io/static/v1?message=report\u0026color=inactive\u0026style=flat-square)](https://ali-almasi.github.io/assets/projects_materials/Internship_report.pdf) Almasi, Ali\n*\"Quantum Guessing Games\"*, (2024).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2409.08705\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2409.08705)\nGupta, Tathagata and Mushid, Shayeef and Russo, Vincent and Bandyopadhyay, Somshubhro\n*\"Optimal discrimination of quantum sequences\"*, Physical Review A, 110, 062426, (2024).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2406.13430\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2406.13430) Bandyopadhyay, Somshubhro and Russo, Vincent\n*\"Distinguishing a maximally entangled basis using LOCC and shared entanglement\"*, Physical Review A 110, 042406, (2024).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2307.2551\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2307.02551) Tavakoli, Armin and Pozas-Kerstjens, Alejandro and Brown, Peter and Araújo, Mateus\n*\"Semidefinite programming relaxations for quantum correlations\"*, Reviews of Modern Physics, Volume 96, (2024).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2308.15579\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2308.15579) Pelofske, Elijah and Bartschi, Andreas and Eidenbenz, Stephan and Garcia, Bryan and Kiefer, Boris\n*\"Probing Quantum Telecloning on Superconducting Quantum Processors\"*, IEEE Transactions on Quantum Engineering, (2024).\n \n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2303.07911\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2303.07911) Philip, Aby and Rethinasamy, Soorya and Russo, Vincent and Wilde, Mark. \n*\"Quantum Steering Algorithm for Estimating Fidelity of Separability\"*, Quantum 8, 1366, (2023).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2302.09401\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2302.09401) Miszczak, Jarosław Adam. \n*\"Symbolic quantum programming for supporting applications of quantum computing technologies\"*, Companion Proceedings of the 7th International Conference on the Art, Science, and Engineering of Programming, (2023).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2306.09444\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2306.09444) Casalé, Balthazar and Di Molfetta, Giuseppe and Anthoine, Sandrine and Kadri, Hachem. \n*\"Large-Scale Quantum Separability Through a Reproducible Machine Learning Lens\"*, (2023).\n\n- [![a](https://img.shields.io/static/v1?label=arXiv\u0026message=2206.08313\u0026color=inactive\u0026style=flat-square)](https://arxiv.org/abs/2206.08313) Russo, Vincent and Sikora, Jamie *\"Inner products of pure states and their antidistinguishability\"*, Physical Review A, Vol. 107, No. 3, (2023).\n\n## Contributing\n\nAll contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.\n\nA detailed overview of how to contribute can be found in the\n[contributing guide](https://vprusso.github.io/toqito/contributing-guide/).\n\nChat with us in our |toqito⟩ channel on [Discord](http://discord.unitary.fund/). \n\n## License\n\n[MIT License](http://opensource.org/licenses/mit-license.php\u003e)\n\u003c!-- --8\u003c-- [end:content] --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvprusso%2Ftoqito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvprusso%2Ftoqito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvprusso%2Ftoqito/lists"}