• Adams, Austin Joel's avatar
    qpp Accelerator: Check for post-measure gates more accurately · e741af2d
    Adams, Austin Joel authored
    
    
    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: Adams, Austin Joel's avatarAustin Adams <aja@gatech.edu>
    e741af2d
QppAccelerator.cpp 17.3 KB