(git:6344619)
Loading...
Searching...
No Matches
kpoint_methods Module Reference

Routines needed for kpoint calculation. More...

Data Types

type  kp_transform_plan_type
type  rskp_grid_type

Functions/Subroutines

subroutine kp_link_index_create (representative, nkp, start, order)
 Index full-grid links by irreducible k-point without rescanning the complete mesh.
subroutine, public kpoint_initialize (kpoint, particle_set, cell)
 Generate the kpoints and initialize the kpoint environment.
subroutine, public kpoint_env_initialize (kpoint, para_env, blacs_env, with_aux_fit)
 Initialize the kpoint environment.
subroutine, public kpoint_initialize_mos (kpoint, mos, added_mos, for_aux_fit)
 Initialize a set of MOs and density matrix for each kpoint (kpoint group).
subroutine, public kpoint_initialize_mo_set (kpoint)
 ...
subroutine, public kpoint_init_cell_index (kpoint, sab_nl, para_env, nimages)
 Generates the mapping of cell indices and linear RS index CELL (0,0,0) is always mapped to index 1.
subroutine, public 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 rskp_transform_grid_prepare (grid, rmatrix, rsmat, ispin, xkp, nkp_grid, cell_to_index, sab_nl, used_fft, is_complex, rs_sign, max_storage_bytes)
 Prepare a batched real-cell to complete reciprocal-grid transform for local DBCSR blocks. The stored blocks remain MPI local. Irregular or too-large grids return used_fft=.FALSE.
subroutine, public rskp_transform_grid_extract (grid, ikp, rmatrix, cmatrix)
 Extract one reciprocal-grid matrix from a prepared local DBCSR block cache.
subroutine, public rskp_transform_grid_release (grid)
 Release a reciprocal-grid transformation cache.
subroutine, public kpoint_set_mo_occupation (kpoint, smear, probe, added_mos_auto, added_mos_auto_grow, separate_spin_occupations)
 Given the eigenvalues of all kpoints, calculates the occupation numbers.
subroutine, public kpoint_smearing_edge_status (wocc, wkp, smear, nspin, has_weight, first_fractional, last_occupied, last_occupied_spin)
 summarize whether weighted k-point smearing reaches the available band edges
subroutine, public kpoint_density_matrices (kpoint, energy_weighted, for_aux_fit)
 Calculate kpoint density matrices (rho(k), owned by kpoint groups).
subroutine, public kpoint_ot_energy_weighted_density (coeff, hc, occupation, wmat)
 Build W(k) for noncanonical complex OT orbitals from H(k) C(k). The occupied-space Lagrange multiplier is Hermitian[(C^H H C) f], which reduces to the usual eigenvalue-weighted expression for canonical orbitals.
subroutine, public lowdin_kp_trans (kpoint, pmat_diag)
 Calculate Lowdin transformation of density matrix S^1/2 P S^1/2 Integrate diagonal elements over k-points to get Lowdin charges.
subroutine, public lowdin_kp_mo_coeff (kp, ispin, use_real_wfn, shalfc, cshalfc)
 Calculate S(k)^1/2 C(k) for real or complex k-point wavefunctions.
subroutine, public kpoint_density_transform (kpoint, denmat, wtype, tempmat, sab_nl, fmwork, for_aux_fit, pmat_ext, overlap_rs)
 generate real space density matrices in DBCSR format
subroutine, public 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.

Detailed Description

Routines needed for kpoint calculation.

History
2014.07 created [JGH] 2014.11 unified k-point and gamma-point code [Ole Schuett]
Author
JGH

Function/Subroutine Documentation

◆ kp_link_index_create()

subroutine kpoint_methods::kp_link_index_create ( integer, dimension(:), intent(in) representative,
integer, intent(in) nkp,
integer, dimension(:), intent(out), allocatable start,
integer, dimension(:), intent(out), allocatable order )

Index full-grid links by irreducible k-point without rescanning the complete mesh.

