OptimizedFFTGridSampling

class OptimizedFFTGridSampling(energy_cutoff, maximum_average_prime_factor=None, maximum_grid_enlargement=None)

Create a grid sampling with sizes that are optimized for FFTs.

The Fast Fourier Transform algorithm works by splitting the grid into a hierachy of chunks, and the algorithms works most efficiently when the chunk sizes are small prime numbers. A good measure of the efficiency of the FFT is the average of the prime factors of the grid size. This object tries to find a grid sampling which is at least equivalent to a provided energy cutoff with as low an average prime factor of the grid sizes as possible within some constraints.

Parameters:
  • energy_cutoff (PhysicalQuantity of type energy.) – The energy cutoff to be used to determine the grid sampling. The energy cutoff must be a positive energy.

  • maximum_average_prime_factor (float) – The maximum value for the average prime factor of the grid points in each direction.
    Default: 5.0

  • maximum_grid_enlargement (float) – The grid can at maximum be expanded by this number. The default value of 0.1 implies that the number of grid points in each direction is allowed to be 10% larger when searching for a favorable prime factorization.
    Default: 0.1

energyCutoff()
Returns:

The energy cutoff.

Return type:

PhysicalQuantity of type energy

maximumAveragePrimeFactor()
Returns:

The maximum average prime factor.

Return type:

float

maximumGridEnlargement()
Returns:

The maximum grid enlargement.

Return type:

float

uniqueString()

Return a unique string representing the state of the object.