Organize two_qubit_decompose code#15880
Conversation
|
One or more of the following people are relevant to this code:
|
Cryoris
left a comment
There was a problem hiding this comment.
In general I agree to move re-used logic into a common.rs module, but if there's logic that's specific to a single file then I think it's clearer to keep it there. That shows where the logic is required, and importantly does not require making functions or consts pub. Having pub functions like this makes it harder to refactor and understand where it's actually used.
My motivation here is that the main files for the decomposers (basis decomposer, controlled-u decomposer and weyl decomposer) should mainly include code that is specifically relevant for these decomposers. |
I agree we should move re-used code there, but it's not re-used yet -- do we have any other methods in the pipeline we want to add that would use this? There's obviously no hard rule on how to do this, but we also don't need to change things unnecessarily since we do have to review these changes in the end 🙂 |
|
OK, so I moved back the consts and functions from common.rs to their original files, and added comments indicating these are helper functions / constant matrices. |
Cryoris
left a comment
There was a problem hiding this comment.
LGTM, thanks for the updates!
Summary
Following the discussions on #15833 and #15835, this PR continues the code organization of
crates/synthesis/src/two_qubit_decomposeDetails and comments