Parameters
representativeirreducible representative of each full-grid link
nkpnumber of irreducible k-points
startoffsets into order for each irreducible k-point
orderfull-grid link indices grouped by irreducible representative

Definition at line 184 of file kpoint_methods.F.

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

◆ kpoint_initialize()

subroutine, public kpoint_methods::kpoint_initialize ( type(kpoint_type), pointer kpoint,
type(particle_type), dimension(:), pointer particle_set,
type(cell_type), pointer cell )

Generate the kpoints and initialize the kpoint environment.

Parameters
kpointThe kpoint environment
particle_setParticle types and coordinates
cellComputational cell information

Definition at line 374 of file kpoint_methods.F.

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

◆ kpoint_env_initialize()

subroutine, public kpoint_methods::kpoint_env_initialize ( type(kpoint_type), intent(inout) kpoint,
type(mp_para_env_type), intent(in), target para_env,
type(cp_blacs_env_type), intent(in), target blacs_env,
logical, intent(in), optional with_aux_fit )

Initialize the kpoint environment.

Parameters
kpointKpoint environment
para_env...
blacs_env...
with_aux_fit...

Definition at line 653 of file kpoint_methods.F.

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

◆ kpoint_initialize_mos()

subroutine, public kpoint_methods::kpoint_initialize_mos ( type(kpoint_type), pointer kpoint,
type(mo_set_type), dimension(:), intent(inout) mos,
integer, intent(in), optional added_mos,
logical, optional for_aux_fit )

Initialize a set of MOs and density matrix for each kpoint (kpoint group).

Parameters
kpointKpoint environment
mosReference MOs (global)
added_mos...
for_aux_fit...

Definition at line 817 of file kpoint_methods.F.

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

◆ kpoint_initialize_mo_set()

subroutine, public kpoint_methods::kpoint_initialize_mo_set ( type(kpoint_type), pointer kpoint)

...

Parameters
kpoint...

Definition at line 968 of file kpoint_methods.F.

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

◆ kpoint_init_cell_index()

subroutine, public kpoint_methods::kpoint_init_cell_index ( type(kpoint_type), pointer kpoint,
type(neighbor_list_set_p_type), dimension(:), pointer sab_nl,
type(mp_para_env_type), pointer para_env,
integer, intent(out) nimages )

Generates the mapping of cell indices and linear RS index CELL (0,0,0) is always mapped to index 1.

Parameters
kpointKpoint environment
sab_nlDefining neighbour list
para_envParallel environment
nimages[output]

Definition at line 1003 of file kpoint_methods.F.

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

◆ rskp_transform()

subroutine, public kpoint_methods::rskp_transform ( type(dbcsr_type) rmatrix,
type(dbcsr_type), optional cmatrix,
type(dbcsr_p_type), dimension(:, :), pointer rsmat,
integer, intent(in) ispin,
real(kind=dp), dimension(3), intent(in) xkp,
integer, dimension(:, :, :), pointer cell_to_index,
type(neighbor_list_set_p_type), dimension(:), pointer sab_nl,
logical, intent(in), optional is_complex,
real(kind=dp), intent(in), optional rs_sign )

Transformation of real space matrices to a kpoint.

Parameters
rmatrixReal part of kpoint matrix
cmatrixComplex part of kpoint matrix (optional)
rsmatReal space matrices
ispinSpin index
xkpKpoint coordinates
cell_to_indexmapping of cell indices to RS index
sab_nlDefining neighbor list
is_complexMatrix to be transformed is imaginary
rs_signMatrix to be transformed is csaled by rs_sign

Definition at line 1136 of file kpoint_methods.F.

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

◆ rskp_transform_grid_prepare()

