Skip to content

Comments

Non-Clifford Removal#10

Merged
nabe98 merged 74 commits intomffrom
non-Clifford-removal
May 7, 2025
Merged

Non-Clifford Removal#10
nabe98 merged 74 commits intomffrom
non-Clifford-removal

Conversation

@nabe98
Copy link
Collaborator

@nabe98 nabe98 commented Feb 3, 2025

Implements non-Clifford removal method.

  • method to convert ZXGraphState into phase-gadget form (see Prop.4.16 in [1])
  • method to remove the YZ node with a single neighbor (see Lem. 4.17)
  • method to merge YZ nodes with the same neighbors (see Lem. 4.18)
  • repeat the above methods if these processes result in any new internal Clifford vertices (see Thm. 4.21)
  • add a demo in examples/
  • fix test_euler.py
  • fix local complementation and pivot
    • replace measurement_action based impl. into LocalClifford based impl.
    • update test_zxgraphstate

Ref.
[1] M. Backens et al., Quantum 5, 421 (2021)

closes #8

@nabe98 nabe98 requested a review from masa10-f February 3, 2025 11:41
@nabe98 nabe98 self-assigned this Feb 3, 2025
@masato-fuk
Copy link
Contributor

@nabe98 Could you add a demo in examples/ after you finish the implementation?

@nabe98 nabe98 changed the title [WIP] Non-Clifford Removal Non-Clifford Removal Feb 15, 2025
@nabe98 nabe98 requested a review from masa10-f May 3, 2025 08:28
@nabe98
Copy link
Collaborator Author

nabe98 commented May 3, 2025

@masato-fuk
Thanks for the review! I've fixed all the issues you pointed out.

As for the tests, there are no problems with the current ones, but in order to fully cover all the conditional branches implemented in zxgraphstate.py, three additional tests are needed. (I already have drafts for them, but the calculations still need to be revised.)
These additional tests are planned to be included in a subsequent PR.

Copy link
Collaborator

@masa10-f masa10-f left a comment

Choose a reason for hiding this comment

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

Please check my comments

_update_node_measurement seems not to be used.

@masa10-f
Copy link
Collaborator

masa10-f commented May 3, 2025

@nabe98
The ZXGraphState class has too many private methods. Can you simplify them? We have to update gflow inside the routines afterwards, so the simple implementation will help us

@nabe98 nabe98 requested a review from masa10-f May 5, 2025 10:03
@nabe98
Copy link
Collaborator Author

nabe98 commented May 5, 2025

@masato-fuk
Thanks for the review!
The main changes are as follows:

  1. Removed some private methods to improve readability
  2. Simplified the preprocessing logic for remove_clifford

@nabe98 nabe98 requested a review from Copilot May 7, 2025 00:37
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

This PR implements the "Non-Clifford Removal" feature by adding methods for converting ZXGraphState forms, removing specific Clifford nodes, and merging YZ nodes based on recent theoretical results. Key changes include:

  • Refactoring local Clifford removal logic and measurement update routines in ZXGraphState.
  • Updating and expanding tests related to local complementation, pivot operations, and measurement basis updates.
  • Adding a new function in random_objects and a demo in examples to showcase the graph simplification process.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_euler.py Updated test cases for local complementation and pivot functions.
graphix_zx/zxgraphstate.py Refactored and extended Clifford node removal and merging logic.
graphix_zx/random_objects.py Added new function to generate random MBQC circuits.
graphix_zx/graphstate.py Added properties to expose inner-to-node mappings.
examples/zxgraph_simplification.py Provided a demo example for ZX-diagram simplification.

@nabe98 nabe98 merged commit 47c0667 into mf May 7, 2025
27 of 28 checks passed
@nabe98 nabe98 deleted the non-Clifford-removal branch May 7, 2025 06:16
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.

3 participants