I need a citation for this, as I recall reading it in passing, (that control and measurement commute,) but, for the life of me at the moment, I cannot recall the specific source in which I read it. Tested here, also in Q# unit tests, it seems to work, as would make sense. I'm sorry for that.
Think of a quantum control bit as acting in a superposition of |0> and |1>. Measurement, whether immediately before or after the controlled operation, collapses into one or the other, being the same as applying the controlled operation on either side of measurement, (though non-unitary).
I need a citation for this, as I recall reading it in passing, (that control and measurement commute,) but, for the life of me at the moment, I cannot recall the specific source in which I read it. Tested here, also in Q# unit tests, it seems to work, as would make sense. I'm sorry for that.
Think of a quantum control bit as acting in a superposition of |0> and |1>. Measurement, whether immediately before or after the controlled operation, collapses into one or the other, being the same as applying the controlled operation on either side of measurement, (though non-unitary).