import numpy as np 
from qiskit import *

print("successful!")

# define quantum circuit 
N = 15
qc = QuantumCircuit(N, N)

# add quantum gates 
qc.h(0)
for i in range(N - 1):
    qc.cnot(i, i + 1)

    
# add barrier 
qc.barrier(range(N))

# add measurement gauge/device
qc.measure(range(N), range(N))

qc.draw('mpl')

# run the circuit

# get the backend 
backend = Aer.get_backend('qasm_simulator')

# do the measurements/execution 
job = execute(qc, backend, shots=10000)

# get result
result = job.result()
counts = result.get_counts()

print(counts)

from qiskit.visualization import plot_histogram
plot_histogram(counts)


