(git:1e0ab71)
Loading...
Searching...
No Matches
qs_band_structure.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Calculation of band structures
10!> \par History
11!> 2015.06 created [JGH]
12!> \author JGH
13! **************************************************************************************************
15 USE cell_types, ONLY: cell_type
18 USE cp_dbcsr_api, ONLY: dbcsr_p_type
19 USE cp_files, ONLY: close_file,&
27 USE kinds, ONLY: default_string_length,&
28 dp,&
34 USE kpoint_types, ONLY: get_kpoint_info,&
40 USE machine, ONLY: m_walltime
41 USE mathconstants, ONLY: twopi
43 USE physcon, ONLY: angstrom,&
44 evolt
49 USE qs_mo_types, ONLY: get_mo_set
55#include "./base/base_uses.f90"
56
57 IMPLICIT NONE
58
59 PRIVATE
60
61 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_band_structure'
62
64
65! **************************************************************************************************
66
67CONTAINS
68
69! **************************************************************************************************
70!> \brief Main routine for band structure calculation
71!> \param qs_env ...
72!> \author JGH
73! **************************************************************************************************
74 SUBROUTINE calculate_band_structure(qs_env)
75 TYPE(qs_environment_type), POINTER :: qs_env
76
77 LOGICAL :: do_kpoints, explicit
78 TYPE(section_vals_type), POINTER :: bs_input
79
80 bs_input => section_vals_get_subs_vals(qs_env%input, "DFT%PRINT%BAND_STRUCTURE")
81 CALL section_vals_get(bs_input, explicit=explicit)
82 IF (explicit) THEN
83 CALL get_qs_env(qs_env, do_kpoints=do_kpoints)
84 IF (do_kpoints) THEN
85 CALL do_calculate_band_structure(qs_env)
86 ELSE
87 block
88 TYPE(qs_environment_type), POINTER :: qs_env_kp
89 CALL create_kp_from_gamma(qs_env, qs_env_kp)
90 CALL do_calculate_band_structure(qs_env_kp)
91 CALL qs_env_release(qs_env_kp)
92 DEALLOCATE (qs_env_kp)
93 END block
94 END IF
95 END IF
96
97 END SUBROUTINE calculate_band_structure
98
99! **************************************************************************************************
100!> \brief band structure calculation
101!> \param qs_env ...
102!> \author JGH
103! **************************************************************************************************
104 SUBROUTINE do_calculate_band_structure(qs_env)
105 TYPE(qs_environment_type), POINTER :: qs_env
106
107 CHARACTER(LEN=default_string_length) :: filename, ustr
108 CHARACTER(LEN=default_string_length), &
109 DIMENSION(:), POINTER :: spname, strptr
110 CHARACTER(LEN=max_line_length) :: error_message
111 INTEGER :: bs_data_unit, i, i_rep, ik, ikk, ikpgr, &
112 imo, ip, ispin, n_ptr, n_rep, nadd, &
113 nkp, nmo, npline, npoints, nspins, &
114 unit_nr
115 INTEGER, DIMENSION(2) :: kp_range
116 LOGICAL :: explicit, io_default, my_kpgrp
117 REAL(kind=dp) :: t1, t2
118 REAL(kind=dp), DIMENSION(3) :: kpptr
119 REAL(kind=dp), DIMENSION(3, 3) :: cart_hmat
120 REAL(kind=dp), DIMENSION(:), POINTER :: eigenvalues, eigval, occnum, &
121 occupation_numbers, wkp
122 REAL(kind=dp), DIMENSION(:, :), POINTER :: kpgeneral, kspecial, xkp
123 TYPE(cell_type), POINTER :: cell
124 TYPE(dft_control_type), POINTER :: dft_control
125 TYPE(kpoint_env_type), POINTER :: kp
126 TYPE(kpoint_type), POINTER :: kpoint
127 TYPE(mp_para_env_type), POINTER :: para_env
128 TYPE(section_vals_type), POINTER :: bs_input, kpset
129
130 bs_input => section_vals_get_subs_vals(qs_env%input, "DFT%PRINT%BAND_STRUCTURE")
131 CALL section_vals_get(bs_input, explicit=explicit)
132 IF (explicit) THEN
133 CALL section_vals_val_get(bs_input, "FILE_NAME", c_val=filename)
134 CALL section_vals_val_get(bs_input, "ADDED_MOS", i_val=nadd)
135 unit_nr = cp_logger_get_default_io_unit()
136 CALL get_qs_env(qs_env=qs_env, para_env=para_env)
137 CALL get_qs_env(qs_env, cell=cell)
138 cart_hmat(:, :) = cell%hmat(:, :)
139 IF (cell%input_cell_canonicalized) cart_hmat(:, :) = cell%input_hmat(:, :)
140 kpset => section_vals_get_subs_vals(bs_input, "KPOINT_SET")
141 CALL section_vals_get(kpset, n_repetition=n_rep)
142 IF (unit_nr > 0) THEN
143 WRITE (unit_nr, fmt="(/,T2,A)") "KPOINTS| Band Structure Calculation"
144 WRITE (unit_nr, fmt="(T2,A,T71,I10)") "KPOINTS| Number of k-point sets", n_rep
145 IF (nadd /= 0) THEN
146 WRITE (unit_nr, fmt="(T2,A,T71,I10)") "KPOINTS| Number of added MOs/bands", nadd
147 END IF
148 END IF
149 IF (filename == "") THEN
150 ! use standard output file
151 bs_data_unit = unit_nr
152 io_default = .true.
153 ELSE
154 io_default = .false.
155 IF (para_env%is_source()) THEN
156 CALL open_file(filename, unit_number=bs_data_unit, file_status="UNKNOWN", file_action="WRITE", &
157 file_position="APPEND")
158 ELSE
159 bs_data_unit = -1
160 END IF
161 END IF
162 DO i_rep = 1, n_rep
163 t1 = m_walltime()
164 CALL section_vals_val_get(kpset, "NPOINTS", i_rep_section=i_rep, i_val=npline)
165 CALL section_vals_val_get(kpset, "UNITS", i_rep_section=i_rep, c_val=ustr)
166 CALL uppercase(ustr)
167 CALL section_vals_val_get(kpset, "SPECIAL_POINT", i_rep_section=i_rep, n_rep_val=n_ptr)
168 ALLOCATE (kspecial(3, n_ptr))
169 ALLOCATE (spname(n_ptr))
170 DO ip = 1, n_ptr
171 CALL section_vals_val_get(kpset, "SPECIAL_POINT", i_rep_section=i_rep, i_rep_val=ip, c_vals=strptr)
172 IF (SIZE(strptr(:), 1) == 4) THEN
173 spname(ip) = strptr(1)
174 DO i = 1, 3
175 CALL read_float_object(strptr(i + 1), kpptr(i), error_message)
176 IF (len_trim(error_message) > 0) cpabort(trim(error_message))
177 END DO
178 ELSE IF (SIZE(strptr(:), 1) == 3) THEN
179 spname(ip) = "not specified"
180 DO i = 1, 3
181 CALL read_float_object(strptr(i), kpptr(i), error_message)
182 IF (len_trim(error_message) > 0) cpabort(trim(error_message))
183 END DO
184 ELSE
185 cpabort("Input SPECIAL_POINT invalid")
186 END IF
187 SELECT CASE (ustr)
188 CASE ("B_VECTOR")
189 kspecial(1:3, ip) = kpptr(1:3)
190 CASE ("CART_ANGSTROM")
191 kspecial(1:3, ip) = (kpptr(1)*cart_hmat(1, 1:3) + &
192 kpptr(2)*cart_hmat(2, 1:3) + &
193 kpptr(3)*cart_hmat(3, 1:3))/twopi*angstrom
194 CASE ("CART_BOHR")
195 kspecial(1:3, ip) = (kpptr(1)*cart_hmat(1, 1:3) + &
196 kpptr(2)*cart_hmat(2, 1:3) + &
197 kpptr(3)*cart_hmat(3, 1:3))/twopi
198 CASE DEFAULT
199 cpabort("Unknown unit <"//trim(ustr)//"> specified for k-point definition")
200 END SELECT
201 END DO
202 npoints = (n_ptr - 1)*npline + 1
203 cpassert(npoints >= 1)
204
205 ! Initialize environment and calculate MOs
206 ALLOCATE (kpgeneral(3, npoints))
207 kpgeneral(1:3, 1) = kspecial(1:3, 1)
208 ikk = 1
209 DO ik = 2, n_ptr
210 DO ip = 1, npline
211 ikk = ikk + 1
212 kpgeneral(1:3, ikk) = kspecial(1:3, ik - 1) + &
213 REAL(ip, kind=dp)/real(npline, kind=dp)* &
214 (kspecial(1:3, ik) - kspecial(1:3, ik - 1))
215 END DO
216 END DO
217 NULLIFY (kpoint)
218 CALL calculate_kp_orbitals(qs_env, kpoint, "GENERAL", nadd, kpgeneral=kpgeneral)
219 DEALLOCATE (kpgeneral)
220
221 CALL get_qs_env(qs_env, dft_control=dft_control)
222 nspins = dft_control%nspins
223 kp => kpoint%kp_env(1)%kpoint_env
224 CALL get_mo_set(kp%mos(1, 1), nmo=nmo)
225 ALLOCATE (eigval(nmo), occnum(nmo))
226 CALL get_kpoint_info(kpoint, nkp=nkp, kp_range=kp_range, xkp=xkp, wkp=wkp)
227
228 IF (unit_nr > 0) THEN
229 WRITE (unit=unit_nr, fmt="(T2,A,I4,T71,I10)") &
230 "KPOINTS| Number of k-points in set ", i_rep, npoints
231 WRITE (unit=unit_nr, fmt="(T2,A)") &
232 "KPOINTS| In units of b-vector [2pi/Bohr]"
233 DO ip = 1, n_ptr
234 WRITE (unit=unit_nr, fmt="(T2,A,I5,1X,A11,3(1X,F12.6))") &
235 "KPOINTS| Special point ", ip, adjustl(trim(spname(ip))), kspecial(1:3, ip)
236 END DO
237 END IF
238 IF (bs_data_unit > 0 .AND. (bs_data_unit /= unit_nr)) THEN
239 WRITE (unit=bs_data_unit, fmt="(4(A,I0),A)") &
240 "# Set ", i_rep, ": ", n_ptr, " special points, ", npoints, " k-points, ", nmo, " bands"
241 DO ip = 1, n_ptr
242 WRITE (unit=bs_data_unit, fmt="(A,I0,T20,T24,3(1X,F14.8),2X,A)") &
243 "# Special point ", ip, kspecial(1:3, ip), adjustl(trim(spname(ip)))
244 END DO
245 END IF
246
247 DO ik = 1, nkp
248 my_kpgrp = (ik >= kp_range(1) .AND. ik <= kp_range(2))
249 DO ispin = 1, nspins
250 IF (my_kpgrp) THEN
251 ikpgr = ik - kp_range(1) + 1
252 kp => kpoint%kp_env(ikpgr)%kpoint_env
253 CALL get_mo_set(kp%mos(1, ispin), eigenvalues=eigenvalues, occupation_numbers=occupation_numbers)
254 eigval(1:nmo) = eigenvalues(1:nmo)
255 occnum(1:nmo) = occupation_numbers(1:nmo)
256 ELSE
257 eigval(1:nmo) = 0.0_dp
258 occnum(1:nmo) = 0.0_dp
259 END IF
260 CALL kpoint%para_env_inter_kp%sum(eigval)
261 CALL kpoint%para_env_inter_kp%sum(occnum)
262 IF (bs_data_unit > 0) THEN
263 WRITE (unit=bs_data_unit, fmt="(A,I0,T15,A,I0,A,T24,3(1X,F14.8),3X,F14.8)") &
264 "# Point ", ik, " Spin ", ispin, ":", xkp(1:3, ik), wkp(ik)
265 WRITE (unit=bs_data_unit, fmt="(A)") &
266 "# Band Energy [eV] Occupation"
267 DO imo = 1, nmo
268 WRITE (unit=bs_data_unit, fmt="(T2,I7,2(1X,F14.8))") &
269 imo, eigval(imo)*evolt, occnum(imo)
270 END DO
271 END IF
272 END DO
273 END DO
274
275 DEALLOCATE (kspecial, spname)
276 DEALLOCATE (eigval, occnum)
277 CALL kpoint_release(kpoint)
278 t2 = m_walltime()
279 IF (unit_nr > 0) THEN
280 WRITE (unit=unit_nr, fmt="(T2,A,T67,F14.3)") "KPOINTS| Time for k-point line ", t2 - t1
281 END IF
282
283 END DO
284
285 ! Close output files
286 IF (.NOT. io_default) THEN
287 IF (para_env%is_source()) CALL close_file(bs_data_unit)
288 END IF
289
290 END IF
291
292 END SUBROUTINE do_calculate_band_structure
293
294! **************************************************************************************************
295!> \brief diagonalize KS matrices at a set of kpoints
296!> \param qs_env ...
297!> \param kpoint ...
298!> \param scheme ...
299!> \param nadd ...
300!> \param mp_grid ...
301!> \param kpgeneral ...
302!> \param group_size_ext ...
303!> \param kp_shift ...
304!> \param gamma_centered ...
305!> \author JGH
306! **************************************************************************************************
307 SUBROUTINE calculate_kp_orbitals(qs_env, kpoint, scheme, nadd, mp_grid, kpgeneral, group_size_ext, &
308 kp_shift, gamma_centered)
309 TYPE(qs_environment_type), POINTER :: qs_env
310 TYPE(kpoint_type), POINTER :: kpoint
311 CHARACTER(LEN=*), INTENT(IN) :: scheme
312 INTEGER, INTENT(IN) :: nadd
313 INTEGER, DIMENSION(3), INTENT(IN), OPTIONAL :: mp_grid
314 REAL(kind=dp), DIMENSION(:, :), INTENT(IN), &
315 OPTIONAL :: kpgeneral
316 INTEGER, INTENT(IN), OPTIONAL :: group_size_ext
317 REAL(kind=dp), DIMENSION(3), INTENT(IN), OPTIONAL :: kp_shift
318 LOGICAL, INTENT(IN), OPTIONAL :: gamma_centered
319
320 LOGICAL :: diis_step
321 TYPE(cp_blacs_env_type), POINTER :: blacs_env
322 TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_ks, matrix_s
323 TYPE(dft_control_type), POINTER :: dft_control
324 TYPE(mp_para_env_type), POINTER :: para_env
325 TYPE(neighbor_list_set_p_type), DIMENSION(:), &
326 POINTER :: sab_nl
327 TYPE(qs_scf_env_type), POINTER :: scf_env
328 TYPE(scf_control_type), POINTER :: scf_control
329
330 CALL calculate_kpoints_for_bs(kpoint, scheme, group_size_ext, mp_grid, kpgeneral, &
331 kp_shift, gamma_centered)
332
333 CALL get_qs_env(qs_env=qs_env, para_env=para_env, blacs_env=blacs_env)
334 CALL kpoint_env_initialize(kpoint, para_env, blacs_env)
335
336 CALL kpoint_initialize_mos(kpoint, qs_env%mos, nadd)
337 CALL kpoint_initialize_mo_set(kpoint)
338
339 CALL get_qs_env(qs_env, sab_kp=sab_nl, dft_control=dft_control)
340 CALL kpoint_init_cell_index(kpoint, sab_nl, para_env, dft_control%nimages)
341
342 CALL get_qs_env(qs_env, matrix_ks_kp=matrix_ks, matrix_s_kp=matrix_s, &
343 scf_env=scf_env, scf_control=scf_control)
344 CALL do_general_diag_kp(matrix_ks, matrix_s, kpoint, scf_env, scf_control, .false., diis_step)
345
346 END SUBROUTINE calculate_kp_orbitals
347
348! **************************************************************************************************
349!> \brief ...
350!> \param kpoint ...
351!> \param scheme ...
352!> \param group_size_ext ...
353!> \param mp_grid ...
354!> \param kpgeneral ...
355!> \param kp_shift ...
356!> \param gamma_centered ...
357! **************************************************************************************************
358 SUBROUTINE calculate_kpoints_for_bs(kpoint, scheme, group_size_ext, mp_grid, kpgeneral, &
359 kp_shift, gamma_centered)
360
361 TYPE(kpoint_type), POINTER :: kpoint
362 CHARACTER(LEN=*), INTENT(IN) :: scheme
363 INTEGER, INTENT(IN), OPTIONAL :: group_size_ext
364 INTEGER, DIMENSION(3), INTENT(IN), OPTIONAL :: mp_grid
365 REAL(kind=dp), DIMENSION(:, :), INTENT(IN), &
366 OPTIONAL :: kpgeneral
367 REAL(kind=dp), DIMENSION(3), INTENT(IN), OPTIONAL :: kp_shift
368 LOGICAL, INTENT(IN), OPTIONAL :: gamma_centered
369
370 INTEGER :: i, idim, ix, iy, iz, npoints
371 INTEGER, DIMENSION(3) :: ik
372 LOGICAL :: gamma_mesh
373 REAL(kind=dp), DIMENSION(3) :: kpt_latt, shift
374
375 cpassert(.NOT. ASSOCIATED(kpoint))
376
377 CALL kpoint_create(kpoint)
378
379 IF (PRESENT(kp_shift)) THEN
380 shift = kp_shift
381 ELSE
382 shift = 0.0_dp
383 END IF
384 IF (PRESENT(gamma_centered)) THEN
385 gamma_mesh = gamma_centered
386 ELSE
387 gamma_mesh = .false.
388 END IF
389
390 kpoint%kp_scheme = scheme
391 kpoint%symmetry = .false.
392 kpoint%verbose = .false.
393 kpoint%full_grid = .false.
394 kpoint%use_real_wfn = .false.
395 kpoint%gamma_centered = gamma_mesh
396 kpoint%kp_shift = shift
397 kpoint%eps_geo = 1.e-6_dp
398 IF (PRESENT(group_size_ext)) THEN
399 kpoint%parallel_group_size = group_size_ext
400 ELSE
401 kpoint%parallel_group_size = -1
402 END IF
403 SELECT CASE (scheme)
404 CASE ("GAMMA")
405 kpoint%nkp = 1
406 ALLOCATE (kpoint%xkp(3, 1), kpoint%wkp(1))
407 kpoint%xkp(1:3, 1) = 0.0_dp
408 kpoint%wkp(1) = 1.0_dp
409 kpoint%symmetry = .true.
410 ALLOCATE (kpoint%kp_sym(1))
411 NULLIFY (kpoint%kp_sym(1)%kpoint_sym)
412 CALL kpoint_sym_create(kpoint%kp_sym(1)%kpoint_sym)
413 CASE ("MONKHORST-PACK", "MACDONALD")
414 cpassert(PRESENT(mp_grid))
415 npoints = mp_grid(1)*mp_grid(2)*mp_grid(3)
416 kpoint%nkp_grid(1:3) = mp_grid(1:3)
417 kpoint%full_grid = .true.
418 kpoint%nkp = npoints
419 ALLOCATE (kpoint%xkp(3, npoints), kpoint%wkp(npoints))
420 kpoint%wkp(:) = 1._dp/real(npoints, kind=dp)
421 i = 0
422 DO ix = 1, mp_grid(1)
423 DO iy = 1, mp_grid(2)
424 DO iz = 1, mp_grid(3)
425 i = i + 1
426 ik = [ix, iy, iz]
427 DO idim = 1, 3
428 IF (gamma_mesh .AND. mod(mp_grid(idim), 2) == 0) THEN
429 kpt_latt(idim) = real(2*ik(idim) - mp_grid(idim), kind=dp)/ &
430 (2._dp*real(mp_grid(idim), kind=dp))
431 ELSE
432 kpt_latt(idim) = real(2*ik(idim) - mp_grid(idim) - 1, kind=dp)/ &
433 (2._dp*real(mp_grid(idim), kind=dp))
434 END IF
435 END DO
436 kpoint%xkp(1:3, i) = kpt_latt(1:3) + shift(1:3)
437 END DO
438 END DO
439 END DO
440 ! default: no symmetry settings
441 ALLOCATE (kpoint%kp_sym(kpoint%nkp))
442 DO i = 1, kpoint%nkp
443 NULLIFY (kpoint%kp_sym(i)%kpoint_sym)
444 CALL kpoint_sym_create(kpoint%kp_sym(i)%kpoint_sym)
445 END DO
446 CASE ("GENERAL")
447 cpassert(PRESENT(kpgeneral))
448 npoints = SIZE(kpgeneral, 2)
449 kpoint%nkp = npoints
450 ALLOCATE (kpoint%xkp(3, npoints), kpoint%wkp(npoints))
451 kpoint%wkp(:) = 1._dp/real(npoints, kind=dp)
452 kpoint%xkp(1:3, 1:npoints) = kpgeneral(1:3, 1:npoints)
453 ! default: no symmetry settings
454 ALLOCATE (kpoint%kp_sym(kpoint%nkp))
455 DO i = 1, kpoint%nkp
456 NULLIFY (kpoint%kp_sym(i)%kpoint_sym)
457 CALL kpoint_sym_create(kpoint%kp_sym(i)%kpoint_sym)
458 END DO
459 CASE DEFAULT
460 cpabort("Unknown kpoint scheme requested")
461 END SELECT
462
463 END SUBROUTINE calculate_kpoints_for_bs
464
465END MODULE qs_band_structure
Handles all functions related to the CELL.
Definition cell_types.F:15
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Utility routines to open and close files. Tracking of preconnections.
Definition cp_files.F:16
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
Definition cp_files.F:311
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
Definition cp_files.F:122
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
Utility routines to read data from files. Kept as close as possible to the old parser because.
elemental subroutine, public read_float_object(string, object, error_message)
Returns a floating point number read from a string including fraction like z1/z2.
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public max_line_length
Definition kinds.F:59
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Routines needed for kpoint calculation.
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 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_env_initialize(kpoint, para_env, blacs_env, with_aux_fit)
Initialize the kpoint environment.
Types and basic routines needed for a kpoint calculation.
subroutine, public kpoint_sym_create(kp_sym)
Create a single kpoint symmetry environment.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym, inversion_symmetry_only, symmetry_backend, symmetry_reduction_method, gamma_centered)
Retrieve information from a kpoint environment.
subroutine, public kpoint_release(kpoint)
Release a kpoint environment, deallocate all data.
subroutine, public kpoint_create(kpoint)
Create a kpoint environment.
Machine interface based on Fortran 2003 and POSIX.
Definition machine.F:17
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
Definition machine.F:141
Definition of mathematical constants and functions.
real(kind=dp), parameter, public twopi
Interface to the message passing library MPI.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public evolt
Definition physcon.F:183
real(kind=dp), parameter, public angstrom
Definition physcon.F:144
Calculation of band structures.
subroutine, public calculate_kpoints_for_bs(kpoint, scheme, group_size_ext, mp_grid, kpgeneral, kp_shift, gamma_centered)
...
subroutine, public calculate_kp_orbitals(qs_env, kpoint, scheme, nadd, mp_grid, kpgeneral, group_size_ext, kp_shift, gamma_centered)
diagonalize KS matrices at a set of kpoints
subroutine, public calculate_band_structure(qs_env)
Main routine for band structure calculation.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public qs_env_release(qs_env)
releases the given qs_env (see doc/ReferenceCounting.html)
Initialize a qs_env for kpoint calculations starting from a gamma point qs_env.
Definition qs_gamma2kp.F:14
subroutine, public create_kp_from_gamma(qs_env, qs_env_kp, with_xc_terms)
...
Definition qs_gamma2kp.F:63
Definition and initialisation of the mo data type.
Definition qs_mo_types.F:22
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
Define the neighbor list data types and the corresponding functionality.
Different diagonalization schemes that can be used for the iterative solution of the eigenvalue probl...
subroutine, public do_general_diag_kp(matrix_ks, matrix_s, kpoints, scf_env, scf_control, update_p, diis_step, diis_error, qs_env, probe)
Kpoint diagonalization routine Transforms matrices to kpoint, distributes kpoint groups,...
module that contains the definitions of the scf types
parameters that control an scf iteration
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Keeps information about a specific k-point.
Contains information about kpoints.
stores all the informations relevant to an mpi environment