from qiskit import *  #qiskit framework

# Quantum_Register=QuantumRegister(2)
# classical_Register=ClassicalRegister(2)
# circut=QuantumCircuit(Quantum_Register,classical_Register) #those 3 lines are the same as the next line 
circut=QuantumCircuit(2,2)
circut.draw(output='mpl') #drawing function


circut.h(0) #handmard function
circut.cx(0,1) #Cnot function
circut.measure([0,1],[0,1]) #measuring between the qubits and calssical bits
circut.draw(output='mpl') #drawing

 

simulator=Aer.get_backend('qasm_simulator') #using simulator of quantaum comuter called qasm
resault=execute(circut,backend=simulator).result() #storing the resault of computation
from qiskit.visualization import plot_histogram #importing function of ploting histogram
plot_histogram(resault.get_counts()) #plot

from qiskit import *
# IBMQ.save_account(open("token.txt","r").read())  #signing in using my token in my txt file
IBMQ.load_account() #lading account


provider=IBMQ.get_provider("ibm-q")
quantaum_computer=provider.get_backend('ibmq_quito')
import qiskit.tools.jupyter
%qiskit_job_watcher

job =execute(circut,backend=quantaum_computer)


from qiskit.tools.monitor import job_monitor
job_monitor(job)

quantaum_resault=job.result()
plot_histogram(quantaum_resault.get_counts(circut))

%qiskit_disable_job_watcher