from qiskit import *
from qiskit.tools.visualization import plot_histogram

circuit = QuantumCircuit(1,1)

circuit.draw(output='mpl', initial_state=True)

circuit.measure(0,0)

simulator = Aer.get_backend('qasm_simulator')
result = execute(circuit, backend = simulator, shots =1024).result()
counts = result.get_counts()
plot_histogram(counts)

circuit.h(0)
circuit.z(0)
circuit.h(0)
circuit.measure(0,0)
circuit.draw(output='mpl', initial_state=True)

simulator = Aer.get_backend('qasm_simulator')
result = execute(circuit, backend = simulator, shots =1024).result()
counts = result.get_counts()
plot_histogram(counts)

