import numpy as np

from common import show
from qsim.etape1_un_qubit import make_state, measure

rng = np.random.default_rng(7)

# Trois états différents, lus chacun une fois
for a, b in ((0.6, 0.8), (0.6, -0.8), (0.28, 0.96)):
    state = make_state(a, b)
    outcome, after = measure(state, rng)
    print(f"avant {show(state):<13} lu : {outcome}   après {show(after)}")
