The technique described above for the implementation of the Fourier
transforms implies strong limitations for the lattice size, both due to
addressing issues and due to memory requirement issues. We will examine
here these limitations, and we will see that the technique is still
usable for lattices with the usual sizes in the important cases and
. For these lattices a set of routines implementing the transforms
in the fastest possible way is supplied. For larger lattices a different
set of routines is supplied, in which the indexation matrices
and
are not
implemented directly in memory, but rather by functions that dynamically
calculate and return the index
of the phases, appropriately
shifted, given values of the coordinate indices
and
.
These routines are about
to
times slower, but can be used for
very large lattices, with much smaller memory requirements.
First of all, note that since the indexation matrices are defined as
-byte signed integers, they are limited to the range
,
that is, to
different values. Therefore this last number is the
maximum size of the indexed array of phases
. This implies that
there are limits to the possible lattice sizes
in each dimension
,
as shown in the following table:
![]() |
![]() |
RAM![]() |
1 | 181 | 64 kB |
2 | 128 | 520 MB |
3 | 105 | 2497 GB |
4 | 91 | 8560 TB |
5 | 81 | 22 EB |
Here the corresponding maximum required amounts of RAM are also shown and
the order of the unit multipliers is k, M, G, T, P and E, ranging from
to
, so we see that in the case of the higher dimensions
the memory requirements are truly enormous for the larger lattices still
allowed by this indexing limitation. Specially for dimensions
and
, these are larger lattices than one can possibly expect to run
successfully on current computers. On
-bit processors there is
another type of limitation on the values of
, which is far more
serious for the larger values of
. The limitations of the signed
-bit integer addressing of the indexation matrices limits their size,
and hence the size of the lattice, as shown in the following table:
![]() |
![]() |
RAM![]() |
1 | 32767 | 2 GB |
2 | 181 | 2 GB |
3 | 31 | 2 GB |
4 | 13 | 2 GB |
5 | 7 | 2 GB |
In this case the addressing limitations correspond to a fixed maximum
required memory, of course. In addition to this, the limitations of the
signed -bit integer addressing of the indexed array of phases also
limits its size and the size of the lattice, but this one is a
significant limitation only for the case
, which is relatively
irrelevant to us, as shown in the following table:
![]() |
![]() |
RAM![]() |
1 | 11585 | 2 GB |
2 | 8192 | 2 GB |
3 | 6689 | 2 GB |
4 | 5793 | 2 GB |
5 | 5181 | 2 GB |
Therefore, we see that this last limitation can be safely ignored. The
corresponding limitations in the case of a -bit processor with
-bit addressing are smaller, and not so significant, since in this
case the memory availability limitations become relevant much before the
addressing limitations themselves. The limits due to the
-bit
addressing of the indexation matrices are shown in the following table:
![]() |
![]() |
RAM![]() |
1 | 8388607 | 128 TB |
2 | 2896 | 128 TB |
3 | 203 | 128 TB |
4 | 53 | 128 TB |
5 | 24 | 128 TB |
The limits due to the -bit addressing of the indexed array of phases
are shown in the following table:
![]() |
![]() |
RAM![]() |
1 | 2965821 | 128 TB |
2 | 2097152 | 128 TB |
3 | 1712317 | 128 TB |
4 | 1482910 | 128 TB |
5 | 1326355 | 128 TB |
If we consolidate all these indexing and addressing limitations in a
single table, we see that the limits on a -bit processor with
-bit logical addressing are given by the table below:
![]() |
![]() |
RAM![]() |
1 | 181 | 64 kB |
2 | 128 | 520 MB |
3 | 31 | 2 GB |
4 | 13 | 2 GB |
5 | 7 | 2 GB |
The same limits on a -bit processor with
-bit logical addressing
are given by the table below:
![]() |
![]() |
RAM![]() |
1 | 181 | 64 kB |
2 | 128 | 520 MB |
3 | 105 | 2497 GB |
4 | 53 | 128 TB |
5 | 24 | 128 TB |
A typical larger lattice in would have
, and in this case the
transform can be used with reasonable memory requirements, about
MB
for a single indexation matrix, and about
MB for two indexation
matrices. A lattice of
in
can be used with memory
requirements of about
MB for one matrix and of about
MB for
two matrices. Therefore, we conclude that the fast version of the
transforms can be used in practice in most simulations. Whenever there is
not enough memory available, one can turn to the alternative routines.
There are Fortran routines available implementing the direct and inverse
Fourier transforms, as described in this paper. There are also a few test
programs that may be useful as examples of how to use the routines. As
they currently stand, these routines are written for use in either
-bit or
-bit processors. However, sufficiently large lattices may
require a
-bit processor, as well as lots of available memory. The
files described in what follows, containing the source code, are freely
available in a compressed tar file at the URL:
There are files with the definition of the necessary data structures, as well as the initialization routines and the transforms themselves. These modules are meant to be integrated into larger programs at a source-code level. The files containing the data structures are include files, meant to be included in the modules that need access to the data structures they contain. All interchange of data among modules is made by means of common blocks. Each initialization routine defines the data in the common block in the corresponding include file. These initialization routines should be called once at the beginning of the program, one for each common block that is used in the program. Read the makefile or the source code in order to see which modules depend on which data structures.
Here are short explanations of the nature of each source-code file. First the files with the data structures:
The files containing the main routines, including the initialization routines and the transforms themselves:
Files containing the test programs and some auxiliary routines, including a couple of C interfaces to system facilities: