import numpy as np
from common import counting_counts, phase_estimation

from qsim import X, ZERO, make_state

t = 3
minus = make_state(1 / np.sqrt(2), -1 / np.sqrt(2))
for name, state in (("|->", minus), ("|0>", ZERO)):
    counts = counting_counts(phase_estimation(X, state, t), t, shots=1000, seed=42)
    print(f"X, cible {name} :", counts)
