from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute, Aer, IBMQ
from qiskit.tools.visualization import plot_histogram , circuit_drawer

qr = QuantumRegister(16)
cr = ClassicalRegister(16)
qc = QuantumCircuit(qr, cr)


import bitarray
s1 = ";)"
s2 = "8)"

b1 = bitarray.bitarray()
b1.fromstring(s1)

b2 = bitarray.bitarray()
b2.fromstring(s2)

# print the bit sequences
print("b1 =", b1)
print("b2 =", b2)

# qr[0] ---->     qr[15]
# 0011 1011 0010 1001" # s1 bit sequence
# 0011 1000 0010 1001" #s2 bit sequence

# Notice the difference between s1 and s2 -- bits 7 (qr[6]) and 8 (qr[7]) are different. 
# 11 (s1)
# 00 (s2)
# All other bits are identical

# First take care of all other qubits  -- APPLY x gates for appropriate qubits

# YOUR CODE HERE:



# We want both qr[6],qr[7] as 00 or 11 to get either 8 or ; respectively. 
# Apply a controlled-NOT gate between 6 and 7 , so that when qubit 6 is "1", 7 also becomes 1

# YOUR CODE HERE:


# MEASURE:


# DRAW Circuit




# SET THE API:


# EXECUTE ON REMOTE BACKEND:


# Results:
result.status()
stats = result.result().get_counts()
plot_histogram(stats)