Skip to content

Inconsistent custom assembly (create_qubits) between xdsl and MLIR #783

Description

@rainij

Priority

Medium

Responsible

No response

Qrisp Version

0.9.6

Python Version

3.14

Operating System

Linux

Short Description

This diff summarizes it:

-    %1, %2 = jasp.create_qubits %0, %arg0 : !jasp.QuantumState, tensor<i64> -> !jasp.QubitArray, !jasp.QuantumState
+    %1, %2 = jasp.create_qubits %0, %arg0 : tensor<i64>, !jasp.QuantumState -> !jasp.QubitArray, !jasp.QuantumState

The upper line is what is expected by the tablegen. The lower line shows that is emitted by xdsl. A recent fix of the custom assembly format (d63b9ce) has not been applied to the tablegen files.

Steps to Reproduce

See source files.

Expected Behavior

Should be consistent.

Actual Behavior

Not consistent.

Additional Context

We observed this while trying to update our qrisp integration tests from version 0.9.5 to 0.9.6 in the qcc project (fullstaqd). Over there we have to duplicate the tablegen files of this repo in order to parse the mlir output of qrisp. The issue is that xdsl is responsible for printing hence the inconsistency surfaces. It is not urgent for us since we now switched to letting qrisp generate the generic assembly format, fixing the problem for us. Might still be nice to fix the inconsistency over here though.

Definition of Done

  • Root cause identified
  • Fix implemented and peer-reviewed
  • Regression test added
  • All tests pass (CI green)
  • Changelog entry added

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions