from common import counting_counts, phase_estimation, phase_gate

from qsim import ONE

t = 3
state = phase_estimation(phase_gate(0.625), ONE, t)
counts = counting_counts(state, t, shots=1000, seed=42)
print("counts :", counts)
for bits in counts:
    print(f"{bits} -> φ = {int(bits, 2)} / {2**t} = {int(bits, 2) / 2**t}")
