from common import counting_counts, phase_estimation

from qsim import ONE, T

t = 3
counts = counting_counts(phase_estimation(T, ONE, t), t, shots=1000, seed=42)
print("counts :", counts)
bits = max(counts, key=counts.get)
print(f"φ = {int(bits, 2)} / {2**t} = {int(bits, 2) / 2**t}")
