microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
katas/content/random_numbers/random_two_bits/Placeholder.qs
15lines · modecode
| 1 | namespace Kata { |
| 2 | open Microsoft.Quantum.Measurement; |
| 3 | operation RandomTwoBits() : Int { |
| 4 | // Implement your solution here... |
| 5 | |
| 6 | return -1; |
| 7 | } |
| 8 | |
| 9 | // You can use the operation defined in the previous exercise to implement your solution. |
| 10 | operation RandomBit() : Int { |
| 11 | use q = Qubit(); |
| 12 | H(q); |
| 13 | return MResetZ(q) == Zero ? 0 | 1; |
| 14 | } |
| 15 | } |
| 16 | |