# Phase globale : on multiplie les DEUX amplitudes par le même e^(iφ)
import cmath

import numpy as np
from common import h
from qsim.etape1_un_qubit import make_state, probabilities

state = make_state(0.6, 0.8)
for phi in [0, 1.0, np.pi / 2, np.pi]:
    shifted = cmath.exp(1j * phi) * state
    direct = np.round(probabilities(shifted), 3)
    after_h = np.round(probabilities(h(shifted)), 3)
    print(f"φ = {phi:.3f}   lecture directe : {direct}   après h : {after_h}")
