SHARE
TWEET

Untitled

a guest May 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import qiskit as qk
  2.  
  3. # defining our Qubits and Bits
  4. q = qk.QuantumRegister(2)
  5. c = qk.ClassicalRegister(2)
  6.  
  7. # Creating a circuit with our Qubits and Bits
  8. circuit = qk.QuantumCircuit(q, c)
  9.  
  10. # Adding Gates
  11. '''
  12. Hadamard Gate on the first Qubit and a
  13. CNOT Gate on the first and second Qubit
  14. '''
  15. circuit.h(q[0])
  16. circuit.cx(q[0], q[1])
  17.  
  18. # Measuring our Qubits at the end
  19. circuit.measure(q, c)
  20.  
  21. # Visualising the circuit
  22. print (circuit)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top