microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dmitryv/select-updated

Branches

Tags

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

Clone

HTTPS

Download ZIP

katas/content/random_numbers/random_bit/index.md

13lines · modepreview

**Input:** None.

**Goal:** Generate a $0$ or $1$ with equal probability.
<details>
  <summary><b>Need a hint?</b></summary>
  Use the allocated qubit, apply a quantum gate to it, measure it and use the result to return a $0$ or $1$.
</details>

**Stretch goal:** Can you find a different way to implement this operation?
<details>
  <summary><b>Need a hint?</b></summary>
  What are the different quantum states that produce $0$ and $1$ measurement results with the same probability? How would measuring the qubit in a different basis change the result?
</details>