qpp Accelerator: Check for post-measure gates more accurately
As a result of XACC IR being serialized, it's possible to have gates
follow Measure instructions without the circuit truly having
post-measure gates. For example:
H 0
Measure 0
H 1
Measure 1
In cases like that, the current QppAccelerator decides it cannot
simulate the circuit once and repeatedly sample the resulting state
vector to simulate "runs." That is an overzealous judgment, since none
of the gates that follow the Measure instructions actually depend on the
results of measurements.
So instead, in the QppAccelerator logic detecting post-measurement
gates, track which qubits have been measured, and only report
post-measurement gates if it sees a gate operating on a qubit with an
earlier Measure instruction.
Signed-off-by:
Austin Adams <aja@gatech.edu>
Please register or sign in to comment