Skip to content

Instantly share code, notes, and snippets.

@elbruno
Last active December 19, 2017 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbruno/9cd266bf802020d5d09be39cd1852141 to your computer and use it in GitHub Desktop.
Save elbruno/9cd266bf802020d5d09be39cd1852141 to your computer and use it in GitHub Desktop.
QuantumDevKitHgate Sample
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