Skip to content

Cleanup#315

Merged
ciaranra merged 140 commits into
devfrom
cleanup
May 22, 2026
Merged

Cleanup#315
ciaranra merged 140 commits into
devfrom
cleanup

Conversation

@ciaranra
Copy link
Copy Markdown
Member

No description provided.

ciaranra added 30 commits May 13, 2026 17:01
# Conflicts:
#	crates/pecos-cli/src/cli/setup_cmd.rs
…s + stale comments + 3-cycle and cross-register Permute coverage
…ape (explicit Return passthrough + inline CReg result capture); broaden compile diagnostic catch; promote wrapper to shared entry_wrapper module
…R class, PrintOp AST node, Guppy result() emission, QASM comment fallback, and 15 Selene-roundtrip behavioral tests
ciaranra added 27 commits May 19, 2026 14:54
…havior-identical; clears the dirty worktree the #93/#95 reviewers flagged)
… (7 2q Cliffords)

Per ~/Repos/qir-qis/src/lib.rs:59 (ALLOWED_QIS_FNS, 23 functions):
the qir-qis native 2q gate is rzz (parameterized) -- there is NO
zz/szz in the allowlist (the prior `GATE_TO_QIR[SZZ]="zz"` emitted
`__quantum__qis__zz__body` which qir-qis rejects with
"Unsupported QIR QIS function"). Quantinuum supports ZZ-flavor
entanglement natively, just as `rzz`. Fixed:

- Removed the misleading `GateKind.SZZ: "zz"` from `GATE_TO_QIR`
  (and `SZZ` from `TWO_QUBIT_GATES`) -- no more misleading
  codegen surface.
- Extended `_GATE_DECOMP` to a 2q-capable shape: each step is
  (prim_kind, qubit_idx_tuple, params_tuple); `_process_gate`
  emits each step with the input gate's targets routed and
  constant params threaded.
- Added 7 verified decompositions:
    SZZ   = RZZ(pi/2)(q0,q1)
    SZZdg = RZZ(-pi/2)(q0,q1)
    SXX   = (H@H); RZZ(pi/2); (H@H)
    SXXdg = (H@H); RZZ(-pi/2); (H@H)
    SYY   = (Sdg@Sdg);(H@H); RZZ(pi/2); (H@H);(S@S)
    SYYdg = (Sdg@Sdg);(H@H); RZZ(-pi/2); (H@H);(S@S)
    CY    = Sdg(t); CX(c,t); S(t)
  Each VERIFIED up-to-global-phase against the PECOS StateVec
  unitary AND end-to-end via qir_to_qis -> selene (inverse pairs,
  CY|10> -> i|11> non-vacuity, SZZ^2 = Z discriminator).
- `test_sqrt_pauli_2q_gates_executable` (slow+optional_dependency)
  pins the end-to-end identities.

Methodology correction recorded earlier in memory: my prior "rx is
a silent no-op on the Stim backend" claim was wrong (probe-harness
bug). RX/RY/RZ/RZZ all execute correctly. The truly misleading
surface was only SZZ -> "zz" (now fixed).

#71 honest re-pin: BUILD_FAILED 7 -> 5, QIS_OK 22 -> 24
(generic_check_xyz / generic_check_1flag_ch use CY which now
lowers, so they re-enter QIS_OK). #79 manifest updated: both
classified X (XYZ stabiliser on |0..0> is not an eigenstate ->
single uniformly random syndrome bit; no hard invariant);
histogram pin D=3/P=8/X=11 -> X=13.

Verified: default 415/0, optional_dependency 44 passed / 3
xfailed / 0 failed, slow 28/0 (24 QIS_OK + manifest guard +
sqrt/face/sqrt_pauli_2q behavioral), ruff/black-25.9.0 clean.

Remaining #93 (still fail-loud, no PECOS sim oracle): CH (sim
doesn't support), CRX/CRY/CRZ (parameterized, sim doesn't
support) -- decomposition would require a convention pin without
a verification oracle. Surfaced for separate scope.
…ence assertion

Codex post-review NO -- 1 blocker: the committed CY executable
test (X q0; CY; M q1 -> 1; CY|00>; M q1 -> 0) does not
discriminate the CY target-phase decomposition. Mutation probe
(swap CY's `Sdg(t); CX; S(t)` -> `S(t); CX; S(t)`) SURVIVED the
test, violating the prompt's explicit non-vacuity requirement.
Pickle YES (the unitary verification covers it; the e2e is a
secondary guard) -- but the test should still fail under that
mutation per the prompt + branch discipline.

Folded: added the phase-sensitive interference assertion Codex
prescribed -- `H q1; CY(q0, q1); H q1; MZ q1` with q0=|0> must
give 0. Verified: committed PASSes; the mutated S;CX;S CY
decomposition now FAILS the test (the assertion message names
the exact mutation it catches). Mechanism: with q0=|0> the
correct CY is identity, so H;I;H = I -> 0; the mutated S;CX;S
applies S^2 = Z on q1 even when control=0 (since CX is identity
then), giving H;Z;H = X -> 1.

Verified: default 415/0, optional_dependency 44 passed / 3
xfailed / 0 failed, slow sqrt_pauli_2q PASSes, ruff/black clean.
… CY assertion

Codex re-confirm NO -- 1 trivial blocker: the folded CY
interference assertion's multi-line set literal `{\n (0,)\n}`
(black-reformatted) triggers ruff COM812. The assertion was
semantically correct (Codex verified it catches both the
prescribed `S;CX;S` mutation AND the symmetric `Sdg;CX;Sdg`),
but `uv run ruff` (the project version, the authoritative gate
-- distinct from `uvx ruff@latest` which didn't flag it) was
red. Added the trailing comma via `ruff --fix`. Lanes unchanged:
default 415/0, optional_dependency 44/3xf/0, slow sqrt_pauli_2q
1/0; ruff + black-25.9.0 clean.
…sing-angle fails loud + B1 LoopVar comment accuracy
… build-only is the non-Clifford-on-Stim caveat)
…first calls (SLR __call__ type guard + QIR/QASM arity guards)
…omment SHA can't mask an unpinned action (Codex blocker)
…erences from comments and messages, keeping public-tracker refs
…ping the two-phase BlockCall algorithm labels
@ciaranra ciaranra marked this pull request as ready for review May 22, 2026 20:38
@ciaranra ciaranra merged commit f559e60 into dev May 22, 2026
109 checks passed
@ciaranra ciaranra deleted the cleanup branch May 22, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant