Skip to content

Instantly share code, notes, and snippets.

@nidhijadhav
Created August 3, 2021 17:19
Show Gist options
  • Save nidhijadhav/4333ee41fca507f2fdd0e589deafa286 to your computer and use it in GitHub Desktop.
Save nidhijadhav/4333ee41fca507f2fdd0e589deafa286 to your computer and use it in GitHub Desktop.
# Create a quantum circuit with two qubits
qc = QuantumCircuit(2, 2)
# Create the bell pair
qc.h(0) # Apply a h-gate to the first qubit
qc.cx(0,1) # Apply a CNOT, using the first qubit as the control
qc.barrier() # Makes diagram neater by seperating gates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment