from qiskit import QuantumCircuit

# COMBINED / cross-detector: a 2-qubit gate cx(0,1) on q0 between two
# measures of q0 correctly SUPPRESSES DoubleMeas (an op touches q0 between),
# yet the same cx is a gate on q0 applied after the first measure, so it
# TRIGGERS OpAfterMeas. Demonstrates that one detector fires while the other
# must not.
qc = QuantumCircuit(2, 2)
qc.reset(0)
qc.reset(1)
qc.measure(0, 0)
qc.cx(0, 1)        # gate on q0 between measures -> suppresses DoubleMeas,
                   # but is itself a gate after measure -> OpAfterMeas on q0
qc.measure(0, 0)
