![]() |
(git:ba1d7ca)
|
Routines needed for kpoint calculation. More...
Data Types | |
| type | kp_transform_plan_type |
| type | rskp_grid_type |
Functions/Subroutines | |
| 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_re, coeff_im, hc_re, hc_im, occupation, wmat_re, wmat_im) |
| 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 | kpoint_ot_energy_weighted_matrices (kpoint, matrix_ks) |
| Build energy-weighted density matrices for complex K-point OT. H(k) is transformed only while W(k) is needed, avoiding a persistent dense AO-by-AO Hamiltonian for every spin and K point. | |
| 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. | |
| subroutine, public | kp_transform_plan_release (plan) |
| Release a K-to-R traversal plan. | |
Routines needed for kpoint calculation.
| 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.
| kpoint | The kpoint environment |
| particle_set | Particle types and coordinates |
| cell | Computational cell information |
Definition at line 155 of file kpoint_methods.F.
| 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.
| kpoint | Kpoint environment |
| para_env | ... |
| blacs_env | ... |
| with_aux_fit | ... |
Definition at line 656 of file kpoint_methods.F.
| 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)
| kpoint | Kpoint environment |
| mos | Reference MOs (global) |
| added_mos | ... |
| for_aux_fit | ... |
Definition at line 844 of file kpoint_methods.F.
| subroutine, public kpoint_methods::kpoint_initialize_mo_set | ( | type(kpoint_type), pointer | kpoint | ) |
...
| kpoint | ... |
Definition at line 1000 of file kpoint_methods.F.
| 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.
| kpoint | Kpoint environment |
| sab_nl | Defining neighbour list |
| para_env | Parallel environment |
| nimages | [output] |
Definition at line 1040 of file kpoint_methods.F.
| 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.
| rmatrix | Real part of kpoint matrix |
| cmatrix | Complex part of kpoint matrix (optional) |
| rsmat | Real space matrices |
| ispin | Spin index |
| xkp | Kpoint coordinates |
| cell_to_index | mapping of cell indices to RS index |
| sab_nl | Defining neighbor list |
| is_complex | Matrix to be transformed is imaginary |
| rs_sign | Matrix to be transformed is csaled by rs_sign |
Definition at line 1173 of file kpoint_methods.F.
| 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.
| grid | cached transformed local blocks and their DBCSR coordinates |
| rmatrix | allocated output template defining the local block layout |
| rsmat | real-space matrix set |
| ispin | spin component of rsmat |
| xkp | complete reciprocal grid in arbitrary order |
| nkp_grid | reciprocal grid dimensions |
| cell_to_index | real-cell coordinate mapping |
| sab_nl | neighbor list defining the stored block orientation |
| used_fft | whether the cache was prepared |
| is_complex | whether the real-space operator is imaginary |
| rs_sign | optional overall sign |
| max_storage_bytes | optional conservative per-rank memory limit |
Definition at line 1284 of file kpoint_methods.F.
| 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.
| grid | ... |
| ikp | ... |
| rmatrix | ... |
| cmatrix | ... |
Definition at line 1474 of file kpoint_methods.F.
| subroutine, public kpoint_methods::rskp_transform_grid_release | ( | type(rskp_grid_type), intent(inout) | grid | ) |
Release a reciprocal-grid transformation cache.
| grid | ... |
Definition at line 1512 of file kpoint_methods.F.
| 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.
| kpoint | Kpoint environment |
| smear | Smearing information |
| probe | ... |
| added_mos_auto | ... |
| added_mos_auto_grow | ... |
| separate_spin_occupations | enforce the electron count of each spin channel |
Definition at line 1534 of file kpoint_methods.F.
| 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
| wocc | ... |
| wkp | ... |
| smear | ... |
| nspin | ... |
| has_weight | ... |
| first_fractional | ... |
| last_occupied | ... |
| last_occupied_spin | ... |
Definition at line 1819 of file kpoint_methods.F.
| 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)
| kpoint | kpoint environment |
| energy_weighted | calculate energy weighted density matrix |
| for_aux_fit | ... |
Definition at line 1917 of file kpoint_methods.F.
| subroutine, public kpoint_methods::kpoint_ot_energy_weighted_density | ( | type(cp_fm_type), intent(in) | coeff_re, |
| type(cp_fm_type), intent(in) | coeff_im, | ||
| type(cp_fm_type), intent(in) | hc_re, | ||
| type(cp_fm_type), intent(in) | hc_im, | ||
| real(kind=dp), dimension(:), intent(in) | occupation, | ||
| type(cp_fm_type), intent(in) | wmat_re, | ||
| type(cp_fm_type), intent(in) | wmat_im | ||
| ) |
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.
| coeff_re | real part of C(k) |
| coeff_im | imaginary part of C(k) |
| hc_re | real part of H(k) C(k) |
| hc_im | imaginary part of H(k) C(k) |
| occupation | orbital occupations |
| wmat_re | real part of W(k) |
| wmat_im | imaginary part of W(k) |
Definition at line 2057 of file kpoint_methods.F.
| subroutine, public kpoint_methods::kpoint_ot_energy_weighted_matrices | ( | type(kpoint_type), pointer | kpoint, |
| type(dbcsr_p_type), dimension(:, :), pointer | matrix_ks | ||
| ) |
Build energy-weighted density matrices for complex K-point OT. H(k) is transformed only while W(k) is needed, avoiding a persistent dense AO-by-AO Hamiltonian for every spin and K point.
| kpoint | K-point environment |
| matrix_ks | real-space Kohn-Sham matrices |
Definition at line 2115 of file kpoint_methods.F.
| 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.
| kpoint | kpoint environment |
| pmat_diag | Sum over kpoints of diagonal elements |
Definition at line 2325 of file kpoint_methods.F.
| 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.
| kp | K-point environment for one local k point |
| ispin | Spin index |
| use_real_wfn | Use real k-point wavefunctions |
| shalfc | Output matrix containing S(k)^1/2 C(k) for real wavefunctions |
| cshalfc | Output matrix containing S(k)^1/2 C(k) for complex wavefunctions |
Definition at line 2412 of file kpoint_methods.F.
| 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) | fmwork, | ||
| logical, optional | for_aux_fit, | ||
| type(cp_fm_type), dimension(:, :, :), intent(in), optional | pmat_ext, | ||
| type(dbcsr_p_type), dimension(:, :), optional, pointer | overlap_rs | ||
| ) |
generate real space density matrices in DBCSR format
| kpoint | Kpoint environment |
| denmat | Real space (DBCSR) density matrices |
| wtype | True = energy weighted density matrix False = normal density matrix |
| tempmat | DBCSR matrix to be used as template |
| sab_nl | ... |
| fmwork | FM work matrices (kpoint group) |
| for_aux_fit | ... |
| pmat_ext | ... |
| overlap_rs | ... |
Definition at line 2482 of file kpoint_methods.F.
| 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.
| plan | ... |
| sab_nl | ... |
| cell_to_index | ... |
| nimg | ... |
| block_template | ... |
| group_entries | ... |
Definition at line 2875 of file kpoint_methods.F.
| subroutine, public kpoint_methods::kp_transform_plan_release | ( | type(kp_transform_plan_type), intent(inout) | plan | ) |
Release a K-to-R traversal plan.
| plan | ... |
Definition at line 2988 of file kpoint_methods.F.