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

9lines · modecode

1namespace Kata {
2 operation DistinguishCNOTfromSWAP (unitary : (Qubit[] => Unit is Adj + Ctl)) : Int {
3 use qs = Qubit[2];
4 X(qs[1]);
5 unitary(qs);
6 Reset(qs[1]);
7 return MResetZ(qs[0]) == Zero ? 0 | 1;
8 }
9}
10