Last active
December 19, 2017 03:25
-
-
Save elbruno/9cd266bf802020d5d09be39cd1852141 to your computer and use it in GitHub Desktop.
QuantumDevKitHgate Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
operation HGate (initial: Result) : (Result) | |
{ | |
body | |
{ | |
mutable res = Zero; | |
using (qubits = Qubit[1]) | |
{ | |
let qubit = qubits[0]; | |
H(qubit); | |
set res = M (qubit); | |
if (res == One) | |
{ | |
X(qubit); | |
} | |
} | |
return (res); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment