Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| add_custom_command( | ||
| TARGET mlir-doc | ||
| POST_BUILD | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/docs/ | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/docs/mlir/ | ||
| COMMAND ${CMAKE_COMMAND} -D DOCS_DIR:PATH=${CMAKE_CURRENT_SOURCE_DIR}/docs/mlir -P | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CleanMLIRDocs.cmake | ||
| COMMENT "Copying and cleaning up generated MLIR documentation" | ||
| VERBATIM) |
There was a problem hiding this comment.
This currently makes the configuration fail. I don't exactly understand what's going on, but it looks like the mlir-doc target is also being created by jeff-mlir, leading to interference.
Another problem seems to be that calling mlir-doc also triggers the generation of the Jeff documentation in the _deps directory.
Maybe it's possible to add flags to jeff-mlir to toggle the documentation generation. 🤔
There was a problem hiding this comment.
I haven't quite managed to work around this for now. Will have to reinvestigate at a later point.
|
A brief overview of everything that remains open: Main FunctionI have not yet looked into the proper conversion of a QC-style main function to a Jeff-style main function. The current implementation of the tests relies on bare-bones modules without a properly defined entry point. This might require some coordination with Xanadu, as we should align on what a Jeff-style main function exactly looks like. That said, the implementation of the conversion itself should be straightforward. Unconvertible QC OperationsThe following QC operations can currently not be converted to Jeff because they do not have a direct counterpart:
Unconvertible Jeff OperationsThe following Jeff operations can currently not be converted to QC because they do not have a direct counterpart:
In addition, the following additional conversions are not implemented yet, as I believe their implementation needs further discussion:
TestsThe current version of the tests does not perform proper equivalence checking but relies on (very minimal) string comparisons. |
|
I'll try to collect my thoughts here as well so that there is some kind of record of them.
I think going from MQT -> Jeff should not be particularly hard, as we have a much simpler setup in general (at least for now).
Based on the discussions in unitaryfoundation/jeff#38,
Based on the discussions in unitaryfoundation/jeff#38,
Based on the discussions in unitaryfoundation/jeff#38,
Based on the discussions in unitaryfoundation/jeff#38, these should be converted to Pauli Rotations.
Based on the discussions in unitaryfoundation/jeff#38, these should be converted to custom gates.
While not explicitly mentioned in unitaryfoundation/jeff#38, I believe a
Based on the semantic description, I would argue that our
Based on the semantics in the spec, I would argue that
These will be a little trickier to support.
Given how prevalent these PPRs are in FTQC literature, we may sooner or later add this as a dedicated primitive to our supported gates. For now, we may convert the specializations but may fail the conversions for general rotations. As for custom gates, what we could do here is to support matching the names of gates that we could not explicitly export as well known gates (xx_plus_yy, ecr, etc.) so that a roundtrip of all MQT gates would work.
This very much depends on how we decide to handle registers. Hopefully, we can resolve this soon.
As discussed offline, these conversion patterns could become part of the Jeff-mlir repository itself. It may be worth opening an issue about that over there.
I would guess that roundtrip tests could be pretty effective here at catching issues. |
## Description This PR contains minor improvements to the MLIR code that I have stumbled across during #1479. I'm opening up this PR to keep #1479 a bit leaner. ## 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: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
| /// \name JeffRoundTrip/Operations/StandardGates/HOp.cpp | ||
| /// @{ | ||
| INSTANTIATE_TEST_SUITE_P( | ||
| QCHOpTest, JeffRoundTripTest, |
There was a problem hiding this comment.
@burgholzer, I just wanted to confirm that I'm applying the new test infrastructure correctly. Two questions:
- Is
JeffRoundTrip/Operations/StandardGates/HOp.cppcorrect? If it's meant to refer to a file, that file, of course, wouldn't exist. - Is the instantiation name meant to be
QCHopTesthere? In principle, this does make sense to me, as the test starts with aqc.hoperation.
I have adapted this from here:
core/mlir/unittests/Conversion/QCToQCO/test_qc_to_qco.cpp
Lines 176 to 179 in d9209b7
There was a problem hiding this comment.
I think this is generally a consequence of an earlier design in the test PR where I had all of these split into separate files. That led to crazy long compile times though, so I combined everything back into one.
I still wanted to somehow have separators between the individual tests. What you linked is the end result of that.
It's definitely not perfect, so we can happily adjust it. I just want a way to separate the individual test groups and have something to easily search for in the file.
Best case, we would not even do round trip tests here, but would have the jeff Builder and verify both conversions similarly to how we verify QC<->QCO.
Probably the round trip tests do not hurt though and I think the current structure should be fine.
Feel free to tweak the names of the tests. (Shouldn't this be QCO for example, and shouldn't it be HOp?)
Does any of that make sense?
There was a problem hiding this comment.
I think this is generally a consequence of an earlier design in the test PR where I had all of these split into separate files. That led to crazy long compile times though, so I combined everything back into one.
I still wanted to somehow have separators between the individual tests. What you linked is the end result of that.
Okay, that makes perfect sense to me!
Best case, we would not even do round trip tests here, but would have the jeff Builder and verify both conversions similarly to how we verify QC<->QCO.
Agreed. I'd see the current round-trip-only tests as a temporary solution until we have a Jeff builder.
Shouldn't this be QCO for example, and shouldn't it be HOp?
At this very moment, the conversion is still between QC and Jeff, but I'll change this tomorrow! I wanted to put the testing on a more solid footing first. If I'm not mistaken, updating the tests after the change should be very straightforward now (basically, search and replace QC with QCO).
Description
This PR adds conversions for the Jeff dialect.
Related to #1196
Checklist: