{"id":22911918,"url":"https://github.com/itsubaki/qasm","last_synced_at":"2025-05-09T01:33:44.602Z","repository":{"id":39749827,"uuid":"391618372","full_name":"itsubaki/qasm","owner":"itsubaki","description":"Quantum Computation Simulator with OpenQASM 3.0","archived":false,"fork":false,"pushed_at":"2025-05-05T04:15:53.000Z","size":837,"stargazers_count":16,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-05T04:31:44.246Z","etag":null,"topics":["openqasm","quantum-computation","quantum-computing"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/itsubaki/qasm","language":"Go","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/itsubaki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2021-08-01T12:15:55.000Z","updated_at":"2025-05-05T04:15:56.000Z","dependencies_parsed_at":"2024-04-13T05:24:11.735Z","dependency_job_id":"287c7e86-6016-4a6c-9cea-a1efaea6bd69","html_url":"https://github.com/itsubaki/qasm","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fqasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fqasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fqasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fqasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsubaki","download_url":"https://codeload.github.com/itsubaki/qasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174724,"owners_count":21865908,"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":["openqasm","quantum-computation","quantum-computing"],"created_at":"2024-12-14T04:19:11.331Z","updated_at":"2025-05-09T01:33:44.594Z","avatar_url":"https://github.com/itsubaki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qasm\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/itsubaki/qasm)](https://pkg.go.dev/github.com/itsubaki/qasm)\n[![Go Report Card](https://goreportcard.com/badge/github.com/itsubaki/qasm?style=flat-square)](https://goreportcard.com/report/github.com/itsubaki/qasm)\n[![tests](https://github.com/itsubaki/qasm/workflows/tests/badge.svg)](https://github.com/itsubaki/qasm/actions)\n[![codecov](https://codecov.io/gh/itsubaki/qasm/branch/main/graph/badge.svg?token=94KAQTK9KT)](https://codecov.io/gh/itsubaki/qasm)\n\n- Quantum Computation Simulator with [OpenQASM 3.0](https://openqasm.com)\n\n## Example\n\n```shell\n% go run cmd/repl/main.go                       \n\u003e\u003e OPENQASM 3.0;\n\u003e\u003e include \"testdata/stdgates.qasm\";\n\u003e\u003e \n\u003e\u003e qubit[2] q;\n[00][  0]( 1.0000 0.0000i): 1.0000\n\u003e\u003e h q[0];\n[00][  0]( 0.7071 0.0000i): 0.5000\n[10][  2]( 0.7071 0.0000i): 0.5000\n\u003e\u003e cx q[0], q[1];\n[00][  0]( 0.7071 0.0000i): 0.5000\n[11][  3]( 0.7071 0.0000i): 0.5000\n```\n\n```shell\n% go run cmd/repl/main.go\n\u003e\u003e OPENQASM 3.0;\n\u003e\u003e \n\u003e\u003e const float ratio = pi;\n\u003e\u003e \n\u003e\u003e int n = 2;\n\u003e\u003e if (n \u003e 0) { n = n*ratio; }\n\u003e\u003e\n\u003e\u003e print\nconst     : map[ratio:3.141592653589793]\nvariable  : map[n:6.283185307179586]\nbit       : map[]\nqubit     : map[]\ngate      : []\nsubroutine: []\n```\n\n```shell\n% go run cmd/lex/main.go \u003c testdata/bell.qasm\n[@-1,0:7='OPENQASM',\u003c1\u003e,1:0]\n[@-1,9:11='3.0',\u003c103\u003e,1:9]\n[@-1,12:12=';',\u003c63\u003e,1:12]\n[@-1,14:20='include',\u003c2\u003e,2:0]\n[@-1,22:46='\"testdata/stdgates.qasm\"',\u003c105\u003e,2:8]\n[@-1,47:47=';',\u003c63\u003e,2:33]\n[@-1,50:54='qubit',\u003c31\u003e,4:0]\n[@-1,55:55='[',\u003c56\u003e,4:5]\n[@-1,56:56='2',\u003c91\u003e,4:6]\n[@-1,57:57=']',\u003c57\u003e,4:7]\n[@-1,59:59='q',\u003c93\u003e,4:9]\n[@-1,60:60=';',\u003c63\u003e,4:10]\n[@-1,63:63='h',\u003c93\u003e,6:0]\n[@-1,65:65='q',\u003c93\u003e,6:2]\n[@-1,66:66='[',\u003c56\u003e,6:3]\n[@-1,67:67='0',\u003c91\u003e,6:4]\n[@-1,68:68=']',\u003c57\u003e,6:5]\n[@-1,69:69=';',\u003c63\u003e,6:6]\n[@-1,71:72='cx',\u003c93\u003e,7:0]\n[@-1,74:74='q',\u003c93\u003e,7:3]\n[@-1,75:75='[',\u003c56\u003e,7:4]\n[@-1,76:76='0',\u003c91\u003e,7:5]\n[@-1,77:77=']',\u003c57\u003e,7:6]\n[@-1,78:78=',',\u003c65\u003e,7:7]\n[@-1,80:80='q',\u003c93\u003e,7:9]\n[@-1,81:81='[',\u003c56\u003e,7:10]\n[@-1,82:82='1',\u003c91\u003e,7:11]\n[@-1,83:83=']',\u003c57\u003e,7:12]\n[@-1,84:84=';',\u003c63\u003e,7:13]\n```\n\n```shell\ngo run cmd/parse/main.go \u003c testdata/bell.qasm\n(program\n  (version OPENQASM 3.0 ;)\n  (statementOrScope\n    (statement\n      (includeStatement include \"testdata/stdgates.qasm\" ;)))\n  (statementOrScope\n    (statement\n      (quantumDeclarationStatement\n        (qubitType qubit (designator [ (expression 2) ])) q ;)))\n  (statementOrScope\n    (statement\n      (gateCallStatement h\n        (gateOperandList\n          (gateOperand\n            (indexedIdentifier q (indexOperator [ (expression 0) ])))\n        ;))))\n  (statementOrScope\n    (statement\n      (gateCallStatement cx\n        (gateOperandList\n          (gateOperand\n            (indexedIdentifier q (indexOperator [ (expression 0) ]))),\n          (gateOperand\n            (indexedIdentifier q (indexOperator [ (expression 1) ])))\n        ;))))\n  \u003cEOF\u003e)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fqasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsubaki%2Fqasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fqasm/lists"}