Closed 1tnguyen closed 3 years ago
In the following example:
qubit target; qubit control; z target; ctrl @ z control, target;
The generated MLIR looks like:
%1 = q.extract(%0, %c0_i64) : !quantum.Qubit %2 = q.qalloc(1) { name = control } : !quantum.Array %3 = q.extract(%2, %c0_i64) : !quantum.Qubit %4 = qvs.z(%1) : !quantum.Qubit q.ctrl_region { %5 = qvs.z(%4) : !quantum.Qubit } (ctrl_bit = %3) // END CTRL
The SSA value %4 accidentally links the two QVS ops leading to wrong gate cancellation.
Related to: https://github.com/ORNL-QCI/qcor/issues/216
In the following example:
The generated MLIR looks like:
The SSA value %4 accidentally links the two QVS ops leading to wrong gate cancellation.
Related to: https://github.com/ORNL-QCI/qcor/issues/216