% Compute the Fourier transform of the potential
%
% Samuli Siltanen March 2012

% Load evaluation points
load data/kvec kvec

% Create numerical integration quadrature
[t,w]   = gaussint(80,-1,1);
[t1,t2] = meshgrid(t);
[w1,w2] = meshgrid(w);
W       = w1.*w2;

% Evaluate potential at quadrature points
q = poten(abs(t1+i*t2));

% Initialize the result
Fq = zeros(size(kvec));

% Loop over k values
for iii = 1:length(kvec)
    k = kvec(iii);
    
    % Construct integrand
    intgnd = q.*exp(-i*(-2*real(k)*t1+2*imag(k)*t2));
    
    % Integrate
    Fq(iii) = W(:).'*intgnd(:);
    
end

% Save result to file
save data/Fq Fq kvec

