import numpy as np

from qsim import H

np.set_printoptions(precision=3, suppress=True)

rho_plus = np.array([[0.5, 0.5], [0.5, 0.5]])
rho_coin = np.array([[0.5, 0.0], [0.0, 0.5]])

for name, rho in (("A", rho_plus), ("B", rho_coin)):
    after = H @ rho @ H.conj().T  # une porte U agit en U ρ U†
    print(f"source {name} après H : probabilités {np.diag(after).real}")
