Skip to content

Replay RXYXY2Q from QIS traces and add it to the Python TickCircuit - #810

Open
ciaranra wants to merge 1 commit into
devfrom
python-trace-replay-rxyxy2q
Open

ciaranra wants to merge 1 commit into
devfrom
python-trace-replay-rxyxy2q

Conversation

@ciaranra

Copy link
Copy Markdown
Member

Closes #803.

Problem

After #788 the Selene runtime lowers RPP onto QuantumOp::RXYXY2Q, so QIS traces can now contain that operation. _qis_trace_replay.py did not know it: both the raw-operation path and the runtime-lowered path raised an unsupported-operation error, and Python TickCircuit had no constructor for the gate.

Change

  • TickCircuit.tick().rxyxy2q(theta, phi, pairs), Gate.rxyxy2q(theta, phi, pairs) and GateType.RXYXY2Q in pecos_rslib, mirroring the RZZ equivalents, with .pyi declarations.
  • Both replay branches handle RXYXY2Q; the serialized payload is {"Quantum":{"RXYXY2Q":[theta, phi, qubit_1, qubit_2]}} from the derived Serde form of the FFI enum.
  • RXYXY2Q added to the three Python gate_groups two-qubit sets.

The with_noise gate lists are deliberately not touched here; #802 replaces them.

Tests

A trace with RXYXY2Q(-0.73, 0.41) on a non-trivial pair replays through both paths into a TickCircuit carrying both angles in order on that pair (swapped angles or qubits fail); constructor tests for typed and float angles; incomplete-pair and unknown-operation cases still fail loudly.

Verification

just python-ci-build-test, cargo clippy --locked -p pecos-rslib --all-targets -- -D warnings, cargo fmt --check, pytest tests/pecos/test_tracing.py (32 passed), the wider -k "replay or tracing or tick_circuit" selection (92 passed), and just python-ci-lint, all clean.

How this was produced

Implemented by OpenAI gpt-6-astra (Codex CLI 0.154.0) from a task packet written by Claude Fable 5.1 in Claude Code; Claude reviewed every hunk, re-ran all verification itself, and sent findings back for fix rounds. An independent Codex review arm with no access to the implementation session also reviewed the diff. Posted at the maintainer's request.

@ciaranra
ciaranra force-pushed the python-trace-replay-rxyxy2q branch from 4a384f4 to b2c64b3 Compare September 20, 2026 05:58
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.

Python QIS trace replay cannot replay RXYXY2Q

1 participant