(git:e90df42)
Loading...
Searching...
No Matches
kpoint_lattice_fft Module Reference

Batched lattice Fourier transforms on regular k-point grids. More...

Data Types

type  k_grid_to_cell_work_type

Functions/Subroutines

logical function, public regular_kpoint_grid (xkp, nkp_grid, grid_index, k_offset, allow_incomplete)
 Test and map a uniformly shifted reciprocal grid or an explicitly allowed subset.
logical function, public lattice_fft_shape (n, nfft, allow_arbitrary)
 Find backend-supported FFT dimensions that preserve the original lattice grid. Sample the padded transform at integer multiples of the original cell indices.
subroutine, public cell_to_k_grid_fft (values_rs, index_to_cell, xkp, nkp_grid, values_k, used_fft, deriv_direction, hmat, selected_kpoints)
 Transform a batch of real matrices from image cells to every supplied k point.
subroutine, public k_grid_to_cell_fft (values_k, xkp, nkp_grid, index_to_cell, values_rs, used_fft, weights, allow_incomplete)
 Transform reciprocal-grid data back to image-cell values.
subroutine, public k_grid_to_cell_prepare (work, xkp, nkp_grid, index_to_cell, weights, allow_incomplete)
 Prepare one inverse lattice transform for repeated matrix batches.
subroutine, public k_grid_to_cell_execute (work, values_k, values_rs, used_fft)
 Execute a matrix batch using the prepared inverse lattice transform. Call outside OpenMP worker regions: fft_tools owns its shared pool and planner.
subroutine, public k_grid_to_cell_release (work)
 Release call-scoped inverse lattice maps and FFT buffers.

Detailed Description

Batched lattice Fourier transforms on regular k-point grids.

  Image cells are folded modulo the reciprocal grid; shifted meshes use a phase twist.
  Forward transforms require a complete grid. The inverse transform can also embed
  an explicitly allowed subset with its supplied weights and zero missing points.
  Unsupported grids retain the direct phase-sum fallback.

Function/Subroutine Documentation

◆ regular_kpoint_grid()

logical function, public kpoint_lattice_fft::regular_kpoint_grid ( real(kind=dp), dimension(:, :), intent(in) xkp,
integer, dimension(3), intent(in) nkp_grid,
integer, dimension(:, :), intent(out), optional grid_index,
real(kind=dp), dimension(3), intent(out), optional k_offset,
logical, intent(in), optional allow_incomplete )

Test and map a uniformly shifted reciprocal grid or an explicitly allowed subset.

Parameters
xkpreciprocal coordinates, in units of reciprocal lattice vectors
nkp_gridregular-grid dimensions
grid_indexFFT-grid index for every k point
k_offsetcommon reciprocal-coordinate offset
allow_incompleteaccept a subset of a regular grid (missing points are zero)
Returns
true for a regular grid, complete unless allow_incomplete is set

Definition at line 66 of file kpoint_lattice_fft.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lattice_fft_shape()

logical function, public kpoint_lattice_fft::lattice_fft_shape ( integer, dimension(3), intent(in) n,
integer, dimension(3), intent(out) nfft,
logical, intent(in), optional allow_arbitrary )

Find backend-supported FFT dimensions that preserve the original lattice grid. Sample the padded transform at integer multiples of the original cell indices.

Parameters
noriginal grid dimensions
nfftsupported integer multiples, if available
allow_arbitraryuse exact dimensions when supported by the active FFT backend
Returns
whether all dimensions have a supported multiple

Definition at line 125 of file kpoint_lattice_fft.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_to_k_grid_fft()

subroutine, public kpoint_lattice_fft::cell_to_k_grid_fft ( real(kind=dp), dimension(:, :, :), intent(in) values_rs,
integer, dimension(:, :), intent(in) index_to_cell,
real(kind=dp), dimension(:, :), intent(in) xkp,
integer, dimension(3), intent(in) nkp_grid,
complex(kind=dp), dimension(:, :, :), intent(out) values_k,
logical, intent(out), optional used_fft,
integer, intent(in), optional deriv_direction,
real(kind=dp), dimension(3, 3), intent(in), optional hmat,
integer, dimension(:), intent(in), optional selected_kpoints )

