{"id":20463151,"url":"https://github.com/syall/sipf","last_synced_at":"2026-03-19T16:01:04.393Z","repository":{"id":51367548,"uuid":"350972761","full_name":"syall/SIPF","owner":"syall","description":"Qubit Allocation as a combination of the Subgraph Isomorphism and Token Swapping Algorithms by Partitioning with a Failure Heuristic.","archived":false,"fork":false,"pushed_at":"2021-05-14T05:00:42.000Z","size":4681,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T00:55:40.545Z","etag":null,"topics":["compiler","quantum-computing","qubit-allocation"],"latest_commit_sha":null,"homepage":"http://sipf.syall.work","language":"OpenQASM","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/syall.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":"2021-03-24T06:39:09.000Z","updated_at":"2023-11-23T00:29:04.000Z","dependencies_parsed_at":"2022-09-24T22:24:20.836Z","dependency_job_id":null,"html_url":"https://github.com/syall/SIPF","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/syall%2FSIPF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syall%2FSIPF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syall%2FSIPF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syall%2FSIPF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syall","download_url":"https://codeload.github.com/syall/SIPF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242023194,"owners_count":20059297,"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":["compiler","quantum-computing","qubit-allocation"],"created_at":"2024-11-15T13:09:36.034Z","updated_at":"2026-03-08T11:37:49.998Z","avatar_url":"https://github.com/syall.png","language":"OpenQASM","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SIPF\n\nSteven Yuan\n\nProfessor Zhang\n\n16:198:516 Programming Languages and Compilers II\n\n5/12/2021\n\n## Overview\n\nSIPF is an algorithm that frames Qubit Allocation as a combination of the Subgraph Isomorphism and Token Swapping Algorithms by Partitioning with a Failure Heuristic.\n\n## Documents\n\n- [Report](./docs/REPORT.md)\n- [Report (pdf)](./docs/REPORT.pdf)\n- [Presentation](https://youtu.be/-6RpNGGDgp4)\n- [Proposal](./docs/PROPOSAL.md)\n- [Lab 1](./docs/LAB1.md)\n\n## Usage\n\n### Dependencies\n\nAt least C++11.\n\n### Building\n\n- `make`: compile the `mapper` binary\n- `make debug`: compile the `mapper` binary with debug flags\n- `make clean`: remove compiled files\n\n### Input\n\n`mapper path/to/circuit.qasm path/to/coupling.txt [-optimal]`\n\n- `path/to/circuit.qasm`: QASM circuit file (see `qelib1.inc` for available quantum gates)\n- `path/to/coupling.txt`: coupling graph file (see `couplings/` for example architectures)\n- `-optimal`: optimal allocator (optional)\n\nExamples:\n\n- `mapper circuits/3qubits/or.qasm couplings/qx2.txt`\n- `mapper circuits/5qubits/4gt13_92.qasm couplings/2x3.txt -optimal`\n\n### Output\n\nModified Transformed Circuit with metadata and comments to standard output.\n\nExample:\n\n```text\n$ mapper circuits/3qubits/or.qasm couplings/qx2.txt\n//Number of Swaps: 0\n//Number of Mappings: 1\n//Depth: 8\n//Number of Gates: 17\nOPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[5];\n//Location of qubits: 0,1,2\nx q[0];\ntdg q[1];\nh q[2];\ncx q[2], q[1];\ntdg q[0];\nt q[1];\ntdg q[2];\ncx q[0], q[1];\nsdg q[2];\ncx q[2], q[0];\nt q[1];\nt q[0];\ncx q[2], q[1];\ntdg q[1];\ncx q[2], q[0];\ncx q[0], q[1];\nh q[2];\n```\n\n## Benchmarks\n\n### Set up Submodules\n\nRun `git submodule update --init --recursive` to pull the git submodules:\n\n- `enfield`\n- `jsoncpp`\n- `QUEKO-benchmark`\n\n### Generic Benchmarks\n\n#### Running\n\nModify and run `feedback.sh` with the variables:\n\n- `output`: define output directory\n- Line 48: toggle the `-optimal` flag\n\n#### Evaluating\n\nIn the `output/` directory's `record.txt` file, remove any tests that were `Assertion failed` or `No Mappings Possible`.\n\nRun `node report.js path/to/record.txt` to get the columns and values: circuit and coupling, depth, number of gates, real time, and user + sys time.\n\n### Enfield Compiler\n\n#### Compilation\n\nFollow the instructions in the `README.md` file of the `enfield` repository (path to `jsoncpp` is path to the git submodule `jsoncpp`).\n\n#### Running Enfield\n\nModify and run `./feedback-enfield.sh` with the variables:\n\n- `output`: define output directory\n- Line 48: modify input arguments to the `efd` program\n  - `efd` is in `enfield/build/tools/efd`\n  - `-i`: input QASM file\n  - `-alloc`: define qubit allocator\n  - `-stats`: show statistics\n  - `-arch-file`: input coupling graph file (in JSON)\n\n#### Evaluating Enfield\n\nIn the `output/` directory's `record.txt` file, remove any tests that were `Killed` or `ERROR`.\n\nRun `node report-enfield.js path/to/record.txt` to get the columns and values: circuit and coupling, depth, number of gates, real time, and user + sys time.\n\n### Lab 1 Benchmarks\n\nCheckout the `lab1-review` branch.\n\nRebuild the `mapper` binary.\n\nRun:\n\n- `lab1.sh` for generic initial mappings\n- `lab1-queko.sh` for `QUEKO-benchmark` initial mappings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyall%2Fsipf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyall%2Fsipf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyall%2Fsipf/lists"}