microsoft/qdk

Public

mirrored from https://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/prepare_qubits/Solution.qs

12lines · modecode

1namespace Kata {
2 operation PrepareQubits(qs : Qubit[], bases : Bool[], bits : Bool[]) : Unit {
3 for i in 0 .. Length(qs) - 1 {
4 if bits[i] {
5 X(qs[i]);
6 }
7 if bases[i] {
8 H(qs[i]);
9 }
10 }
11 }
12}
13