🐛 Preserve symbolic Euler chains in target synthesis - #2559
Conversation
🤖 *AI text below* 🤖 Reuse direct Euler angles and synthesize into the target basis after placement. This avoids inverse trigonometry and cancelling U phase corrections for symbolic circSU2 circuits while retaining classical read sharing and the existing U-target optimizer. Assisted-by: GPT-5 via Codex
🤖 *AI text below* 🤖 Reuse the existing Euler emitters for symbolic XZX and XYX chains in compatible XZX, XYX, and R bases, including shortened chains. Preserve phase and gate-count bounds without inverse trigonometry. Cover controlled matrix equality and late-bound Qiskit export through both target pipelines. Initialize the test fixture in its constructor. Assisted-by: GPT-5 via Codex
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
🤖 *AI text below* 🤖 Use designated fields for the symbolic angle initializer. Exercise the compiler-target basis overload in the existing seven-basis regression, covering the previously missed U and ZXZ switch cases. Assisted-by: GPT-5 via Codex
🤖 *AI text below* 🤖 Add the trailing commas required by clang-tidy. Extend the existing symbolic Euler regression with isolated rotations to exercise the RX-to-R conversion. Assisted-by: GPT-5 via Codex
🤖 *AI text below* 🤖 Keep optional target fusion direct and preserve supported gate runs, including native controlled operations. Normalize evaluated one-qubit operands and accumulated phases modulo 4*pi before angle arithmetic so late binding preserves the full unitary with bounded angles. Use the existing fusion pass options and remove the redundant basis factory. Cover native preservation, symbolic export, periodic reduction, and shared scalar expressions with phase-sensitive regressions. Assisted-by: Codex (GPT-6)
🤖 *AI text below* 🤖 Direct Euler synthesis now emits math.tan when bounding symbolic angles. Register Math in the test fixture, which bypasses the pass manager and its dependent-dialect loading. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Reuse the direct Euler path for H/RZ pairs and preserve controlled U lowering after canonicalization. Restore native gate-count bounds and keep exhaustive numeric checks in C++, with seven Python consumer cases. Assisted-by: GPT-6 via Codex
burgholzer
left a comment
There was a problem hiding this comment.
Thanks @simon1hofmann 🙏🏼 finally got through this. I pushed a couple of fixes and simplifications and created a follow-up issue (#2614) with further simplification opportunities I identified but did not want to put into this PR in order to not hold it up for too long.
If you are also happy with the changes here, feel free to merge.
The follow-up issue is also up for grabs 🙌🏼
Thanks a lot for the final touches, I can tackle the follow-up issue 👍 |
🤖 AI text below 🤖
Description
Compile supported symbolic Euler chains directly into the target basis so that EfficientSU2-style circuits remain bindable after Qiskit export. H/RZ pairs in either order now use one U gate or at most three gates in the other supported bases, without runtime quaternion extraction. This restores the RX/RZ, RX/RY, and R gate-count bounds and fixes the U/H–RZ export failure.
No new dependencies or public API changes are required. Broader consolidation and the remaining Python test audit are tracked in follow-up issue #2614.
Validation
Linux AArch64, optimized
release-clang-ipobuild:test/python/test_mlir.pypassed with Qiskit and jeff available, including late parameter binding and the U/H–RZ exporter regression.Hosted CI has not been checked for this update. The earlier large-workload timings are not claimed as validation of this revision.
OpenAI Codex assisted with implementation, tests, and this description. Human review of the updated patch remains required before merging.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).