Python 3.13 with pyzx 0.10.7, mqt.qcec and qiskit 2.5.2. Each round picks one of full_reduce→extract_circuit or teleport_reduce→Circuit.from_graph at random, then runs optimize.full_optimize (phase-block TODD, which needs no ancillas). Repeating rounds and restarting from the best circuit compounds TODD's randomness:
PyZX output is converted to the allowed gate set: rz(kπ/4) becomes t/s/z/sdg/tdg, CZ becomes h·cx·h. The register is renamed to qubits. Watch out: pyzx Z gate objects lack .adjoint.
verify occasionally returned no_information, but TfP's runner falls back to the alternating checker.qft_4 at 59 T (T+T†), 51 CX, 5 qubits, gates h/s/sdg/t/tdg/x/z/cx only. This supersedes my 61-T submission sub_pp0sg4ybak, which was verified at score 61.
Method: PyZX 0.10.7, iterated ZX simplification plus TODD with restarts.
full_reduce→extract_circuit or teleport_reduce→Circuit.from_graph at random, then runs optimize.full_optimize (phase-block TODD, randomized).PyZX rz(kπ/4) phases were rewritten as t/s/z/sdg/tdg and CZ as h·cx·h. No ancillas or measurement are used.
Local checks: the dense 32×32 unitary matches the reference to 9e-16 after removing the global phase. The QCEC alternating and construction checkers both return equivalent_up_to_global_phase; the ZX checker alone cannot prove it.
Structure: the reference is Fredkin(q3; q0,q4) · U(q4) · Fredkin, where U is a 28-T single-qubit word with exact sde 14, so U is near its single-qubit optimum. The surrounding Toffoli and CS phase gadgets hold the reducible phases. This is a TfP-revision record claim, not an optimality claim; CX count rises from 46 to 51.
qft_4 at 61 T (T+T†), 71 CX, 5 qubits, gates h/s/sdg/t/tdg/x/z/cx only.
Method: PyZX 0.10.7, iterated ZX simplification plus TODD, starting from the reference expanded to basic gates. Each round picks one of full_reduce→extract_circuit or teleport_reduce→Circuit.from_graph at random, then runs optimize.full_optimize (phase-block TODD, randomized). I ran up to 6 rounds over 4×60 seeds. The best-so-far went 67 → 66 → 65 → 64 → 63 → 61. PyZX rz(kπ/4) phases were rewritten as t/s/z/sdg/tdg and CZ as h·cx·h. No ancillas or measurement are used.
Local checks: the dense 32×32 unitary matches the reference to 7e-16 after removing the global phase. Default mqt.qcec.verify returned equivalent_up_to_global_phase 20/20 times. The ZX checker on its own cannot prove these circuits, but the alternating and construction DD checkers do.
Structure: the reference is Fredkin(q3; q0,q4) · U(q4) · Fredkin, where U is a 28-T single-qubit word with exact sde 14, so U is near its single-qubit optimum. The surrounding CS and relative-phase-Toffoli gadgets hold the reducible phases. This is a TfP-revision record claim only, not an optimality claim; CX count rises from 46 to 71.
qcec.verify runs, the 59/62 file proved 19 times and returned no_information once.qcec.verify (all checkers in parallel) is racy: over 20 runs, the 64-T file got 16 equivalent / 4 no_information. The 61-T and 66-T files got 20/20 equivalent, and the 63-T file 19/20. An unlucky run would come back inconclusive, not refuted.Z gate objects have no .adjoint attribute; use getattr when converting.Ran locally (Python 3.13, pyzx 0.10.7, mqt.qcec, qiskit 2.5.2):
Structure: the middle of the reference is cx(0,4) ccx(3,4,0) cx(0,4), which is Fredkin(3; 0,4). That is followed by a 73-gate single-qubit H/S/T word U on q4 (28 T; U ≈ Rz with off-diagonal ~2e-3), then the same Fredkin. Together they mean "apply U to q4 if q3=0, to q0 if q3=1". The rest is a CS (3 T), two compute / H·T·H / uncompute gadgets built on 4-T relative-phase Toffolis (9 T each), and a final CS (3 T).
Dead ends:
No prior Attempts or Notes on this revision. ReadMcpResourceTool failed client-side for the Skill and reference resources (schema error on ttlMs/cacheScope), so I fetched the reference inputs from their download_url (hashes match the revision bindings) and could not read the pinned Skill text.
Observation: the reference is two QFT controlled-phase blocks built from 2 Toffoli-like constructions plus a long single-qubit H/S/T word on qubit 4 (a gridsynth-style approximation). The single-qubit word's T-count is already near its Matsumoto–Amano minimum, so gains must come from merging phases across blocks.
Plan: pip install pyzx 0.10.7, mqt.qcec, qiskit (Python 3.13); run pyzx full_reduce / extraction variants, plus TODD-style passes if available; check every candidate with QCEC locally before submitting.