Skip to content

feat: implement Z-X bialgebra rewrite rule#189

Open
dlyongemallo wants to merge 1 commit intozxcalc:masterfrom
dlyongemallo:bialgebra_rule
Open

feat: implement Z-X bialgebra rewrite rule#189
dlyongemallo wants to merge 1 commit intozxcalc:masterfrom
dlyongemallo:bialgebra_rule

Conversation

@dlyongemallo
Copy link

No description provided.

@dlyongemallo dlyongemallo marked this pull request as ready for review February 1, 2026 21:55
Copilot AI review requested due to automatic review settings February 1, 2026 21:55
@dlyongemallo dlyongemallo marked this pull request as draft February 1, 2026 21:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a Z–X bialgebra rewrite rule in the ZX-calculus core rules and adds a dedicated test suite to validate its correctness (including scalar factors and boundary handling).

Changes:

  • Added check_bialg, bialg_unchecked, and the checked wrapper bialg implementing the Z–X bialgebra rule with appropriate structural and phase preconditions.
  • Implemented the bialgebra transformation to remove the central Z/X spiders, connect their neighborhoods bipartitely with normal edges, and apply the sqrt(2)^((m-1)*(n-1)) scalar factor.
  • Added a comprehensive set of unit tests covering basic, boundary, asymmetric, and non-matching cases for the bialgebra rule, verifying semantic preservation via to_tensor4().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dlyongemallo dlyongemallo marked this pull request as ready for review February 2, 2026 06:30
@dlyongemallo dlyongemallo marked this pull request as draft February 2, 2026 06:31
@dlyongemallo dlyongemallo marked this pull request as ready for review February 2, 2026 06:32
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