import numpy as np
from common import qft_matrix

from qsim import H, apply_single, zero_state

np.set_printoptions(precision=3, suppress=True)

# QFT de |000>
after_qft = qft_matrix(3) @ zero_state(3)
print("QFT|000>      :", after_qft.real)

# Une porte H sur chacun des trois qubits
state = zero_state(3)
for q in range(3):
    state = apply_single(state, H, q)
print("H sur chaque qubit :", state)
print("identiques :", np.allclose(after_qft, state))
