Skip to content

Commit ea5fd11

Browse files
✅ Test translation to jeff (#1676)
## Description This PR extends our `jeff` round-trip tests by serializing and deserializing the `jeff` programs. Fixes #1667 ## Checklist - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~~I have added appropriate tests that cover the new/changed functionality.~~ - [x] ~~I have updated the documentation to reflect these changes.~~ - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] ~~I have added migration instructions to the upgrade guide (if needed).~~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. --------- Signed-off-by: burgholzer <burgholzer@me.com> Signed-off-by: Lukas Burgholzer <burgholzer@me.com> Co-authored-by: burgholzer <burgholzer@me.com>
1 parent 6dcfc52 commit ea5fd11

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Added
1313

14-
- ✨ Add a `merge-single-qubit-rotation-gates` pass for merging consecutive rotation gates using quaternions ([#1407], [#1674]) ([**@J4MMlE**], [**@MatthiasReumann**])
15-
- ✨ Add conversions between `jeff` and QCO ([#1479], [#1548], [#1565], [#1637]) ([**@denialhaag**])
14+
- ✨ Add a `merge-single-qubit-rotation-gates` pass for merging consecutive rotation gates using quaternions ([#1407], [#1674]) ([**@J4MMlE**], [**@denialhaag**], [**@MatthiasReumann**])
15+
- ✨ Add conversions between `jeff` and QCO ([#1479], [#1548], [#1565], [#1637], [#1676]) ([**@denialhaag**], [**@burgholzer**])
1616
- ✨ Add a `place-and-route` pass for mapping circuits to architectures with restricted topologies ([#1537], [#1547], [#1568], [#1581], [#1583], [#1588], [#1600], [#1664]) ([**@MatthiasReumann**], [**@burgholzer**])
1717
- ✨ Add initial infrastructure for new QC and QCO MLIR dialects
1818
([#1264], [#1330], [#1402], [#1428], [#1430], [#1436], [#1443], [#1446], [#1464], [#1465], [#1470], [#1471], [#1472], [#1474], [#1475], [#1506], [#1510], [#1513], [#1521], [#1542], [#1548], [#1550], [#1554], [#1567], [#1569], [#1570], [#1572], [#1573], [#1580], [#1602], [#1620], [#1623], [#1624], [#1626], [#1627], [#1635], [#1673], [#1675])
@@ -40,7 +40,7 @@ _If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#350)._
4040

4141
### Added
4242

43-
- ✨ Add support for multi-controlled gates to ZX package ([#1380]) ([**@keefehuang**])
43+
- ✨ Add support for multi-controlled gates to ZX package ([#1380]) ([**@keefehuang**], [**@denialhaag**])
4444
- ✨ Add Sampler and Estimator primitives to the QDMI-Qiskit interface ([#1507]) ([**@marcelwa**])
4545

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

362362
<!-- PR links -->
363363

364+
[#1676]: https://github.com/munich-quantum-toolkit/core/pull/1676
364365
[#1675]: https://github.com/munich-quantum-toolkit/core/pull/1675
365366
[#1674]: https://github.com/munich-quantum-toolkit/core/pull/1674
366367
[#1673]: https://github.com/munich-quantum-toolkit/core/pull/1673

cmake/ExternalDependencies.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ if(BUILD_MQT_CORE_MLIR)
3535
list(APPEND FETCH_PACKAGES Eigen)
3636

3737
# Fetch jeff-mlir
38-
set(BUILD_JEFF_MLIR_TRANSLATION
39-
OFF
40-
CACHE BOOL "Disable building the translation submodule of jeff-mlir")
4138
FetchContent_Declare(
4239
jeff-mlir
4340
GIT_REPOSITORY https://github.com/PennyLaneAI/jeff-mlir.git
44-
GIT_TAG v0.1.0)
41+
GIT_TAG v0.2.0)
4542
list(APPEND FETCH_PACKAGES jeff-mlir)
4643
endif()
4744

mlir/unittests/Conversion/JeffRoundTrip/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ target_link_libraries(
2020
MLIRSupportMQT
2121
MLIRTransforms
2222
MLIRJeffToQCO
23-
MLIRQCOToJeff)
23+
MLIRQCOToJeff
24+
MLIRJeffTranslation)
2425

2526
mqt_mlir_configure_unittest_target(${target_name})
2627

mlir/unittests/Conversion/JeffRoundTrip/test_jeff_round_trip.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include <gtest/gtest.h>
2121
#include <jeff/IR/JeffDialect.h>
22+
#include <jeff/Translation/Deserialize.hpp>
23+
#include <jeff/Translation/Serialize.hpp>
2224
#include <mlir/Dialect/Arith/IR/Arith.h>
2325
#include <mlir/Dialect/Func/IR/FuncOps.h>
2426
#include <mlir/IR/BuiltinOps.h>
@@ -111,6 +113,10 @@ TEST_P(JeffRoundTripTest, ProgramEquivalence) {
111113
printer.record(program.get(), "Canonicalized Converted jeff IR" + name);
112114
EXPECT_TRUE(verify(*program).succeeded());
113115

116+
// Serialize and deserialize to ensure the jeff program is valid
117+
auto data = serialize(*program);
118+
program = deserialize(context.get(), data);
119+
114120
EXPECT_TRUE(succeeded(convertJeffToQCO(program.get())));
115121
printer.record(program.get(), "Converted QCO IR" + name);
116122
EXPECT_TRUE(verify(*program).succeeded());

0 commit comments

Comments
 (0)