import numpy as np

from common import point, rx, ry, rz, show
from qsim.etape1_un_qubit import ZERO

plus = np.array([1, 1]) / np.sqrt(2)

print("θ        RX(θ)|0⟩       RY(θ)|0⟩       RZ(θ)|+⟩")
for k, label in enumerate(("0", "π/2", "π", "3π/2", "2π")):
    theta = k * np.pi / 2
    print(f"{label:<8} {point(rx(theta) @ ZERO):<14} {point(ry(theta) @ ZERO):<14} {point(rz(theta) @ plus)}")

# Deux de ces états, écrits avec leurs amplitudes
print("RX(π/2)|0⟩ =", show(rx(np.pi / 2) @ ZERO))
print("RZ(π/2)|+⟩ =", show(rz(np.pi / 2) @ plus))
