Skip to content

Instantly share code, notes, and snippets.

View nidhijadhav's full-sized avatar

Nidhi Jadhav nidhijadhav

  • Boston
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nidhijadhav on github.
  • I am nidhijadhav (https://keybase.io/nidhijadhav) on keybase.
  • I have a public key whose fingerprint is 2FF2 C6DC 624E B1AC F05E 7252 E7D2 610D DFCD 6DD7

To claim this, I am signing this object:

# After recieving Alice's qubit, Bob applies the decoding protocol
qc.cx(0,1)
qc.h(1)
# Bob measures his qubits to read Alice's message
qc.measure_all()
# Draw output
qc.draw()
# Alice chooses her message onto qubit 0.
# I choose 11, but you can choose any of the 4 options and test it out
msg = "11"
# Encode message with appropriate gates
if msg == "00":
pass # To send 00 we do nothing
elif msg == "10":
qc.x(0) # To send 10 we apply an X-gate
elif msg == "01":
# 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
from qiskit import QuantumCircuit
from qiskit import IBMQ, Aer, transpile, assemble
from qiskit.visualization import plot_histogram
## import the necessary tools for our work
%matplotlib inline
from IPython.display import clear_output
from qiskit import *
from qiskit.visualization import plot_histogram
import numpy as np
import matplotlib.pyplot as plotter
from qiskit.tools.monitor import job_monitor
import seaborn as sns, operator
sns.set_style("dark")
# initialization
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'svg' # Makes the images look nice
import numpy as np
# importing Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute