{"id":19146491,"url":"https://github.com/kahsolt/adiabatic-linear-solver-qpanda","last_synced_at":"2026-06-17T08:32:12.234Z","repository":{"id":248495124,"uuid":"809575026","full_name":"Kahsolt/Adiabatic-Linear-Solver-QPanda","owner":"Kahsolt","description":"Block Encodings \u0026 Quantum Discrete Adiabatic Linear-systems Solver implemented in QPanda (C++)","archived":false,"fork":false,"pushed_at":"2024-07-15T07:50:48.000Z","size":44268,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T19:49:45.862Z","etag":null,"topics":["adiabatic-linear-solver","adiabatic-quantum-computing","contest-solution","pyqpanda","qpanda","quantum-computing"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Kahsolt.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":"2024-06-03T03:15:01.000Z","updated_at":"2024-07-15T07:51:50.000Z","dependencies_parsed_at":"2024-07-15T10:52:45.387Z","dependency_job_id":null,"html_url":"https://github.com/Kahsolt/Adiabatic-Linear-Solver-QPanda","commit_stats":null,"previous_names":["kahsolt/adiabatic-linear-solver-qpanda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kahsolt/Adiabatic-Linear-Solver-QPanda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FAdiabatic-Linear-Solver-QPanda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FAdiabatic-Linear-Solver-QPanda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FAdiabatic-Linear-Solver-QPanda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FAdiabatic-Linear-Solver-QPanda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kahsolt","download_url":"https://codeload.github.com/Kahsolt/Adiabatic-Linear-Solver-QPanda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kahsolt%2FAdiabatic-Linear-Solver-QPanda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34441284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["adiabatic-linear-solver","adiabatic-quantum-computing","contest-solution","pyqpanda","qpanda","quantum-computing"],"created_at":"2024-11-09T07:44:19.644Z","updated_at":"2026-06-17T08:32:12.205Z","avatar_url":"https://github.com/Kahsolt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adiabatic-Linear-Solver-QPanda\n\n    Block Encodings \u0026 Quantum Discrete Adiabatic Linear-systems Solver implemented in QPanda (C++)\n    第三届CCF“司南杯”量子计算编程挑战赛-通用赛道 决赛\n\n----\n\n比赛页面: [第三届CCF“司南杯”量子计算编程挑战赛通用赛道](https://learn.originqc.com.cn/zh/contest/list/34/contest:introduction)\n队名: 我吃两个  \n得分: 85.67 (复赛) / 81.67 (答辩)  \n获奖: 三等奖 (wtf???  \n\n👉 初赛的 repo 在这里：[CCF-3rd-Pilot-Cup-first-stage](https://github.com/Kahsolt/CCF-3rd-Pilot-Cup-first-stage)\n\n### Quickstart\n\n- `git clone https://github.com/Kahsolt/QLSDA-QPanda`\n  - add `--recursive` if you want QPanda as well\n- install the C++ version [QPanda](https://github.com/OriginQ/QPanda-2), building from source... 😈\n  - modify `QPANDA_INSTALL_DIR` in [CMakeLists.txt](./CMakeLists.txt) according to your installation\n- just run `make` or `bash ./run.sh` 😀🎉\n\nThis is the demo run for final linear solver solution:\n\n![demo](img/LS_demo.png)\n\nℹ Note that there are **two** folders containing source files:\n\n- [/playground](/playground): pennylane tutorials, pure numerical simulations for quick idea verification, debugging scipts\n- [/src](/src): the real quantum logical circuit implementation in QPanda (C++) and PyQPanda (python)\n\n\n### Implementation\n\n⚪ block encoding\n\n👉 详细文档参见 [BlockEncoding.md](doc/BlockEncoding.md)  \n😈 BlockEncoding 可能是一个非常危险的突破性技术：以后人们只是基于线性代数去设计算法，然后调用 `block_encode + matrix_decompose` 来在量子计算机上运行一切程序  \n\n| Method | restriction | gate implementation | sub-normalizer | ancilla qubits | complex-value support |\n| :-: | :-: | :-: | :-: | :-: | :-: |\n| [QSVT-like](https://pennylane.ai/qml/demos/tutorial_intro_qsvt/) | $ σ_{max} = \\|\\|A\\|\\|_2 \\leq 1 $ | use matrix_decompose methods (cannot generally implement with $ \\mathcal{O}(poly(n)) $ gates) | - | 1 | ✅ |\n| [LCU](https://pennylane.ai/qml/demos/tutorial_lcu_blockencoding/) | $ A = \\sum\\limits_{k=0}^{N-1} \\alpha_k U_k $ | $ U_A = \\mathrm{PREP}^\\dagger \\cdot \\mathrm{SEL} \\cdot \\mathrm{PREP} $ | $ 1 / \\sum_k \\|\\alpha_k\\| $ | $ \\lceil log_2(k) \\rceil $ | ❌ |\n| [ARCSIN](https://arxiv.org/abs/2402.17529) | $ d $-sparse $, \\|a_{ij}\\| \\le 1 $ | $ U_A = (I_1 \\otimes H^{\\otimes n} \\otimes I_n) (I_1 \\otimes \\mathrm{SWAP}) O_A (X \\otimes H^{\\otimes n} \\otimes I_n) $ | $ 1 / 2^n $ | $ n + 1 $ | ✅ |\n| [FABLE](https://arxiv.org/abs/2205.00081) | $ d $-sparse $, \\|a_{ij}\\| \\le 1 $ | $ U_A = (I_1 \\otimes H^{\\otimes n} \\otimes I_n) (I_1 \\otimes \\mathrm{SWAP}) O_A (I_1 \\otimes H^{\\otimes n} \\otimes I_n) $ | $ 1 / 2^n $ | $ n + 1 $ | ❌ |\n\n| Precision Check | Generated Circuit |\n| :-: | :-: |\n| ![demo](img/BE_unittest.png) | ![demo](img/BE_demo.png) |\n\n⚪ adiabatic-inspired linear system solver\n\n👉 详细文档参见 [LinearSolver.md](doc/LinearSolver.md)  \n\n| Method | year | sched func $ f(s) $ | time complexity | query complexity (EF paper listed) | query complexity (QDA paper listed) |\n| :-: | :-: | :-: | :-: | :-: | :-: |\n| [RM (algo-1)](https://arxiv.org/abs/1805.10549) | 2018 | $ \\text{v-func} $ | $ \\mathcal{O}(\\kappa^2 \\mathrm{log}(\\kappa) / \\epsilon) $ | $ \\mathcal{O}(\\kappa / \\epsilon) $ |  |\n| [RM (algo-2)](https://arxiv.org/abs/1805.10549) | 2018 | $ \\text{v-func} $ | $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa) / \\epsilon) $ | $ \\mathcal{O}(\\kappa / \\epsilon) $ | $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa) / \\epsilon) $ |\n| [vanilla AQC](https://arxiv.org/abs/1909.05500) | 2019 | $ \\text{linear} $ | $ \\mathcal{O}(\\kappa^3 / \\epsilon) $ | $ \\mathcal{O}(\\kappa^2 / \\epsilon) $ |  |\n| [AQC(P)](https://arxiv.org/abs/1909.05500)      | 2019 | $ \\text{poly} $ | $ \\mathcal{O}(\\kappa / \\epsilon) \\sim \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa) / \\epsilon) $ | $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa) \\mathrm{loglog}(\\kappa)) $ for $ \\mathcal{O}(1) $ precision |  |\n| [AQC(EXP)](https://arxiv.org/abs/1909.05500)    | 2019 | $ \\text{exp} $  | $ \\mathcal{O}(\\kappa \\mathrm{log}^2(\\kappa) \\mathrm{log}^4(\\mathrm{log}(\\kappa)/\\epsilon)) $ | $ \\mathcal{O}(\\kappa \\mathrm{polylog}(1 / \\epsilon)) $ | $ \\mathcal{O}(\\kappa \\mathrm{polylog}(\\kappa / \\epsilon)) $ |\n| [EF](https://arxiv.org/abs/1910.14596) (partial)  | 2019 | $ \\text{poly} $ |  | $ \\mathcal{O}(\\kappa \\mathrm{log}(1 / \\epsilon)) $ | $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa / \\epsilon)) $ |\n| [QDA](https://arxiv.org/abs/2111.08152) (partial) | 2021 | $ \\text{poly} $ |  |  | $ \\mathcal{O}(\\kappa \\mathrm{log}(1 / \\epsilon)) $ |\n| [EQLS](https://arxiv.org/abs/2305.11352) (partial) | 2023 | $ \\text{v-func} $ | $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa / \\epsilon)) $ |  |  |\n\nℹ Note that $ \\mathcal{\\Omega}(\\kappa \\mathrm{log}(1 / \\epsilon)) $ is the theoretical lower bound for sparse QLSP\n\n\u003e Obviously there is an argument between QDA and EF, that EF overlooked a factor by $ \\mathrm{log}(k) $? 🤔\n\u003e - EF := AQC(P) + EF = $ \\mathcal{O}(\\kappa \\mathrm{log}(\\kappa) \\mathrm{loglog}(\\kappa)) + \\mathcal{O}(\\kappa \\mathrm{log}(1 / \\epsilon)) $\n\u003e - QDA := QWalk + EF = $ \\mathcal{O}(\\kappa) + \\mathcal{O}(\\kappa \\mathrm{log}(1 / \\epsilon)) $\n\u003e - EQLS: = RM + EF\n\u003e OK then, QDA might be right: EF forgot to count for its AQC(p) part\n\n\n### references\n\n- dev\n  - QPanda (C++): [https://github.com/OriginQ/QPanda-2](https://github.com/OriginQ/QPanda-2)\n  - Eigen lib: [https://eigen.tuxfamily.org/dox/index.html](https://eigen.tuxfamily.org/dox/index.html)\n  - pennylane: [https://github.com/PennyLaneAI/pennylane](https://github.com/PennyLaneAI/pennylane)\n- thesis\n  - [1] Optimal scaling quantum linear systems solver via discrete adiabatic theorem: [https://arxiv.org/abs/2111.08152](https://arxiv.org/abs/2111.08152)\n    - report lecture (2022): [https://www.youtube.com/watch?v=qEA37SfxPEs](https://www.youtube.com/watch?v=qEA37SfxPEs)\n  - [3] Quantum algorithm for systems of linear equations with exponentially improved dependence on precision: [https://arxiv.org/abs/1511.02306](https://arxiv.org/abs/1511.02306)\n    - report lecture (2015): [https://www.youtube.com/watch?v=IdCCn2X5dW4](https://www.youtube.com/watch?v=IdCCn2X5dW4)\n  - [4] Hamiltonian Simulation by Qubitization: [https://arxiv.org/abs/1610.06546](https://arxiv.org/abs/1610.06546)\n  - [5] Quantum linear system solver based on time-optimal adiabatic quantum computing and quantum approximate optimization algorithm: [https://arxiv.org/abs/1909.05500](https://arxiv.org/abs/1909.05500)\n    - report lecture (2020): [https://www.youtube.com/watch?v=RiRaHGEvlZE](https://www.youtube.com/watch?v=RiRaHGEvlZE)\n  - The discrete adiabatic quantum linear system solver has lower constant factors than the randomised adiabatic solver: [https://arxiv.org/abs/2312.07690](https://arxiv.org/abs/2312.07690)\n    - report lecture (2024): [https://www.youtube.com/watch?v=WfByvOf3N3Y](https://www.youtube.com/watch?v=WfByvOf3N3Y)\n  - Quantum Computation by Adiabatic Evolution: [https://arxiv.org/abs/quant-ph/0001106](https://arxiv.org/abs/quant-ph/0001106)\n  - Quantum state preparation by phase randomization: [https://arxiv.org/abs/0903.1652](https://arxiv.org/abs/0903.1652)\n  - Quantum algorithms for systems of linear equations inspired by adiabatic quantum computing: [https://arxiv.org/abs/1805.10549](https://arxiv.org/abs/1805.10549)\n  - Optimal polynomial based quantum eigenstate filtering with application to solving quantum linear systems: [https://arxiv.org/abs/1910.14596](https://arxiv.org/abs/1910.14596)\n  - Efficient quantum linear solver algorithm with detailed running costs: [https://arxiv.org/abs/2305.11352](https://arxiv.org/abs/2305.11352)\n- Block Encoding\n  - pennylane tutorials\n    - Intro to QSVT: [https://pennylane.ai/qml/demos/tutorial_intro_qsvt/](https://pennylane.ai/qml/demos/tutorial_intro_qsvt/)\n    - QSVT in Practice: [https://pennylane.ai/qml/demos/tutorial_apply_qsvt/](https://pennylane.ai/qml/demos/tutorial_apply_qsvt/)\n    - Linear combination of unitaries and block encodings: [https://pennylane.ai/qml/demos/tutorial_lcu_blockencoding/](https://pennylane.ai/qml/demos/tutorial_lcu_blockencoding/)\n    - Block encoding with matrix access oracles: [https://pennylane.ai/qml/demos/tutorial_block_encoding/](https://pennylane.ai/qml/demos/tutorial_block_encoding/)\n  - Lecture - The block-encoding: [https://www.ias.edu/sites/default/files/Tang%20qsvt_lect_1.pdf](https://www.ias.edu/sites/default/files/Tang%20qsvt_lect_1.pdf)\n  - Hamiltonian simulation with nearly optimal dependence on all parameters: [https://arxiv.org/abs/1501.01715](https://arxiv.org/abs/1501.01715)\n  - Explicit Quantum Circuits for Block Encodings of Certain Sparse Matrices: [https://arxiv.org/abs/2203.10236](https://arxiv.org/abs/2203.10236)\n  - FABLE: Fast Approximate Quantum Circuits for Block-Encodings: [https://arxiv.org/abs/2205.00081](https://arxiv.org/abs/2205.00081)\n\n----\n\nby Armit\n2024/05/13 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahsolt%2Fadiabatic-linear-solver-qpanda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkahsolt%2Fadiabatic-linear-solver-qpanda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahsolt%2Fadiabatic-linear-solver-qpanda/lists"}