munich-quantum-toolkit / munich-quantum-toolkit/core-plugins-catalyst

🚸 MLIR - Improve the usability of the `ToQuantumComputationPattern` and the `FromQuantumComputationPattern`

Open
#46 0 comments 0 reactions 1 assignee View on GitHub

@flowerthrower is already working on this.

Since Jul 30, 2025.

c++ enhancement
Dominant language
C++
Stars
8
Forks
2
Avg merge
5h 27m
Merged PRs (30d)
34

Description

Problem Statement

While working on the Catalyst plugin code, I noticed that the conversion code to and from our QuantumComputation is quite wonky.
For example, any conversion will currently result in a warning of the sort

Skipping unsupported operation: %1 = "mqtopt.allocQubitRegister"() <{size_attr = 2 : i64}> : () -> !mqtopt.QubitRegister

This is due to the AllocOp being processed in the loop of operations but not actually being handled.
What makes matters worse is that this also means that the current code will not be able to handle multiple register allocations.
Also, the solution with the tagged alloc operation feels very hacky.

Proposed Solution

Supporting multiple allocation operations should be fairly straightforward by moving the allocation operation handling from the start of the method to the loop that handles the operations.
As for the operation tagging, I am thinking that there has to be a way to group up operations forming a transformable subset of the operations. Maybe they can be moved into a block, maybe we could introduce a dedicated operation that encapsulates an entire list of MLIR Quantum Operations and simply move operations there.
Something like this will most likely come up when working on munich-quantum-toolkit/core#1079 anyway.
The other optimizations probably make sense once we have proper testing from munich-quantum-toolkit/core#1071

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.