# Exercice 2 : de θ = π/3 et φ = π/2 à l'état et à ses probabilités
import cmath

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

theta, phi = np.pi / 3, np.pi / 2
state = make_state(np.cos(theta / 2), cmath.exp(1j * phi) * np.sin(theta / 2))
print("amplitudes :", rounded(state))
print("probabilités :", rounded(probabilities(state)))
print("point (x, y, z) =", rounded(bloch_vector(state)))
