!pip install qiskit

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

f=[1,-1,-1,-1]
g=[1,1,-1,-1]
#The Discrete Fourier Transform (DFT) is a mathematical algorithm used to compute the discrete Fourier transform of a sequence.
#It takes a sequence of N complex numbers as input and produces another sequence of N complex numbers as output.

#fourier checking would tell how correlated the fourier transforrmation of G is to F
#P(f,g)>0.05-> then our function is correlated
circ=FourierChecking(f=f,g=g)
circ.draw(initial_state = True)

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

