{"id":21228955,"url":"https://github.com/quantum-software-development/quantikz","last_synced_at":"2025-03-15T02:13:27.981Z","repository":{"id":256681876,"uuid":"856116084","full_name":"Quantum-Software-Development/quantikz","owner":"Quantum-Software-Development","description":"# Quantikz: A Quantum Circuit Typesetting Tool for LaTeX","archived":false,"fork":false,"pushed_at":"2024-09-12T03:12:32.000Z","size":625,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T17:50:04.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/Quantum-Software-Development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Quantum-Software-Developmen","Custom":"https://github.com/sponsors/Quantum-Software-Development/card"}},"created_at":"2024-09-12T02:41:20.000Z","updated_at":"2024-09-12T03:12:35.000Z","dependencies_parsed_at":"2024-09-12T12:38:58.431Z","dependency_job_id":null,"html_url":"https://github.com/Quantum-Software-Development/quantikz","commit_stats":null,"previous_names":["quantum-software-development/quantikz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fquantikz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fquantikz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fquantikz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Software-Development%2Fquantikz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantum-Software-Development","download_url":"https://codeload.github.com/Quantum-Software-Development/quantikz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243672484,"owners_count":20328767,"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":[],"created_at":"2024-11-20T23:23:41.792Z","updated_at":"2025-03-15T02:13:27.951Z","avatar_url":"https://github.com/Quantum-Software-Development.png","language":null,"readme":"# Quantikz Tutorial - A Quantum Circuit Typesetting Tool for LaTeX\n\nWelcome to the **Quantikz** tutorial repository, designed to help you create elegant quantum circuit diagrams with LaTeX and the `Quantikz` package. This guide offers installation instructions, usage examples, and detailed explanations of Quantikz's features.\n\nQuantikz is a `TikZ`-based library that provides a more intuitive and customizable alternative to `QCircuit` for typesetting quantum circuits in LaTeX.\n\nThis tutorial summarizes Alastair Kay's paper, \"Tutorial on the Quantikz Package,\" and includes examples and tips for effective use of the package.\n\n## Overview\n\nQuantikz is a TikZ library designed for typesetting quantum circuits. It allows users to create diagrams in a matrix-like structure, enabling easy manipulation of quantum and classical wires, gates, and measurements.\n\n\n## Introduction\n\n**Quantikz** is a LaTeX package built on top of `TikZ`, designed specifically for typesetting quantum circuits. It serves as a modern alternative to `QCircuit`, with a simpler and more intuitive syntax. Whether you're new to quantum computing or a seasoned researcher, Quantikz allows you to create professional, publication-quality quantum circuits with ease.\n\n\n### Key Advantages:\n\n- **Quantum and Classical Wires**: Support for quantum, classical, and bundled wires.\n- **Customizable Gates**: Create a wide variety of gates, including single-qubit gates, multi-qubit gates, and controlled gates.\n- **Highlighting and Slicing**: Easily highlight parts of your circuit and slice it for step-by-step explanations.\n- **Backward Compatibility**: Quantikz offers features to convert from `QCircuit` and remains backward-compatible with older versions.\n\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Basic Usage](#basic-usage)\n    - [Quantum Wires](#quantum-wires)\n    - [Gates and Measurement](#gates-and-measurement)\n    - [Controlled Gates](#controlled-gates)\n    - [Labelling Circuits](#labelling-circuits)\n3. [Exporting Diagrams](#exporting-diagrams)\n4. [Commands and Options](#commands-and-options)\n5. [Converting from QCircuit](#converting-from-qcircuit)\n6. [Troubleshooting](#troubleshooting)\n7. [Citation](#citation)\n8. [License](#license)\n\n\n## Installation\n\nTo use Quantikz, ensure that your LaTeX distribution includes the `Quantikz` package. Most current TeX distributions should have it available. In your LaTeX document, include the following in the preamble:\n\n```latex\n\\usepackage{tikz}\n\\usetikzlibrary{quantikz2}\n```\n\nIf you're uploading to arXiv, you may need to manually include the Quantikz file by adding tikzlibraryquantikz2.code.tex to your project.\n\nBasic Usage\nQuantum Wires\nIn Quantikz, quantum circuits are organized in a matrix-like format. Each column is separated by \u0026, and new rows are created with \\\\. By default, all wires are quantum wires.\n\n```latex\n\\begin{quantikz}\n\u0026 \\gate{H} \u0026 \\ctrl{1} \u0026 \\gate{X} \u0026 \\meter{} \\\\\n\u0026 \\targ{}  \u0026 \\ctrl{-1} \u0026 \\gate{H} \u0026 \\meter{}\n\\end{quantikz}\n```\n\nThis creates a basic quantum circuit with Hadamard (H), controlled gate (ctrl), Pauli-X (X), and measurement gates.\n\nGates and Measurement\nUse the \\gate command to add gates. You can also add measurement gates (\\meter) and phase gates (\\phase):\n\n```latex\n\\begin{quantikz}\n\u0026 \\gate{H} \u0026 \\gate[2]{U} \u0026 \\gate{R_Z(\\theta)} \u0026 \\meter{} \\\\\n\u0026 \u0026 \u0026 \\phase{\\alpha} \u0026\n\\end{quantikz}\nControlled Gates\nFor controlled gates, use the \\ctrl and \\targ commands. Here's an example of a controlled gate and a swap gate:\n```\n\n```latex\n\\begin{quantikz}\n\u0026 \\ctrl{1} \u0026 \\targ{} \u0026 \\swap{1} \u0026 \\ctrl[vertical wire=c]{2} \u0026 \\\\\n\u0026 \\control{} \u0026 \\ctrl[open]{-1} \u0026 \\targX{} \u0026 \\gate{X} \u0026 \\\\\n\u0026\u0026\u0026\u0026 \\gate{U} \u0026 \\meter{} \\wire[u][1]{c}\n\\end{quantikz}\n```\n\n","funding_links":["https://github.com/sponsors/Quantum-Software-Developmen","https://github.com/sponsors/Quantum-Software-Development/card"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-software-development%2Fquantikz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantum-software-development%2Fquantikz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-software-development%2Fquantikz/lists"}