With the operators coded, you are one line away from the solution to Poisson's equation!
Uncomment the remaining lines in ``poisson.m'' and replace the ``...'' on the line labeled ``CODE INSERTION # 2'' with your single line solution to Poisson's equation. You may then run ``poisson.m'' to check your results!
To confirm your solution, ``poisson.m'' first takes the real part (due
to rounding errors and that fact that the Fourier transformation is
complex, tiny imaginary parts creep into your solution), and then
plots slices of your solution through planes passing through the
center point of the cell. Finally, ``poisson.m'' compares the known
analytic result with the integral for the total Coulomb energy,
, obtained with your numerical solution for
.
Hint: The comparison of energies should agree to four
significant figures.