microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
samples/testing/classical_values/src/Measurement.qs
7lines · modeblame
897a397fMariia Mykhailova1 years ago | 1 | /// # Summary |
| 2 | /// Prepares the qubits in the given basis state, measures them, and returns the measurement result. | |
| 3 | operation MeasureBasisState(bits : Bool[]) : Result[] { | |
| 4 | use qs = Qubit[Length(bits)]; | |
| 5 | ApplyPauliFromBitString(PauliX, true, bits, qs); | |
| 6 | return MResetEachZ(qs); | |
| 7 | } |