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/distinguishing_unitaries/h_x/Solution.qs

11lines · modecode

1namespace Kata {
2 operation DistinguishHfromX(unitary : (Qubit => Unit is Adj + Ctl)) : Int {
3 use q = Qubit();
4 within {
5 unitary(q);
6 } apply {
7 X(q);
8 }
9 return MResetZ(q) == Zero ? 0 | 1;
10 }
11}
12