Skip to content

fix(compile): canonicalize KAK Weyl boundary representatives - #69

Merged
jianjian01 merged 2 commits into
cq-lib:release/2.0from
jianjian01:release/2.0
Oct 19, 2026
Merged

jianjian01 merged 2 commits into
cq-lib:release/2.0from
jianjian01:release/2.0

Conversation

@jianjian01

Copy link
Copy Markdown
Collaborator

Fixes #67

Valid two-qubit unitaries could fail KAK decomposition because boundary representatives were not normalized to the documented Weyl convention. The validator also used the unitarity tolerance to identify the boundary, incorrectly rejecting nearby interior coordinates with negative c.

Normalize roundoff-scale boundary coordinates and select the positive-c representative while preserving local SU(2) factors and global phase. Keep signed c valid in the chamber interior and retain reconstruction and device-feasibility checks.

Add regressions for the reported matrix, global phases, qubit ordering, all five synthesis backends, caches, resynthesis, device-aware compilation, control flow, and Python/C interfaces. Bump the synthesis algorithm revision.

Separate roundoff-scale boundary normalization from unitarity tolerance. Preserve local SU(2) factors and global phase when selecting the positive-c boundary representative, and accept signed c for valid interior coordinates.

Add regressions across synthesis backends, caches, device-aware compilation, control flow, and Python/C interfaces. Bump the synthesis algorithm revision.
@jianjian01
jianjian01 requested a review from CXMghost October 18, 2026 07:05
@jianjian01
jianjian01 merged commit 492a981 into cq-lib:release/2.0 Oct 19, 2026
4 checks passed
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.

[Bug] CompilerTransformError: Weyl chamber violation in decompose.two_qubit_kak

2 participants