microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
alex/pythontelem

Branches

Tags

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

Clone

HTTPS

Download ZIP

katas/content/key_distribution/shared_key/index.md

10lines · modepreview

Now, Alice has a list of the bit values she sent as well as what basis she prepared each qubit in, and Bob has a list of bases he used to measure each qubit and a list of measurement results. To extract the shared key, they need to figure out when they both used the same basis, keep the data from those steps, and toss the data from steps where they used different bases.

**Inputs:**

1. `basesAlice` and `basesBob`: `Bool` arrays of length $N$ describing Alice's and Bobs's choice of encoding/measurement bases, respectively.
2. `bits`: a `Bool` array of length $N$ describing either the bits Alice sent or Bob's measurement results.

**Output** : A `Bool` array representing the shared key generated by the protocol.

> You don't need to know both Alice's and Bob's bits to figure out the shared key - only one set of bits is enough!