(git:ec04593)
Loading...
Searching...
No Matches
kpoint_transform.F File Reference

Go to the source code of this file.

Data Types

type  kpoint_transform::k_grid_to_cell_phase_type
type  kpoint_transform::kp_transform_plan_type
type  kpoint_transform::rskp_route_type
type  kpoint_transform::rskp_values_type
type  kpoint_transform::rskp_prepared_transform_type

Modules

module  kpoint_transform
 Prepared real-space/reciprocal-space transforms and distributed AO adapters. Routes fix geometry and ownership. Captured source rows own numerical values; cached evaluation reads them without communication or SCF state.

Functions/Subroutines

subroutine, public kpoint_transform::cell_to_k_transform (values_rs, cells, xkp, nkp_grid, values_k, backend, accumulate, profile_fft, profile_label)
 Transform local real matrix panels with the selected RSKP backend. GEMM reuses the prepared parity folding and block contraction. FFT reuses one geometry across bounded matrix tiles. Both accept rectangular panels and regular-grid subsets. Input and output may be strided; only the internal GEMM panels are contiguous. Call outside OpenMP worker regions; this service owns its numerical workspace.
subroutine, public kpoint_transform::k_to_real_cell_transform (values_k, xkp, nkp_grid, cells, values_rs, backend, profile_fft)
 Real part of the inverse lattice transform, normalized by the number of k points. Local rectangular panels use shared FFT execution or real GEMM contractions with cosine and sine weights. Matrix and cell tiles bound temporary storage. Call outside OpenMP worker regions; this service owns its numerical workspace.
subroutine, public kpoint_transform::rskp_transform (rmatrix, cmatrix, rsmat, ispin, xkp, cell_to_index, sab_nl, is_complex, rs_sign)
 Transformation of real space matrices to a kpoint.
subroutine, public kpoint_transform::rskp_transform_prepare (prepared, source, source_rows, source_sab, cell_to_index, target_struct, world, group, inter, backend, xkp, nkp_grid, kp_dist, mirror_sign, scale)
 Prepare source rows for a generic group- or world-distributed target. GEMM retains sparse snapshots and sizes k tiles against a workspace target. Own route, snapshots, singleton scratch and any FFT cache without SCF slots.
subroutine, public kpoint_transform::rskp_transform_evaluate (prepared, source_index, k, xkp, fm_re, fm_im, cfm)
 Evaluate one k point directly into an FM, split-FM or CFM target. The handle owns mutable scratch; concurrent evaluations need separate handles. Evaluation uses the batch backend with width one and no communication. Groups that do not own the requested global k point leave outputs unchanged.
subroutine, public kpoint_transform::rskp_transform_release (prepared)
 Release the route, snapshot and cached backend state of a prepared transform.
subroutine, public kpoint_transform::rskp_dbcsr_transform_batch (source, real_k, imag_k, xkp, cell_to_index, sab_nl, nkp_grid, backend)
 Transform all real-space spin rows to a full k-grid in distributed DBCSR matrices. The real and imaginary output blocks retain their caller-provided sparsity and distribution. GEMM contracts all images of an AO block together; FFT transforms element tiles while reusing one prepared lattice geometry.
subroutine, public kpoint_transform::kp_transform_plan_create (plan, sab_nl, cell_to_index, nimg, block_template, group_entries)
 Build the immutable neighbor-list traversal shared by R-to-K and K-to-R transforms.
subroutine, public kpoint_transform::rskp_route_create (source, source_sab, cell_to_index, matrix_struct, world, group, inter, backend, route, ready)
 Cache routing to the FM tiles of one representative group. Equivalent ranks in the other groups receive only their tile's blocks. Both backends receive the union of locally owned direct/mirrored AO elements. Missing source blocks are packed as zero on a fixed geometry.
logical function, public kpoint_transform::rskp_compatible (route, source, matrix_row, source_sab)
 Check the source AO layout, not its values or sparse block presence.
subroutine, public kpoint_transform::rskp_capture (source, matrix_row, route, snapshot, mirror_sign, scale)
 Capture current values using cached routing, with no per-k communication. GEMM/FFT snapshots own packed local AO-element/image matrices. A shared cropped receive buffer is reused across slots and operator refreshes.
subroutine, public kpoint_transform::rskp_values_release (snapshot)
 Release one captured row without invalidating other slots or routing.
subroutine, public kpoint_transform::rskp_route_release (route)
 Release backend-owned geometry and FFT work buffers from a route.
subroutine, public kpoint_transform::cell_to_k_sparse_fft (snapshot, route, xkp, nkp_grid, kp_dist, inter, max_bytes, cache, output)
 FFT captured raw-element panels and retain the destination group's k points. Reuse the sparse route and the dense layout consumed by the batched solvers.
subroutine, public kpoint_transform::cell_to_k_backend_prepare (route, xkp, nkp_grid, max_bytes)
 Prepare the selected R-to-K backend plan once for a fixed route. Both backends retain their geometry with the route; the snapshots then provide only values and use the common evaluate interface.
subroutine, public kpoint_transform::rskp_batch_size (route, nk, ncomp, nworkers, nmatrices, max_bytes, width, work_size)
 Bound worker scratch and output tiles for either prepared backend. Packed input belongs to the snapshot and is shared by every k tile.
subroutine, public kpoint_transform::cell_to_k_backend_evaluate_batch (snapshot, route, xkp, first_local, work, batch, output)
 Evaluate a k-point tile through the selected prepared R-to-K backend. GEMM contracts the retained real-space panel; FFT returns a slice of the canonical reciprocal-space snapshot materialized during capture.
subroutine, public kpoint_transform::k_grid_to_cell_phase_prepare (table, cells, xkp, nworkers)
 Tabulate distinct absolute translation coordinates for a group's local k points. All AO pairs share these unweighted phases. Zero coordinates are exact; negative coordinates use the same cosine and the opposite sine.
subroutine, public kpoint_transform::k_grid_to_cell_contract (source, tiles, ikp_index, xkp, weight, images, source_pair, block_shape, block_offset, shift, time_reversal, trans, phase_table, sums, gemm_ctx)
 Weighted K-to-R contraction of one AO block, before spatial rotations and MPI. The caller supplies the atom mapping and image multiplicities. Phases include the gauge shift, time reversal and conjugation of a transposed source block.
subroutine, public kpoint_transform::rskp_phase_factors (shift, xkp, time_reversal, real_only, phase)
 Real two-component representation of the Bloch phase and time reversal.
subroutine, public kpoint_transform::rskp_work_matrix (work, nrow, ncol)
 Allocate a dense work matrix with the requested shape.