Skip to content

Move reference semantics MBQC ops to MBQC dialect#2829

Merged
paul0403 merged 7 commits into
mainfrom
paul0403/mbqc_ref
May 20, 2026
Merged

Move reference semantics MBQC ops to MBQC dialect#2829
paul0403 merged 7 commits into
mainfrom
paul0403/mbqc_ref

Conversation

@paul0403
Copy link
Copy Markdown
Member

@paul0403 paul0403 commented May 12, 2026

Context:
When the MBQC reference semantics ops were first added, I added them to the overarching qref dialect.

This was not the best organization. See discussion in thread

In particular,

We don't have a single dialect for all the existing dialects either just because they share "value semantics". While MLIR has two distinct dialects for tensors (value-sem) and memrefs (memory-sem), the difference is that these dialects specifically focus on those (i.e. what can you do with tensors or memrefs). Domain specific dialects seem either work with both (e.g. linalg can operate on both tensors and memrefs) or chose to explicitly work with only one of those (e.g. stablehlo).

As a domain specific dialect, MBQC is now hosting both value and reference semantics ops.

Description of the Change:
Move reference semantics mbqc ops from qref dialect to mbqc dialect.

Benefits:
Better organization.

[sc-117892]

@paul0403 paul0403 requested review from dime10 and joeycarter May 12, 2026 17:56
@github-actions
Copy link
Copy Markdown
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.94%. Comparing base (4574589) to head (1b08148).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2829   +/-   ##
=======================================
  Coverage   96.94%   96.94%           
=======================================
  Files         169      169           
  Lines       18972    18972           
  Branches     1807     1807           
=======================================
  Hits        18392    18392           
  Misses        411      411           
  Partials      169      169           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@joeycarter joeycarter left a comment

Choose a reason for hiding this comment

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

Thanks @paul0403 💯

Just had a couple of suggestions to polish up the docs while we're here, otherwise looks good.

Comment thread mlir/include/MBQC/IR/MBQCRefOps.td Outdated
Comment thread mlir/include/MBQC/IR/MBQCRefOps.td Outdated
paul0403 and others added 3 commits May 13, 2026 18:48
Co-authored-by: Joey Carter <joseph.carter@xanadu.ai>
Co-authored-by: Joey Carter <joseph.carter@xanadu.ai>
@paul0403 paul0403 requested review from a team and mehrdad2m May 19, 2026 14:44
Comment thread mlir/lib/QRef/Transforms/value_semantics_conversion.cpp
Copy link
Copy Markdown
Contributor

@mehrdad2m mehrdad2m left a comment

Choose a reason for hiding this comment

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

Thanks! Don't forget to add changelog!

@paul0403 paul0403 merged commit 6312e47 into main May 20, 2026
38 checks passed
@paul0403 paul0403 deleted the paul0403/mbqc_ref branch May 20, 2026 20:59
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