from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram, visualize_transition

qc = QuantumCircuit(1,1)

qc.h(0)

visualize_transition(qc)

qc.measure(0,0)

qc.draw(output='mpl')

simulator = Aer.get_backend('qasm_simulator')

result = execute(qc, backend=simulator, shots=1024).result()
counts = result.get_counts()
plot_histogram(counts)

qc3 = QuantumCircuit(1,1)
qc3.x(0)
qc3.h(0)
qc3.draw(output='mpl')

visualize_transition(qc3)

qc3.measure(0,0)
qc3.draw(output='mpl')

result = execute(qc3, backend=simulator, shots=1024).result()
counts = result.get_counts()
plot_histogram(counts)

qc2 = QuantumCircuit(1,1)
qc2.h(0)
qc2.h(0)
qc2.draw(output='mpl')

visualize_transition(qc2)


qc2.measure(0,0)

result = execute(qc2, backend=simulator, shots=1024).result()
counts = result.get_counts()
plot_histogram(counts)

from qiskit.visualization import plot_bloch_multivector
qc4 = QuantumCircuit(1,1)
qc4.h(0)

qc4.measure(0,0)

qc4.h(0)

qc4.draw(output='mpl')

backend = Aer.get_backend('statevector_simulator')
result = execute(qc4, backend).result()
statevector = result.get_statevector(qc4)
plot_bloch_multivector(statevector)