cuda-quantum icon indicating copy to clipboard operation
cuda-quantum copied to clipboard

Update the qubit mapping pass to use wire sets

Open bmhowe23 opened this issue 1 year ago • 3 comments

This PR contains a collection of changes that were originally developed on the features/qubit-mgmt branch, but they have been isolated such that they can be merged into main, independent of that feature branch. The changes have not been previously reviewed, so they need to be reviewed just like normal in this PR.

  • ~~Make the add-wireset pass add one quake.wire_set per function. The problem with the old approach of one per module is shown in a newly added test case (test/Quake/wires_to_wireset.qke). (The problem was that nested functions could borrow the same wire twice, which is not a good idea.) I backed these changes out.~~ Edit: Adam is going to make a separate PR to resolve the issue.
  • Make the qubit-mapping pass operate on wires from a wire set rather than unnumbered null wires. This is the main point of the PR. This makes the qubit IDs used in the pass explicit rather than implicit. (However, the IDs are still dropped on the floor if the IR goes through the regtomem pass, which it does for now; this is no worse than it was before.)
  • The qubit-mapping pass now manipulates the top level module by adding a mapped_wireset symbol in accordance with the user-provided device topology. Hence, the pass was split into a "prep" pass (to operate on the module) and a "func" pass (to operate on each function).
  • Update regtomem to understand wire sets.
  • Update CircuitCheck to understand wire sets to enable the existing mapping tests to continue working.
  • Fix a bug in the quake::WireSetOp::parse function. The bug only occurred when it was parsing an op with that was set to private.

bmhowe23 avatar Aug 19 '24 12:08 bmhowe23

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions[bot] avatar Aug 19 '24 15:08 github-actions[bot]

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions[bot] avatar Aug 19 '24 18:08 github-actions[bot]

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions[bot] avatar Aug 19 '24 20:08 github-actions[bot]

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions[bot] avatar Aug 20 '24 20:08 github-actions[bot]

I assume the empty file will be removed.

schweitzpgi avatar Aug 20 '24 22:08 schweitzpgi

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions[bot] avatar Aug 20 '24 22:08 github-actions[bot]