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/grovers_search/conditional_phase_flip/Solution.qs

11lines · modecode

1namespace Kata {
2 open Microsoft.Quantum.Math;
3 operation ConditionalPhaseFlip(qs : Qubit[]) : Unit is Adj + Ctl {
4 within {
5 ApplyToEachA(X, qs);
6 } apply {
7 Controlled Z(qs[1 ...], qs[0]);
8 }
9 R(PauliI, 2.0 * PI(), qs[0]);
10 }
11}
12