subroutine, public kpoint_methods::rskp_transform_grid_prepare ( type(rskp_grid_type), intent(inout) grid,
type(dbcsr_type), intent(inout) rmatrix,
type(dbcsr_p_type), dimension(:, :), pointer rsmat,
integer, intent(in) ispin,
real(kind=dp), dimension(:, :), intent(in) xkp,
integer, dimension(3), intent(in) nkp_grid,
integer, dimension(:, :, :), pointer cell_to_index,
type(neighbor_list_set_p_type), dimension(:), pointer sab_nl,
logical, intent(out) used_fft,
logical, intent(in), optional is_complex,
real(kind=dp), intent(in), optional rs_sign,
integer(kind=int_8), intent(in), optional max_storage_bytes )

Prepare a batched real-cell to complete reciprocal-grid transform for local DBCSR blocks. The stored blocks remain MPI local. Irregular or too-large grids return used_fft=.FALSE.

Parameters
gridcached transformed local blocks and their DBCSR coordinates
rmatrixallocated output template defining the local block layout
rsmatreal-space matrix set
ispinspin component of rsmat
xkpcomplete reciprocal grid in arbitrary order
nkp_gridreciprocal grid dimensions
cell_to_indexreal-cell coordinate mapping
sab_nlneighbor list defining the stored block orientation
used_fftwhether the cache was prepared
is_complexwhether the real-space operator is imaginary
rs_signoptional overall sign
max_storage_bytesoptional conservative per-rank memory limit

Definition at line 1247 of file kpoint_methods.F.

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

◆ rskp_transform_grid_extract()

subroutine, public kpoint_methods::rskp_transform_grid_extract ( type(rskp_grid_type), intent(in) grid,
integer, intent(in) ikp,
type(dbcsr_type), intent(inout) rmatrix,
type(dbcsr_type), intent(inout), optional cmatrix )

Extract one reciprocal-grid matrix from a prepared local DBCSR block cache.

Parameters
grid...
ikp...
rmatrix...
cmatrix...

Definition at line 1437 of file kpoint_methods.F.

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

◆ rskp_transform_grid_release()

subroutine, public kpoint_methods::rskp_transform_grid_release ( type(rskp_grid_type), intent(inout) grid)

Release a reciprocal-grid transformation cache.

Parameters
grid...

Definition at line 1475 of file kpoint_methods.F.

Here is the caller graph for this function:

◆ kpoint_set_mo_occupation()

subroutine, public kpoint_methods::kpoint_set_mo_occupation ( type(kpoint_type), pointer kpoint,
type(smear_type) smear,
type(hairy_probes_type), dimension(:), optional, pointer probe,
logical, dimension(:), intent(in), optional added_mos_auto,
logical, intent(out), optional added_mos_auto_grow,
logical, intent(in), optional separate_spin_occupations )

Given the eigenvalues of all kpoints, calculates the occupation numbers.

Parameters
kpointKpoint environment
smearSmearing information
probe...
added_mos_auto...
added_mos_auto_grow...
separate_spin_occupationsenforce the electron count of each spin channel

Definition at line 1497 of file kpoint_methods.F.

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

◆ kpoint_smearing_edge_status()

subroutine, public kpoint_methods::kpoint_smearing_edge_status ( real(kind=dp), dimension(:, :, :), intent(in) wocc,
real(kind=dp), dimension(:), intent(in) wkp,
type(smear_type), intent(in) smear,
integer, intent(in) nspin,
logical, intent(out) has_weight,
logical, intent(out) first_fractional,
logical, intent(out) last_occupied,
logical, dimension(:), intent(out), optional last_occupied_spin )

summarize whether weighted k-point smearing reaches the available band edges

Parameters
wocc...
wkp...
smear...
nspin...
has_weight...
first_fractional...
last_occupied...
last_occupied_spin...

Definition at line 1756 of file kpoint_methods.F.

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

◆ kpoint_density_matrices()

subroutine, public kpoint_methods::kpoint_density_matrices ( type(kpoint_type), pointer kpoint,
logical, optional energy_weighted,
logical, optional for_aux_fit )

Calculate kpoint density matrices (rho(k), owned by kpoint groups).

Parameters
kpointkpoint environment
energy_weightedcalculate energy weighted density matrix
for_aux_fit...

