Created
July 9, 2020 12:21
-
-
Save datafatmunger/a9e0da8ef9cf5a3667a065c9a4381016 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 numpy as np | |
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, IBMQ, Aer | |
crz, crx, result = ClassicalRegister(1), ClassicalRegister(1), ClassicalRegister(1) | |
q = QuantumRegister(3) | |
qc = QuantumCircuit(q, crz, crx, result) | |
qc.x(0) | |
## Bell pair - JBG | |
qc.h(1) | |
qc.cx(1, 2) | |
qc.barrier(q) | |
qc.cx(0, 1) | |
qc.measure(1, 1) | |
qc.x(2).c_if(crx, 1) | |
qc.h(0) | |
qc.measure(0, 0) | |
qc.z(2).c_if(crz, 1) | |
qc.measure(2, 2) | |
counts = execute(qc, Aer.get_backend('qasm_simulator')).result().get_counts() | |
print(counts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment