Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
- ✨ Add conversions between Jeff and QCO ([#1479], [#1548], [#1565]) ([**@denialhaag**])
- ✨ Add a `place-and-route` pass for mapping circuits to architectures with restricted topologies ([#1537], [#1547], [#1568]) ([**@MatthiasReumann**])
- ✨ Add initial infrastructure for new QC and QCO MLIR dialects
([#1264], [#1330], [#1402], [#1428], [#1430], [#1436], [#1443], [#1446], [#1464], [#1465], [#1470], [#1471], [#1472], [#1474], [#1475], [#1506], [#1510], [#1513], [#1521], [#1542], [#1548], [#1550], [#1554], [#1570])
([#1264], [#1330], [#1402], [#1428], [#1430], [#1436], [#1443], [#1446], [#1464], [#1465], [#1470], [#1471], [#1472], [#1474], [#1475], [#1506], [#1510], [#1513], [#1521], [#1542], [#1548], [#1550], [#1554], [#1570], [#1572])
([**@burgholzer**], [**@denialhaag**], [**@taminob**], [**@DRovara**], [**@li-mingbao**], [**@Ectras**], [**@MatthiasReumann**], [**@simon1hofmann**])

### Changed
Expand Down Expand Up @@ -333,6 +333,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool

<!-- PR links -->

[#1572]: https://github.com/munich-quantum-toolkit/core/pull/1572
[#1571]: https://github.com/munich-quantum-toolkit/core/pull/1571
[#1570]: https://github.com/munich-quantum-toolkit/core/pull/1570
[#1568]: https://github.com/munich-quantum-toolkit/core/pull/1568
Expand Down
1 change: 0 additions & 1 deletion mlir/include/mlir/Conversion/JeffToQCO/JeffToQCO.td
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def JeffToQCO : Pass<"jeff-to-qco"> {
"mlir::arith::ArithDialect",
"mlir::math::MathDialect",
"mlir::tensor::TensorDialect",
"mlir::jeff::JeffDialect",
"mlir::qco::QCODialect",
];
}
4 changes: 0 additions & 4 deletions mlir/include/mlir/Conversion/QCOToJeff/QCOToJeff.td
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ def QCOToJeff : Pass<"qco-to-jeff"> {
}];

let dependentDialects = [
"mlir::arith::ArithDialect",
"mlir::math::MathDialect",
"mlir::tensor::TensorDialect",
"mlir::jeff::JeffDialect",
"mlir::qco::QCODialect",
];
}
12 changes: 4 additions & 8 deletions mlir/include/mlir/Conversion/QCOToQC/QCOToQC.td
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ def QCOToQC : Pass<"qco-to-qc"> {
let summary = "Convert QCO dialect to QC dialect.";

let description = [{
This pass converts all operations from the QCO dialect to their equivalent
operations in the QC dialect. It handles the transformation of qubit
values in QCO to qubit references in QC, ensuring that the semantics
of quantum operations are preserved during the conversion process.
}];
This pass converts all operations from the QCO dialect to their equivalent operations in the QC dialect.
It handles the transformation of qubit values in QCO to qubit references in QC, ensuring that the semantics of quantum operations are preserved during the conversion process.
}];

// Define dependent dialects
let dependentDialects = [
"mlir::qco::QCODialect",
"mlir::qc::QCDialect"
"mlir::qc::QCDialect",
];
}
12 changes: 4 additions & 8 deletions mlir/include/mlir/Conversion/QCToQCO/QCToQCO.td
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ def QCToQCO : Pass<"qc-to-qco"> {
let summary = "Convert QC dialect to QCO dialect.";

let description = [{
This pass converts all operations from the QC dialect to their equivalent
operations in the QCO dialect. It handles the transformation of qubit
references in QC to qubit values in QCO, ensuring that the semantics
of quantum operations are preserved during the conversion process.
}];
This pass converts all operations from the QC dialect to their equivalent operations in the QCO dialect.
It handles the transformation of qubit references in QC to qubit values in QCO, ensuring that the semantics of quantum operations are preserved during the conversion process.
}];

// Define dependent dialects
let dependentDialects = [
"mlir::qc::QCDialect",
"mlir::qco::QCODialect"
"mlir::qco::QCODialect",
];
}
68 changes: 34 additions & 34 deletions mlir/include/mlir/Conversion/QCToQIR/QCToQIR.td
Comment thread
burgholzer marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@ def QCToQIR : Pass<"qc-to-qir"> {
let summary = "Lower the QC dialect to the LLVM dialect compliant with QIR 2.0";

let description = [{
This pass lowers all operations from the QC dialect to their equivalent
operations in the LLVM dialect, ensuring compliance with the QIR 2.0 standard.
It translates quantum operations and types from QC to their corresponding
representations in QIR, facilitating interoperability with quantum computing
frameworks that utilize the QIR standard.

Requirements:
- Input is a valid module in the QC dialect.
- The entry function must be marked with the `entry_point` attribute.
- The input entry function must consist of a single block.
Multi-block input functions are currently not supported.
- The program must have straight-line control flow (i.e., Base Profile QIR).

Behavior:
- Each QC quantum operation is replaced by a call to the corresponding QIR function in the LLVM dialect.
- Required QIR module flags are attached as attributes to the entry function.
- The pass transforms the single-block entry function into four blocks to satisfy QIR Base Profile constraints:
0. Initialization block: Sets up the execution environment and performs required runtime initialization.
1. Reversible operations block: Contains only void-returning calls to reversible quantum operations.
2. Irreversible operations block: Contains only void-returning calls to operations marked irreversible, e.g.:
`__quantum__qis__mz__body`, `__quantum__qis__reset__body`.
3. Epilogue block: Records measurement results and returns from the entry function.
- Blocks are connected via unconditional branches in the order listed above.
- Non-quantum dialects are lowered via MLIR's built-in conversions.

Producing LLVM IR:
- After conversion to the LLVM dialect, produce LLVM IR with:
mlir-translate --mlir-to-llvmir input.mlir > output.ll
}];


// Define dependent dialects
This pass lowers all operations from the QC dialect to their equivalent operations in the LLVM dialect, ensuring compliance with the QIR 2.0 standard.
It translates quantum operations and types from QC to their corresponding representations in QIR, facilitating interoperability with quantum computing frameworks that utilize the QIR standard.

Requirements:

- Input is a valid module in the QC dialect.
- The entry function must be marked with the `entry_point` attribute.
- The input entry function must consist of a single block.
Multi-block input functions are currently not supported.
- The program must have straight-line control flow (i.e., Base Profile QIR).

Behavior:

- Each QC quantum operation is replaced by a call to the corresponding QIR function in the LLVM dialect.
- Required QIR module flags are attached as attributes to the entry function.
- The pass transforms the single-block entry function into four blocks to satisfy QIR Base Profile constraints:
0. Initialization block: Sets up the execution environment and performs required runtime initialization.
1. Reversible operations block: Contains only void-returning calls to reversible quantum operations.
2. Irreversible operations block: Contains only void-returning calls to operations marked irreversible (e.g., `__quantum__qis__mz__body` and `__quantum__qis__reset__body`).
3. Epilogue block: Records measurement results and returns from the entry function.
- Blocks are connected via unconditional branches in the order listed above.
- Non-quantum dialects are lowered via MLIR's built-in conversions.

Producing LLVM IR:

- After conversion to the LLVM dialect, produce LLVM IR with:

```
mlir-translate --mlir-to-llvmir input.mlir > output.ll
```
}];


let dependentDialects = [
"mlir::LLVM::LLVMDialect",
"mlir::QCDialect",
"mlir::LLVM::LLVMDialect",
];
}
Loading