Skip to content

Transpiler from MBQC+LC into pure MBQC#515

Open
thierry-martinez wants to merge 18 commits into
TeamGraphix:masterfrom
thierry-martinez:transpiling-local-cliffords
Open

Transpiler from MBQC+LC into pure MBQC#515
thierry-martinez wants to merge 18 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 89.03%. Comparing base (8bf1ebe) to head (2033d7b).

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.
📢 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
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.

2 participants