# Exercice 1 : placer l'état (0,6 ; 0,8) sur la sphère
import numpy as np
from common import bloch_angles, bloch_vector, rounded
from qsim.etape1_un_qubit import make_state, probabilities

state = make_state(0.6, 0.8)
theta, phi = bloch_angles(state)
x, y, z = bloch_vector(state)
print("θ =", round(theta, 3), "rad, soit", round(float(np.degrees(theta)), 1), "degrés   φ =", round(phi, 3))
print("point (x, y, z) =", rounded([x, y, z]))
print("P(0) =", round(float(probabilities(state)[0]), 3), "  (1 + z)/2 =", round((1 + z) / 2, 3))
