{"id":20131252,"url":"https://github.com/glassnotes/queko-generator","last_synced_at":"2025-03-02T21:44:36.134Z","repository":{"id":85604828,"uuid":"430117329","full_name":"glassnotes/QUEKO-Generator","owner":"glassnotes","description":"Generate QUEKO circuits in Python","archived":false,"fork":false,"pushed_at":"2021-12-16T16:09:36.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T08:46:53.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/glassnotes.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}},"created_at":"2021-11-20T13:57:49.000Z","updated_at":"2024-05-28T17:34:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f1086c5-c396-49ac-aca5-d024e3fea2ee","html_url":"https://github.com/glassnotes/QUEKO-Generator","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/glassnotes%2FQUEKO-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassnotes%2FQUEKO-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassnotes%2FQUEKO-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassnotes%2FQUEKO-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glassnotes","download_url":"https://codeload.github.com/glassnotes/QUEKO-Generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241577070,"owners_count":19984940,"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-13T20:47:08.620Z","updated_at":"2025-03-02T21:44:35.922Z","avatar_url":"https://github.com/glassnotes.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QUEKO circuit generator\n\nGenerates *quantum mapping examples with known optimal* which can be used for benchmarking qubit allocation (placement) techniques. The tool is written in Python and follows Algorithm 1 in the [original QUEKO paper](https://arxiv.org/abs/2002.09783) by Tan and Cong.\n\n## Requirements\n\n - `numpy`\n - `networkx`\n\n## Example\n\nQUEKO circuits are hardware-graph dependent, so we first construct a graph.\n\n```pycon\n\u003e\u003e\u003e G = nx.Graph()\n\u003e\u003e\u003e G.add_nodes_from(list(range(5)))\n\u003e\u003e\u003e G.add_edges_from([(0, 1), (0, 2), (1, 2), (2, 3), (2, 4), (3, 4)])\n```\n\nNext, we choose a target depth (10), and a gate density vector ([0.2, 0.3]) for single- and two-qubit gates respectively.\n\n```pycon\n\u003e\u003e\u003e qasm_string, perm = queko_circuit(G, 10, [0.2, 0.3])\n```\n\nThe output consists of the representation of the circuit in QASM format:\n\n```pycon\n\u003e\u003e\u003e print(qasm_string)\nOPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[5];\nx q[0];\ncx q[2], q[1];\ncx q[0], q[3];\nx q[3];\ncx q[0], q[4];\nx q[3];\nx q[2];\ncx q[0], q[4];\nx q[3];\nx q[4];\nx q[3];\ncx q[2], q[1];\nx q[0];\ncx q[3], q[2];\nx q[2];\ncx q[0], q[4];\nx q[2];\ncx q[2], q[1];\n```\n\nas well as the permutation applied to the qubits (which is what the qubit allocation method needs to find).\n\n```pycon\n\u003e\u003e\u003e print(perm)\n[0 4 3 2 1]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassnotes%2Fqueko-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglassnotes%2Fqueko-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassnotes%2Fqueko-generator/lists"}