import qiskit.quantum_info as qi
from qiskit.circuit.library import FourierChecking
from qiskit.tools.visualization import plot_histogram


#Fourier checking algoirthm
f=[1,-1,-1,-1]
g=[1,1,-1,-1]

#if probability of fouriere checking f,g > 0 = correlation 


circ = FourierChecking(f=f,g=g)
circ.draw()


zero = qi.Statevector.from_label('00')
sv = zero.evolve(circ)
probs = sv.probabilities_dict()
plot_histogram(probs)


# fourier transform of function g is correlated 