Created
May 14, 2020 06:14
-
-
Save billchenxi/a81ffca9851eb21cd1c0017f7e901723 to your computer and use it in GitHub Desktop.
Q# Supoerposition
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
namespace Q_superposition { | |
open Microsoft.Quantum.Canon; | |
open Microsoft.Quantum.Intrinsic; | |
operation Superposition() : Result { | |
mutable state = Zero; | |
using (qubit = Qubit()) { | |
H(qubit); | |
set state = M(qubit); | |
Reset(qubit); | |
} | |
return state; | |
} | |
@EntryPoint() | |
operation Driver_Code() : Result { | |
Message($"Supoposition: "); | |
return Superposition(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment