from numpy import pi
from qiskit import QuantumRegister, QuantumCircuit, execute, BasicAer
from qiskit.visualization import plot_histogram

qreg_q = QuantumRegister(3, 'q')
circuit = QuantumCircuit(qreg_q)
circuit.h(qreg_q[0])
circuit.cx(qreg_q[0], qreg_q[1])
circuit.cx(qreg_q[0], qreg_q[2])
circuit.measure_all()
circuit.draw(output='latex')

result_meas = execute(circuit, BasicAer.get_backend('qasm_simulator'))
counts = result_meas.result().get_counts()
plot_histogram(counts, figsize=(5,6), bar_labels=False, title="Probabilities")

