Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/pyzx-optimization/mcp/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def compute(v):
import numpy as np
import pyzx as zx
if version("pyzx") != "0.10.6":
if version("pyzx") != "0.10.8":
raise ValueError("Unexpected PyZX version; restore the frozen environment")
circuit = zx.Circuit(v["numQubits"])
names = {"H": "HAD", "X": "NOT", "CX": "CNOT"}
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/pyzx-optimization/mcp/contracts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const metrics = obj({ gates: int(0), twoQubitGates: int(0), tCount: int(0) });
export const definition = defineScienceTool({
name: "optimize_pyzx_circuit",
description: "Optimize Clifford+T circuits through PyZX ZX rewriting and extraction. Return input/output OpenQASM 2 and gate counts. Independent full-unitary comparison is optional; circuit size is determined by the user's resources. No measurements, hardware routing or guaranteed gate-count improvement.",
source: { name: "pyzx", version: "0.10.6", repository: "https://github.com/zxcalc/pyzx" },
source: { name: "pyzx", version: "0.10.8", repository: "https://github.com/zxcalc/pyzx" },
inputSchema: obj({ ...circuitSchema(), referenceMode: referenceModeSchema }),
checkInput: checkCircuit,
resultSchema: referenceAwareResultSchema({ inputQasm: { type: "string", minLength: 1 }, optimizedQasm: { type: "string", minLength: 1 }, before: metrics, after: metrics, unitaryMaxError: nullable(num(0, 2)), equivalenceTolerance: nullable({ const: 1e-8 }), equivalentUpToGlobalPhase: nullable({ type: "boolean" }), bitOrder: { const: "left-to-right q0,q1,..." } }, ["unitaryMaxError", "equivalenceTolerance", "equivalentUpToGlobalPhase"]),
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/pyzx-optimization/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "openquantum-pyzx-optimization-bridge"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
dependencies = ["pyzx==0.10.6"]
dependencies = ["pyzx==0.10.8"]

[tool.uv]
package = false
20 changes: 5 additions & 15 deletions .agents/skills/pyzx-optimization/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions .github/workflows/pyzx-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: PyZX correctness

permissions:
contents: read

on:
pull_request:
paths:
- '.agents/skills/pyzx-optimization/**'
- 'benchmarks/upstream-updates/pyzx_regressions.py'
- 'tests/unitary-next-live.test.mjs'
- '.github/workflows/pyzx-sdk.yml'
push:
branches: [main]
paths:
- '.agents/skills/pyzx-optimization/**'
- 'benchmarks/upstream-updates/pyzx_regressions.py'
- 'tests/unitary-next-live.test.mjs'
- '.github/workflows/pyzx-sdk.yml'

jobs:
numerical-regressions:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: npm
- run: npm ci --ignore-scripts
- uses: astral-sh/setup-uv@v7
- name: Prepare the frozen production SDK
run: node scripts/setup-paper-tools.mjs pyzx-optimization
- name: Real MCP, independent references and error boundaries
env:
OPENQUANTUM_REAL_UNITARY_NEXT: '1'
run: node --test --test-name-pattern='real PyZX' tests/unitary-next-live.test.mjs
- name: Save numerical evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: pyzx-correctness-${{ matrix.os }}
path: .openquantum/unitary-next-evidence
include-hidden-files: true
if-no-files-found: error
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pasqal agent-marketplace 的实验方法与三个研究示例固定于 `2b0353d8
| qBraid | Apache-2.0 | 固定 0.12.2,独立 Python 环境调用 Qiskit/QASM2/Cirq 双向转换;不使用云 Provider,不复制上游源码 | [qBraid/qBraid](https://github.com/qBraid/qBraid/tree/v0.12.2) |
| QDMI | Apache-2.0 WITH LLVM-exception | 固定 v1.3.3 / `18cfb67fd9042761d3005c2f8655751c1758f9c5`;显式安装器在忽略目录构建官方示例 client driver/device 并保留 LICENSE,Python ctypes 只读查询 client ABI;不重新分发上游源码或二进制 | [Munich-Quantum-Software-Stack/QDMI](https://github.com/Munich-Quantum-Software-Stack/QDMI/tree/v1.3.3) |
| Cirq / Qiskit SDK | Apache-2.0 | qBraid 环境固定 Cirq 1.6.1 / Qiskit 2.5.2,用于电路表示、转换和独立矩阵对照;由包管理器安装并保留各自许可证 | [Cirq](https://github.com/quantumlib/Cirq) / [Qiskit](https://github.com/Qiskit/qiskit) |
| PyZX | Apache-2.0 | 固定 0.10.6,隔离环境调用ZX 重写、Clifford+T 门数比较与完整酉矩阵对照;上游源码由包管理器安装,保留原始许可证,不随本仓库重新分发 | [zxcalc/pyzx](https://github.com/zxcalc/pyzx) |
| PyZX | Apache-2.0 | 固定 0.10.8,隔离环境调用ZX 重写、Clifford+T 门数比较与完整酉矩阵对照;上游源码由包管理器安装,保留原始许可证,不随本仓库重新分发 | [zxcalc/pyzx](https://github.com/zxcalc/pyzx) |
| Graphix | Apache-2.0 | 固定 0.4,隔离环境调用电路到 MBQC 模式、资源图、自适应测量和纠正输出;上游源码由包管理器安装,保留原始许可证,不随本仓库重新分发 | [TeamGraphix/graphix](https://github.com/TeamGraphix/graphix) |
| Symmer | MIT | 固定 0.0.13@a4ba56e3,隔离环境调用指定 Pauli 对称性扇区的降比特与同扇区保谱检查;上游源码由包管理器安装,保留原始许可证,不随本仓库重新分发 | [qmatter-labs/symmer](https://github.com/qmatter-labs/symmer) |
| PauLie | MIT | 固定 0.2.3,隔离环境调用Pauli 生成元的 Lie 闭包、分类维数与独立矩阵参照;上游源码由包管理器安装,保留原始许可证,不随本仓库重新分发 | [QPauLie/PauLie](https://github.com/QPauLie/PauLie) |
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/upstream-updates/probes/pyzx/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "openquantum-pyzx-upstream-probe"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
dependencies = ["pyzx==0.10.8"]

[tool.uv]
package = false
Loading
Loading