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

quantum_bit = 1
classical_bit = 1
circ = QuantumCircuit(quantum_bit, classical_bit)

circ.x(0)

circ.draw(output='mpl')

visualize_transition(circ)

circ.measure(0, 0)

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


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

visualize_transition(circ)


circ.measure(0, 0)

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