{"id":19943309,"url":"https://github.com/softwareqinc/qasm3tools","last_synced_at":"2025-05-03T15:33:03.741Z","repository":{"id":79133341,"uuid":"418501147","full_name":"softwareQinc/qasm3tools","owner":"softwareQinc","description":"OpenQASM 3.0 parser","archived":false,"fork":false,"pushed_at":"2025-01-24T15:01:58.000Z","size":5017,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T17:51:58.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/softwareQinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2021-10-18T12:54:24.000Z","updated_at":"2025-03-03T19:06:22.000Z","dependencies_parsed_at":"2023-12-20T10:51:14.583Z","dependency_job_id":"817e189e-3e6b-4e99-8635-13083b122d8e","html_url":"https://github.com/softwareQinc/qasm3tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwareQinc%2Fqasm3tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwareQinc%2Fqasm3tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwareQinc%2Fqasm3tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwareQinc%2Fqasm3tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwareQinc","download_url":"https://codeload.github.com/softwareQinc/qasm3tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252211718,"owners_count":21712452,"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-13T00:16:08.015Z","updated_at":"2025-05-03T15:33:01.649Z","avatar_url":"https://github.com/softwareQinc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qasm3tools\n\n[![GitHub actions](https://github.com/softwareqinc/qasm3tools/actions/workflows/cmake.yml/badge.svg)](https://github.com/softwareQinc/qasm3tools/actions)\n\n---\n\n## Setup\n\n```shell\ncmake -B build\ncmake --build build --parallel 8\n```\n\nThis creates the `parser` executable.\n\n```shell\n./parser /path/to/circuit.qasm\n```\n\n---\n\n## Interpreter\n\nTo build the interpreter, you must\nhave [qpp](https://github.com/softwareQinc/qpp) installed.\nExecute\n\n```shell\ncmake -B build -DWITH_INTERPRETER=ON\ncmake --build build --parallel 8\n```\n\nThis creates the `interpreter` executable. Usage:\n\n```shell\n./interpreter /path/to/circuit.qasm\n```\n\nIf the OpenQASM 3.0 file contains `n` input variables, then the interpreter\nrequires exactly `n` additional commandline arguments to specify their values.\nFor example, if the file contains\n\n```\ninput float[32] fl;\ninput bool bl;\n```\n\nThen it could be executed with\n\n```shell\n./interpreter example.qasm \"pi/2\" \"true\"\n```\n\n---\n\n## Unit testing\n\n```shell\ncmake --build build --target unit_tests --parallel 8\nctest --test-dir build\n```\n\n---\n\n## Notes\n\n1. The interpreter is implemented to *exclude* the endpoints of ranges. As of\n   August 10, 2022, in the OpenQASM 3.0 live specification, range endpoints are\n   included.\n\n2. The OpenQASM 3.0 standard library defines the `u3` and `u2` gates differently\n   than the Qiskit specifications.\n\n| Gate | OpenQASM 3.0                                                                                                                                                                                                                                                                                                                                            | Qiskit                                                                                                                                                                                                                                                                     | Phase inconsistency                                                                         |\n|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|\n| u3   | ![equation](https://latex.codecogs.com/gif.latex?%5Cbegin%7Bpmatrix%7De%5E%7B-i%28%5Cphi\u0026plus;%5Clambda%29/2%7D%5Ccos%28%5Ctheta/2%29%26-e%5E%7B-i%28%5Cphi-%5Clambda%29/2%7D%5Csin%28%5Ctheta/2%29%5C%5Ce%5E%7Bi%28%5Cphi-%5Clambda%29/2%7D%5Csin%28%5Ctheta/2%29%26e%5E%7Bi%28%5Cphi\u0026plus;%5Clambda%29/2%7D%5Ccos%28%5Ctheta/2%29%5Cend%7Bpmatrix%7D) | ![equation](https://latex.codecogs.com/gif.latex?%5Cbegin%7Bpmatrix%7D%5Ccos%28%5Ctheta/2%29%26-e%5E%7Bi%5Clambda%7D%5Csin%28%5Ctheta/2%29%5C%5Ce%5E%7Bi%5Cphi%7D%5Csin%28%5Ctheta/2%29%26e%5E%7Bi%28%5Cphi\u0026plus;%5Clambda%29%7D%5Ccos%28%5Ctheta/2%29%5Cend%7Bpmatrix%7D) | ![equation](https://latex.codecogs.com/gif.latex?e%5E%7B-i%28%5Cphi\u0026plus;%5Clambda%29/2%7D) |\n| u2   | ![equation](https://latex.codecogs.com/gif.latex?%5Ctfrac%7B1%7D%7B%5Csqrt%7B2%7D%7D%5Cbegin%7Bpmatrix%7De%5E%7B-i%28%5Cphi\u0026plus;%5Clambda%29/2%7D%26-e%5E%7B-i%28%5Cphi-%5Clambda%29/2%7D%5C%5Ce%5E%7Bi%28%5Cphi-%5Clambda%29/2%7D%26e%5E%7Bi%28%5Cphi\u0026plus;%5Clambda%29/2%7D%5Cend%7Bpmatrix%7D)                                                      | ![equation](https://latex.codecogs.com/gif.latex?%5Ctfrac%7B1%7D%7B%5Csqrt%7B2%7D%7D%5Cbegin%7Bpmatrix%7D1%26-e%5E%7Bi%5Clambda%7D%5C%5Ce%5E%7Bi%5Cphi%7D%26e%5E%7Bi%28%5Cphi\u0026plus;%5Clambda%29%7D%5Cend%7Bpmatrix%7D)                                                     | ![equation](https://latex.codecogs.com/gif.latex?e%5E%7B-i%28%5Cphi\u0026plus;%5Clambda%29/2%7D) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwareqinc%2Fqasm3tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwareqinc%2Fqasm3tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwareqinc%2Fqasm3tools/lists"}