Definition at line 1854 of file kpoint_methods.F.

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

◆ kpoint_ot_energy_weighted_density()

subroutine, public kpoint_methods::kpoint_ot_energy_weighted_density ( type(cp_cfm_type), intent(in) coeff,
type(cp_cfm_type), intent(in) hc,
real(kind=dp), dimension(:), intent(in) occupation,
type(cp_cfm_type), intent(inout) wmat )

Build W(k) for noncanonical complex OT orbitals from H(k) C(k). The occupied-space Lagrange multiplier is Hermitian[(C^H H C) f], which reduces to the usual eigenvalue-weighted expression for canonical orbitals.

Parameters
coeffC(k)
hcH(k) C(k)
occupationorbital occupations
wmatW(k)

Definition at line 1952 of file kpoint_methods.F.

Here is the call graph for this function:

◆ lowdin_kp_trans()

subroutine, public kpoint_methods::lowdin_kp_trans ( type(kpoint_type), pointer kpoint,
real(kind=dp), dimension(:, :), intent(inout) pmat_diag )

Calculate Lowdin transformation of density matrix S^1/2 P S^1/2 Integrate diagonal elements over k-points to get Lowdin charges.

Parameters
kpointkpoint environment
pmat_diagSum over kpoints of diagonal elements
History
04.2026 created [JGH]

Definition at line 2086 of file kpoint_methods.F.

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

◆ lowdin_kp_mo_coeff()

subroutine, public kpoint_methods::lowdin_kp_mo_coeff ( type(kpoint_env_type), pointer kp,
integer, intent(in) ispin,
logical, intent(in) use_real_wfn,
type(cp_fm_type), intent(inout), optional shalfc,
type(cp_cfm_type), intent(inout), optional cshalfc )

Calculate S(k)^1/2 C(k) for real or complex k-point wavefunctions.

Parameters
kpK-point environment for one local k point
ispinSpin index
use_real_wfnUse real k-point wavefunctions
shalfcOutput matrix containing S(k)^1/2 C(k) for real wavefunctions
cshalfcOutput matrix containing S(k)^1/2 C(k) for complex wavefunctions

Definition at line 2173 of file kpoint_methods.F.

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

◆ kpoint_density_transform()

subroutine, public kpoint_methods::kpoint_density_transform ( type(kpoint_type), pointer kpoint,
type(dbcsr_p_type), dimension(:, :) denmat,
logical, intent(in) wtype,
type(dbcsr_type), pointer tempmat,
type(neighbor_list_set_p_type), dimension(:), pointer sab_nl,
type(cp_fm_type), dimension(:), intent(in), target fmwork,
logical, optional for_aux_fit,
type(cp_fm_type), dimension(:, :, :), intent(in), optional, target pmat_ext,
type(dbcsr_p_type), dimension(:, :), optional, pointer overlap_rs )

generate real space density matrices in DBCSR format

Parameters
kpointKpoint environment
denmatReal space (DBCSR) density matrices
wtypeTrue = energy weighted density matrix False = normal density matrix
tempmatDBCSR matrix to be used as template
sab_nl...
fmworkFM work matrices (kpoint group)
for_aux_fit...
pmat_ext...
overlap_rs...

Definition at line 2214 of file kpoint_methods.F.

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

◆ kp_transform_plan_create()

subroutine, public kpoint_methods::kp_transform_plan_create ( type(kp_transform_plan_type), intent(out) plan,
type(neighbor_list_set_p_type), dimension(:), pointer sab_nl,
integer, dimension(:, :, :), pointer cell_to_index,
integer, intent(in) nimg,
type(dbcsr_type), intent(in), optional block_template,
logical, intent(in), optional group_entries )

Build the immutable neighbor-list traversal shared by R-to-K and K-to-R transforms.

Parameters
plan...
sab_nl...
cell_to_index...
nimg...
block_template...
group_entries...

Definition at line 3256 of file kpoint_methods.F.

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