# Quantum Computation 

import qiskit
print(qiskit.__version__)

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]

# How co-related fourier transform of function g to function f.
# we will check for probability '00', if p(f,g) >= 0.05, then, 
# fourier transform of function g co-related to function f.

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

zero = qi.Statevector.from_label('00') # '00' or '01' or '10' or '11'
sv = zero.evolve(circ)
probs = sv.probabilities_dict()
plot_histogram(probs)

