########################## Ket Quantum Programming ########################## Ke is a high-level quantum programming platform for writing, simulating, and executing quantum algorithms in Python, without sacrificing performance or control. - 🧠 **Expressive quantum language** embedded in Python - āš™ļø **High-performance runtime** written in Rust - šŸ“„ Backed by peer-reviewed research Ket bridges the gap between quantum theory, software engineering, and efficient execution, enabling researchers, students, and developers to build quantum-accelerated software with clarity and confidence. .. admonition:: Aprenda Ket šŸ‡§šŸ‡· :class: tip A complete **Portuguese** course is available at `aprenda.quantumket.org `_, covering linear algebra, quantum mechanics, and quantum algorithms, with hands-on examples using Ket. What is Ket? ============ Ket is a full quantum programming platform designed to make quantum development **concise**, **readable**, and **efficient**. It allows you to express quantum algorithms using familiar Python syntax while relying on an optimized runtime and simulators behind the scenes. .. image:: _static/ket_runtime.svg :width: 100% :class: only-light, no-scaled-link :alt: Ket applications communicate with the runtime library Libket, and Libket communicates with the quantum simulator KBW .. image:: _static/ket_runtime_dark.svg :width: 100% :class: only-dark, no-scaled-link :alt: Ket applications communicate with the runtime library Libket, and Libket communicates with the quantum simulator KBW The platform consists of three main components: - `Ket `_ (Python Package) A Python-embedded quantum language that provides only the essential abstractions required for expressive and efficient quantum programming. - Minimal and explicit quantum constructs - Designed for algorithm clarity - Ideal for education and research - `Libket `_ (Runtime Library) A high-performance runtime library written in Rust, responsible for compilation, optimization, and execution of quantum programs. - Used transparently by Ket - Also accessible directly via C or Rust APIs - `KBW `_ (Ket Bitwise Simulator) A noise-free quantum simulator for executing quantum programs on classical hardware. - Dense and sparse simulation methods - CPU and GPU-accelerated backends Getting Started =============== Installation ~~~~~~~~~~~~ Ket requires `Python 3.10 or newer `_ and supports Linux, Windows, and macOS (Apple Silicon and Intel). Install Ket directly from the `Python Package Index (PyPI) `_ using ``pip``: .. code-block:: bash python3 -m pip install ket-lang .. note:: On non-x86_64 Linux or Windows systems (e.g., ARM), `Rust `_ is required to build native components. Your First Quantum Program ~~~~~~~~~~~~~~~~~~~~~~~~~~ Create and simulate a Bell state in just a few lines of Python: .. code-block:: py from ket import * p = Process() a, b = p.alloc(2) CNOT(H(a), b) print(dump(a + b).show()) Run the program using: .. code-block:: console $ python3 bell.py |00⟩ (50.00%) 0.707107 ≅ 1/√2 |11⟩ (50.00%) 0.707107 ≅ 1/√2 This example demonstrates superposition, entanglement, and state inspection using Ket. Simulation Backends =================== Ket includes multiple simulators with different performance characteristics, allowing you to choose the best option for your workload. - ``"sparse"`` Sparse simulator with limited multithreading support. - ``"dense"`` Dense state-vector simulator with good multithreaded performance. - ``"dense v2"`` Dense simulator with a reduced memory footprint. - ``"dense gpu"`` GPU-accelerated dense simulator supporting Intel, AMD, Apple, and NVIDIA GPUs. Recommended for simulations with a large number of qubits. .. tip:: Benchmarking is recommended to determine the most suitable simulator for a given algorithm. Research & Publications ======================= Ket is an academically grounded platform with multiple peer-reviewed publications describing its language design, runtime architecture, and compilation strategies. .. tab:: ACM Ref .. card:: Evandro Chagas Ribeiro Da Rosa and Rafael De Santiago. 2022. **Ket Quantum Programming**. J. Emerg. Technol. Comput. Syst. 18, 1 (January 2022), 1-25. https://doi.org/10.1145/3474224 .. card:: Evandro C. R. Rosa, Eduardo I. Duzzioni, and Rafael De Santiago. 2025. **Optimizing Gate Decomposition for High-Level Quantum Programming**. Quantum 9, (March 2025), 1659. https://doi.org/10.22331/q-2025-03-12-1659 .. card:: Evandro C. R. Rosa, Jerusa Marchi, Eduardo I. Duzzioni, and Rafael De Santiago. 2025. **Quantum Gate Decomposition: A Study of Compilation Time vs. Execution Time Trade-offs**. In Anais do XXIX Simpósio Brasileiro de Linguagens de Programação (SBLP 2025), September 22, 2025. Sociedade Brasileira de Computação, Brasil, 10-18. https://doi.org/10.5753/sblp.2025.10459 .. card:: Evandro Rosa, Eduardo Lussi, Jerusa Marchi, Rafael De Santiago, and Eduardo Duzzioni. 2026. **Full Quantum Stack: Ket Platform**. Braz J Phys 56, 1 (February 2026), 45. https://doi.org/10.1007/s13538-025-01981-w .. tab:: BibTeX .. code-block:: bib @article{ket2022, title = {Ket Quantum Programming}, volume = {18}, issn = {1550-4832, 1550-4840}, url = {https://dl.acm.org/doi/10.1145/3474224}, doi = {10.1145/3474224}, language = {en}, number = {1}, urldate = {2026-01-08}, journal = {ACM Journal on Emerging Technologies in Computing Systems}, author = {Da Rosa, Evandro Chagas Ribeiro and De Santiago, Rafael}, month = jan, year = {2022}, pages = {1--25}, } @article{ket2025a, title = {Optimizing Gate Decomposition for High-Level Quantum Programming}, doi = {10.22331/q-2025-03-12-1659}, volume = {9}, issn = {2521-327X}, language = {en}, urldate = {2026-01-08}, journal = {Quantum}, author = {Rosa, Evandro C. R. and Duzzioni, Eduardo I. and De Santiago, Rafael}, month = mar, year = {2025}, pages = {1659}, } @inproceedings{ket2025b, title = {Quantum Gate Decomposition: A Study of Compilation Time vs. Execution Time Trade-offs}, doi = {10.5753/sblp.2025.10459}, urldate = {2026-01-08}, booktitle = {Anais do XXIX Simpósio Brasileiro de Linguagens de Programação (SBLP 2025)}, address = {Brasil}, publisher = {Sociedade Brasileira de Computação}, author = {Rosa, Evandro C. R. and Marchi, Jerusa and Duzzioni, Eduardo I. and Santiago, Rafael De}, month = sep, year = {2025}, pages = {10--18}, } @article{ket2026, title = {Full Quantum Stack: Ket Platform}, doi = {10.1007/s13538-025-01981-w}, volume = {56}, issn = {0103-9733, 1678-4448}, language = {en}, number = {1}, urldate = {2026-01-08}, journal = {Brazilian Journal of Physics}, author = {Rosa, Evandro and Lussi, Eduardo and Marchi, Jerusa and De Santiago, Rafael and Duzzioni, Eduardo}, month = feb, year = {2026}, pages = {45}, } Used in Research ================ Ket has been used in peer-reviewed research across optimization, simulation, and feedback-based quantum algorithms. .. card:: Otto Menegasso Pires, Rafael De Santiago, and Jerusa Marchi. 2021. **Two Stage Quantum Optimization for the School Timetabling Problem**. In 2021 IEEE Congress on Evolutionary Computation (CEC), June 28, 2021. IEEE, Kraków, Poland, 2347-2353. https://doi.org/10.1109/CEC45853.2021.9504701 .. card:: LetĆ­cia Bertuzzi, JoĆ£o P. Engster, Evandro C. R. Da Rosa, and Eduardo I. Duzzioni. 2025. **Shadow measurements for feedback-based quantum optimization**. Phys. Rev. A 112, 2 (August 2025), 022419. https://doi.org/10.1103/snht-7jsf Ket API Documentation ===================== .. autosummary:: :toctree: ket :template: autosummary/ket.rst :recursive: ket .. toctree:: :maxdepth: 2 :hidden: guide runtime ibm algorithms/index Source Code ---------------- .. image:: _static/sponsor.svg :width: 66% :class: only-light, no-scaled-link :alt: Sponsored by Quantuloop :target: https://quantuloop.com .. image:: _static/sponsor_dark.svg :width: 66% :class: only-dark, no-scaled-link :alt: Sponsored by Quantuloop :target: https://quantuloop.com