Transpiler from MBQC+LC into pure MBQC#515
Open
thierry-martinez wants to merge 18 commits into
Open
Conversation
This commit implements: - `Clifford.to_pattern`: returns an equivalent MBQC pattern (i.e., without local Clifford corrections) for a given single-qubit Clifford gate. - `remove_local_clifford_commands`: transpiles an MBQC+LC pattern into an equivalent pure MBQC pattern by eliminating all local-Clifford commands. - `Pattern.reindex` and `Command.reindex`: implements the renumbering step of pattern composition.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #515 +/- ##
==========================================
+ Coverage 88.85% 89.03% +0.18%
==========================================
Files 49 49
Lines 7135 7244 +109
==========================================
+ Hits 6340 6450 +110
+ Misses 795 794 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
matulni
reviewed
May 27, 2026
matulni
left a comment
Contributor
There was a problem hiding this comment.
Thanks! I made some comments
…tion (fix TeamGraphix#519) This commit makes `Pattern.reindex` accept mappings in addition to functions. When no mapping is supplied, nodes are re-indexed consecutively, starting at 0, implementing the suggestion of TeamGraphix#519. Re-indexing is now performed in place by default, with an optional `copy` parameter to return a fresh pattern instead.
matulni
approved these changes
Jun 3, 2026
matulni
left a comment
Contributor
There was a problem hiding this comment.
Thanks LGTM! I made some small comments only
--------- Co-authored-by: matulni <m.uldemolins@gmail.com>
--------- Co-authored-by: matulni <m.uldemolins@gmail.com>
matulni
approved these changes
Jun 8, 2026
Co-authored-by: matulni <m.uldemolins@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements:
Clifford.to_opengraph: returns an equivalent MBQC pattern (i.e., without local Clifford corrections) for a given single-qubit Clifford gate.remove_local_clifford_commands: transpiles an MBQC+LC pattern into an equivalent pure MBQC pattern by eliminating all local-Clifford commands.Pattern.reindexandCommand.reindex: implements the renumbering step of pattern composition.