{"id":16835390,"url":"https://github.com/defuse/qcircuitgen","last_synced_at":"2025-06-25T08:36:01.609Z","repository":{"id":26703638,"uuid":"30160744","full_name":"defuse/qcircuitgen","owner":"defuse","description":"Easily draw quantum circuits for LaTeX's picture environment","archived":false,"fork":false,"pushed_at":"2015-02-13T01:42:52.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T02:35:25.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-01T21:37:20.000Z","updated_at":"2023-12-07T13:28:21.000Z","dependencies_parsed_at":"2022-08-29T09:31:28.164Z","dependency_job_id":null,"html_url":"https://github.com/defuse/qcircuitgen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/defuse/qcircuitgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fqcircuitgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fqcircuitgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fqcircuitgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fqcircuitgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defuse","download_url":"https://codeload.github.com/defuse/qcircuitgen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fqcircuitgen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261836488,"owners_count":23217233,"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-10-13T12:10:03.193Z","updated_at":"2025-06-25T08:36:01.581Z","avatar_url":"https://github.com/defuse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Quantum Circuit Generator for LaTeX\n======================================\n\nThis is a script that takes an ASCII representation of a quantum circuit and\ngenerates commands to draw it in LaTeX's `picture` environment.\n\nTo use it, you must first copy the gates.tex file into the same folder as your\ndocument and then, *once*, do:\n\n    \\input{gates.tex}\n\nThe `picture` command generated by the script can be placed anywhere in your\ndocument below that line.\n\nThis script takes a text description of the circuit as input. Circuits are\nencoded as follows:\n\n1. Each line of the file is one qubit (horizontal line in the circuit).\n2. Each character on a line corresponds to what to draw from that position. This\n   could be a single-qubit gate (e.g. `Z` for the Z gate), or part of\n   a multi-qubit gate with a line extending upwards or downwards (explained\n   below).\n\nYou can draw circuits using the following primitives:\n\n- Single Qubit Gates: `X`, `Z`, `H`, and `I` (identity).\n- Control lines: `U` for a control dot with a line going up, *leaving room for\n  a boxed gate above*, and `P` for a control dot with a line going up, *touching\n  the line above*. Similarly, for control lines going down, `D` (leaving room\n  for a boxed gate below), and `N` (touching the line below).\n- For the XOR/OPLUS symbol part of a CNOT gate, use `O`.\n- For circuits with more than two qubits, you may have to draw a line \"crossing\n  over\" another one without touching. This can be done using `L` (going up) and\n  `V` going down.\n- Swap gates can be drawn by putting an `S` on the topmost qubit of the swap and\n  `W` on the bottommost qubit of the swap (with optional crossover lines with\n  `L` as necessary).\n\nYour input is not sanity checked, i.e. you can have lines extending upward from\nthe top qubit, so make sure you get your input right.\n\nExample\n=========\n\nHere is a three-qubit circuit illustrating how to use the primitives:\n\n    SSHXIHNN\n    WLHZONNV\n    IWUIPOOO\n\nOnce the output commands are rendered, it looks like:\n\n![Circuit Image](https://defuse.ca/images/quantum-circuit-example2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fqcircuitgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefuse%2Fqcircuitgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fqcircuitgen/lists"}