Adding reset after measure if qubit is to be reused#3450
Adding reset after measure if qubit is to be reused#34501tnguyen merged 33 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
schweitzpgi
left a comment
There was a problem hiding this comment.
Will look at this more...
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com>
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
I posted #3565 to implement this pass in the linear SSA form. Hence, it might be better to do it as a follow-on task. |
schweitzpgi
left a comment
There was a problem hiding this comment.
Giving temporary approval. This ought to be re-done using the wire types.
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
* Add reset after measurement Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Add test Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Handle reg Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Add test for register Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Add test Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Update lib/Optimizer/Transforms/ResetBeforeReuse.cpp Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com> * Update include/cudaq/Optimizer/Transforms/Passes.td Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com> * Update include/cudaq/Optimizer/Transforms/Passes.h Co-authored-by: Eric Schweitz <eschweitz@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com> * Use new MLIR pass util Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Tidy up the code Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Add execution test Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Fix CI tests Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Fix a test Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Some tidy up Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Code review: tidy up the code Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Code review: Rename test files following convention Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Code review: order filename Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Code review: refactor test files Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Add more tests, especially targeting aliasing Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> * Code review: more comprehensive checks Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> --------- Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com> Signed-off-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com> Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Description
A pass to detect if qubit is to be reused after measurement. If so, insert a
resetand conditionalxgate based on measurement result in order to bring the qubit into the |0> or |1> state consistent with the measurement.Add the pass to
quantinuumtarget pipeline config.Add tests.
Modify the resource counting pre-process pass: move it down the JIT pipeline as the removal of gates in that pass may interfere with the program flow detection (i.e., whether a qubit is reused or not).