Created
February 13, 2023 06:53
-
-
Save SaraM92/922d09b51b0173add2e0e257bcf87875 to your computer and use it in GitHub Desktop.
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
#Import needed libraries | |
from qiskit import QuantumRegister, ClassicalRegister | |
from qiskit import QuantumCircuit, execute | |
#Define the qubits and classical bit | |
q = QuantumRegister(2,'q') | |
c = ClassicalRegister(2,'c') | |
#Create a circuit | |
circuit = QuantumCircuit(q,c) | |
#Add gates and measure | |
circuit.h(q[0]) | |
circuit.cx(q[0],q[1]) | |
circuit.measure(q,c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment