Created
December 27, 2020 07:56
-
-
Save brianlechthaler/da84a8ed0e6fc9d369685cf7f14132a3 to your computer and use it in GitHub Desktop.
Simple Superpositioning Example (QASM2)
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
OPENQASM 2.0; | |
include "qelib1.inc"; | |
# Initialize 1 quantum register (1 qubit) | |
qreg q[1]; | |
# Initialize 1 classic register (1 bit) | |
creg c[1]; | |
#Place a Hadamard gate at the beginning of the first qubit | |
h q[0]; | |
# Take a measurement on the first qubit after applying the Hadamard gate, save result to the first classical bit | |
measure q[0] -> c[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment