Codync
免费开源的 1:1 Grok Bot 与 Muse 替代方案。可在 iPhone、Mac 或 Linux 桌面上将 Claude 代码、Codex、Cursor 以及 40 多个编码代理作为持久机器人使用。支持群组聊天、线程、应用。
AI 翻译
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证SMT and MILP-based Gate-count optimal Quantum Circuit Synthesis
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗MILQ (Mixed Integer linear programming & first order Logic Quantum circuit synthesis) is a tool for gate-count optimal quantum circuit synthesis for OPENQASM circuits using SMT and MILP encodings.
Supported solvers: dReal, z3, cvc5, opensmt, yices2, smtinterpol, Gurobi
MILQ does not ship the SMT solvers. Run ./configure-solvers --download to download yices2, cvc5 and OpenSMT, or install the ones you want and run ./configure-solvers, which writes their paths and command-line arguments to solvers.toml; see the solver configuration docs.
Dependencies:
z3-solver from requirements.txt (on PATH while the virtual environment is active), or sudo apt install z3requirements.txtpip install -r requirements.txt
gurobi.lic file. (The license is not re-distributable without explicit agreement with Gurobi)Then download yices2, cvc5 and OpenSMT and write the solver configuration for them and the SMT solvers on your PATH (with the virtual environment active):
./configure-solvers --download
To synthesize a quantum circuit, run the milq script in the repository root. It can be called from any directory, or through a symlink on your PATH (e.g. ln -s "$PWD/milq" ~/.local/bin/milq).
CLI flags for exact synthesis:
-v pick what vectors to use in the synthesis (either |0>^n, all CBS, jamiolkowski identity vector, or the three RUS states)-s pick a solving method (gurobi, milp, smt) -- milp is for PuLP pure MILP formulations-m choose the synthesis mode -- either incremental, basic, or one of search methods that minimize the gate variables-a choose a solver to use in the solving (portfolio or one of the supported solvers)-o output circuit file-c representation of complex numbers (Classic for a+bj, FiveTuple for algebraic five-tuples)-u for up to global phase equivalence instead of identity check-nm to ignore end-of-circuit measurements-d synthesize up to an allowed depthApproximate synthesis uses the -ap flag and a set -f X fidelity threshold X (in [0,1])
RUS synthesis can also require the specification of -T X, -A Y to specify the number of target qubits X and number of ancillae A.
Examples, run from the repository root:
./milq -v zero -c FiveTuple -s smt -a portfolio -m incremental benchmarks/ghz/2.qasm
./milq -v zero -c Classic -s gurobi -m incremental benchmarks/ghz/2.qasm
./milq -v all -c FiveTuple -s gurobi -m incremental benchmarks/ghz/2.qasm
pip install pytest
pytest
The tests use the SMT solvers that configure-solvers finds on PATH (most need yices2; your solvers.toml is not used) and the size-limited license shipped with gurobipy. They run in CI on every push and pull request; CI downloads yices2, cvc5 and OpenSMT with configure-solvers --download and uses the full Gurobi license from the organization secret GUROBI_LICENSE when it works there, and the size-limited one otherwise. Known bugs are marked xfail with their issue number. Strict mode is on, so a fix must remove its marker from KNOWN_BUGS in tests/test_simulator.py.
- README.md
- milq (CLI for synthesis)
- requirements.txt
- configure-solvers (writes solvers.toml for the installed SMT solvers, --download downloads some)
- solvers.toml (paths and arguments of the SMT solvers, not tracked)
- solvers/ (solvers downloaded by configure-solvers --download, not tracked)
- benchmarks/
| - ghz (GHZ circuits)
| - bernstein-vazirani (BV circuits)
| - qsharp (benchmarks for comparison with Quokka#)
| - mqt-bench (MQT benchmark library Clifford+T circuits)
| - rus (repeat-until-success circuits)
- cli/
| - simulator.py (CLI interface for our small simulator module)
- src/
| - complex/
| | - classic.py (a+bj)
| | - fivetuple.py (algebraic fivetuples)
| | - matrix.py (unitary matrices)
| | - vector.py (vector abstraction)
| - gates.py (Gate-Set, Circuit, and Gates abstractions)
| - generator.py (generating of SMT formulae or MILP programs)
| - pareto.py (pareto front)
| - parser.py (parsing of solver outputs)
| - sim.py (simulator module)
| - solver_config.py (loading of solvers.toml)
| - solver_detection.py (the known SMT solvers with their release downloads, finding the installed ones)
| - solver_download.py (downloading the releases, for configure-solvers --download)
| - solvers.py (abstraction over SMT solvers and Portfolio solver)
| - synth.py (main synthesis module)
| - timing.py (phase timings)