Skip to content

Transpiler from MBQC+LC into pure MBQC#515

Merged
thierry-martinez merged 22 commits into
TeamGraphix:masterfrom
thierry-martinez:transpiling-local-cliffords
Jun 24, 2026
Merged

Transpiler from MBQC+LC into pure MBQC#515
thierry-martinez merged 22 commits into
TeamGraphix:masterfrom
thierry-martinez:transpiling-local-cliffords

Conversation

@thierry-martinez

@thierry-martinez thierry-martinez commented May 26, 2026

Copy link
Copy Markdown
Collaborator

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.reindex and Command.reindex: implements the renumbering step of pattern composition.

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

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.36%. Comparing base (4cbcdee) to head (685896c).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #515       +/-   ##
===========================================
+ Coverage        0   90.36%   +90.36%     
===========================================
  Files           0       49       +49     
  Lines           0     7383     +7383     
===========================================
+ Hits            0     6672     +6672     
- Misses          0      711      +711     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matulni matulni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! I made some comments

Comment thread graphix/command.py Outdated
Comment thread graphix/optimization.py
Comment thread graphix/optimization.py
Comment thread graphix/optimization.py Outdated
Comment thread graphix/optimization.py
Comment thread graphix/optimization.py
Comment thread tests/test_optimization.py
Comment thread graphix/_db.py
…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 matulni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks LGTM! I made some small comments only

Comment thread graphix/pattern.py Outdated
Comment thread tests/test_db.py Outdated
Comment thread tests/test_command.py Outdated
thierry-martinez and others added 4 commits June 4, 2026 09:58
---------

Co-authored-by: matulni <m.uldemolins@gmail.com>
---------

Co-authored-by: matulni <m.uldemolins@gmail.com>
@matulni matulni self-requested a review June 8, 2026 09:02

@matulni matulni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nice, LGTM!

Comment thread graphix/pattern.py Outdated
Comment thread graphix/pattern.py Outdated
Comment thread graphix/pattern.py Outdated
Comment thread graphix/pattern.py Outdated

@pranav97nair pranav97nair left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work, Thierry! I approve with just a couple very minor comments.

Comment thread graphix/command.py Outdated
Comment thread tests/test_db.py Outdated
@thierry-martinez thierry-martinez merged commit 5c2c939 into TeamGraphix:master Jun 24, 2026
24 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.

3 participants