function X = fastBlockCirculant( c, Q )
% Fast multiplication of block circulant matrices with circulant blocks. 
% 
%  c = vector of first column of block circulant matrix. 
%  Q = matrix of potentials  
%  X = matrix of charges 
% 
% Alex Townsend, September 2014

[n, n] = size( Q );                % matrix of potentials
D = fft(fft(reshape(c,n,n)).').';  % eigenvalues. 
X = D.*fft( fft( Q ).' ).';        % Apply the eig decomp
X = ifft( ifft(X).').';            % Apply the eig decomp

end