Transform a batch of real matrices from image cells to every supplied k point.

Parameters
values_rsreal-space matrices; the last dimension enumerates image cells
index_to_cellinteger lattice vector for every image cell
xkpreciprocal coordinates of all requested k points
nkp_griddimensions of the candidate regular reciprocal grid
values_kcomplex matrices at every k point
used_fftreports whether the regular-grid FFT path was used
deriv_directionoptional Cartesian k derivative (1, 2, or 3)
hmatdirect-lattice cell matrix, required for a derivative
selected_kpointsoptional indices of k points to retain in values_k

Definition at line 169 of file kpoint_lattice_fft.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ k_grid_to_cell_fft()

subroutine, public kpoint_lattice_fft::k_grid_to_cell_fft ( complex(kind=dp), dimension(:, :, :), intent(in) values_k,
real(kind=dp), dimension(:, :), intent(in) xkp,
integer, dimension(3), intent(in) nkp_grid,
integer, dimension(:, :), intent(in) index_to_cell,
complex(kind=dp), dimension(:, :, :), intent(out) values_rs,
logical, intent(out), optional used_fft,
real(kind=dp), dimension(:), intent(in), optional weights,
logical, intent(in), optional allow_incomplete )

Transform reciprocal-grid data back to image-cell values.

Parameters
values_kcomplex matrices on the supplied reciprocal points
xkpreciprocal coordinates, in units of reciprocal lattice vectors
nkp_griddimensions of the reciprocal grid
index_to_cellinteger lattice vector for every requested image cell
values_rsreconstructed complex matrices in the requested image cells
used_fftreports whether the regular-grid FFT path was used
weightsoptional k weights; otherwise use the existing 1/number-of-points normalization
allow_incompleteembed a unique regular-grid subset, zero-filling missing points

Definition at line 296 of file kpoint_lattice_fft.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ k_grid_to_cell_prepare()

subroutine, public kpoint_lattice_fft::k_grid_to_cell_prepare ( type(k_grid_to_cell_work_type), intent(inout) work,
real(kind=dp), dimension(:, :), intent(in) xkp,
integer, dimension(3), intent(in) nkp_grid,
integer, dimension(:, :), intent(in) index_to_cell,
real(kind=dp), dimension(:), intent(in), optional weights,
logical, intent(in), optional allow_incomplete )

Prepare one inverse lattice transform for repeated matrix batches.

Parameters
workcall-scoped maps, weights and buffers; no backend plan ownership
xkpreciprocal coordinates
nkp_gridcandidate reciprocal-grid dimensions
index_to_cellrequested lattice translations
weightsfinal k weights, otherwise 1/number-of-points
allow_incompleteallow missing grid points, with zero values

Definition at line 325 of file kpoint_lattice_fft.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ k_grid_to_cell_execute()

subroutine, public kpoint_lattice_fft::k_grid_to_cell_execute ( type(k_grid_to_cell_work_type), intent(inout) work,
complex(kind=dp), dimension(:, :, :), intent(in) values_k,
complex(kind=dp), dimension(:, :, :), intent(out) values_rs,
logical, intent(out), optional used_fft )

Execute a matrix batch using the prepared inverse lattice transform. Call outside OpenMP worker regions: fft_tools owns its shared pool and planner.

Parameters
workprepared transform; scratch is reused, never shared between concurrent callers
values_kmatrices at the prepared reciprocal points
values_rsmatrices at the prepared lattice translations
used_fftwhether this batch used FFT, including execution failure fallback

Definition at line 376 of file kpoint_lattice_fft.F.

Here is the caller graph for this function:

◆ k_grid_to_cell_release()

subroutine, public kpoint_lattice_fft::k_grid_to_cell_release ( type(k_grid_to_cell_work_type), intent(inout) work)

Release call-scoped inverse lattice maps and FFT buffers.

Parameters
work...

Definition at line 428 of file kpoint_lattice_fft.F.

Here is the caller graph for this function: