microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.13

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

samples/testing/classical_values/src/Measurement.qs

7lines · modepreview

/// # Summary
/// Prepares the qubits in the given basis state, measures them, and returns the measurement result.
operation MeasureBasisState(bits : Bool[]) : Result[] {
    use qs = Qubit[Length(bits)];
    ApplyPauliFromBitString(PauliX, true, bits, qs);
    return MResetEachZ(qs);
}