(git:ed6f26b)
Loading...
Searching...
No Matches
dm_ls_chebyshev.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Routines using linear scaling chebyshev methods
10!> \par History
11!> 2012.10 created [Jinwoong Cha]
12!> \author Jinwoong Cha
13! **************************************************************************************************
16 USE cp_dbcsr_api, ONLY: &
18 dbcsr_release, dbcsr_scale, dbcsr_set, dbcsr_type, dbcsr_type_no_symmetry
25 USE cp_output_handling, ONLY: cp_p_file,&
33 USE kinds, ONLY: default_string_length,&
34 dp
35 USE machine, ONLY: m_flush,&
37 USE mathconstants, ONLY: pi
39#include "./base/base_uses.f90"
40
41 IMPLICIT NONE
42
43 PRIVATE
44
45 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'dm_ls_chebyshev'
46
47 PUBLIC :: compute_chebyshev
48
49CONTAINS
50
51! **************************************************************************************************
52!> \brief compute chebyshev polynomials up to order n for a given value of x
53!> \param value ...
54!> \param x ...
55!> \param n ...
56!> \par History
57!> 2012.11 created [Jinwoong Cha]
58!> \author Jinwoong Cha
59! **************************************************************************************************
60 SUBROUTINE chebyshev_poly(value, x, n)
61 REAL(KIND=dp), INTENT(OUT) :: value
62 REAL(KIND=dp), INTENT(IN) :: x
63 INTEGER, INTENT(IN) :: n
64
65!polynomial values
66!number of chev polynomials
67
68 value = cos((n - 1)*acos(x))
69
70 END SUBROUTINE chebyshev_poly
71
72! **************************************************************************************************
73!> \brief kernel for chebyshev polynomials expansion (Jackson kernel)
74!> \param value ...
75!> \param n ...
76!> \param nc ...
77!> \par History
78!> 2012.11 created [Jinwoong Cha]
79!> \author Jinwoong Cha
80! **************************************************************************************************
81 SUBROUTINE kernel(value, n, nc)
82 REAL(KIND=dp), INTENT(OUT) :: value
83 INTEGER, INTENT(IN) :: n, nc
84
85!kernel at n
86!n-1 order of chebyshev polynomials
87!number of total chebyshev polynomials
88!Kernel define
89
90 value = 1.0_dp/(nc + 1.0_dp)*((nc - (n - 1) + 1.0_dp)* &
91 cos(pi*(n - 1)/(nc + 1.0_dp)) + sin(pi*(n - 1)/(nc + 1.0_dp))*1.0_dp/tan(pi/(nc + 1.0_dp)))
92
93 END SUBROUTINE kernel
94
95! **************************************************************************************************
96!> \brief compute properties based on chebyshev expansion
97!> \param qs_env ...
98!> \param ls_scf_env ...
99!> \par History
100!> 2012.10 created [Jinwoong Cha]
101!> \author Jinwoong Cha
102! **************************************************************************************************
103 SUBROUTINE compute_chebyshev(qs_env, ls_scf_env)
104 TYPE(qs_environment_type), POINTER :: qs_env
105 TYPE(ls_scf_env_type) :: ls_scf_env
106
107 CHARACTER(len=*), PARAMETER :: routinen = 'compute_chebyshev'
108 REAL(kind=dp), PARAMETER :: scale_evals = 1.01_dp
109
110 CHARACTER(LEN=30) :: middle_name
111 CHARACTER(LEN=default_string_length) :: title
112 INTEGER :: handle, icheb, igrid, iinte, ispin, &
113 iwindow, n_gridpoint_dos, ncheb, &
114 ninte, nrows, nwindow, unit_cube, &
115 unit_dos, unit_nr
116 LOGICAL :: converged, write_cubes
117 REAL(kind=dp) :: chev_t, chev_t_dos, dummy1, final, frob_matrix, initial, interval_a, &
118 interval_b, max_ev, min_ev, occ, orbital_occ, summa, t1, t2
119 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: chev_e, chev_es_dos, dos, dummy2, ev1, &
120 ev2, kernel_g, mu, sev1, sev2, trace_dm
121 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: aitchev_t, e_inte, gdensity, sqrt_vec
122 REAL(kind=dp), DIMENSION(:), POINTER :: tmp_r
123 TYPE(cp_logger_type), POINTER :: logger
124 TYPE(dbcsr_type) :: matrix_dummy1, matrix_f, matrix_tmp1, &
125 matrix_tmp2, matrix_tmp3
126 TYPE(dbcsr_type), DIMENSION(:), POINTER :: matrix_dummy2
127
128 IF (.NOT. ls_scf_env%chebyshev%compute_chebyshev) RETURN
129
130 CALL timeset(routinen, handle)
131
132 ! get a useful output_unit
133 logger => cp_get_default_logger()
134 IF (logger%para_env%is_source()) THEN
135 unit_nr = cp_logger_get_default_unit_nr(logger, local=.true.)
136 ELSE
137 unit_nr = -1
138 END IF
139
140 ncheb = ls_scf_env%chebyshev%n_chebyshev
141 ninte = 2*ncheb
142 n_gridpoint_dos = ls_scf_env%chebyshev%n_gridpoint_dos
143
144 write_cubes = btest(cp_print_key_should_output(logger%iter_info, ls_scf_env%chebyshev%print_key_cube), cp_p_file)
145 IF (write_cubes) THEN
146 IF (ASSOCIATED(ls_scf_env%chebyshev%min_energy)) DEALLOCATE (ls_scf_env%chebyshev%min_energy)
147 CALL section_vals_val_get(ls_scf_env%chebyshev%print_key_cube, "MIN_ENERGY", r_vals=tmp_r)
148 ALLOCATE (ls_scf_env%chebyshev%min_energy(SIZE(tmp_r)))
149 ls_scf_env%chebyshev%min_energy = tmp_r
150
151 IF (ASSOCIATED(ls_scf_env%chebyshev%max_energy)) DEALLOCATE (ls_scf_env%chebyshev%max_energy)
152 CALL section_vals_val_get(ls_scf_env%chebyshev%print_key_cube, "MAX_ENERGY", r_vals=tmp_r)
153 ALLOCATE (ls_scf_env%chebyshev%max_energy(SIZE(tmp_r)))
154 ls_scf_env%chebyshev%max_energy = tmp_r
155
156 nwindow = SIZE(ls_scf_env%chebyshev%min_energy)
157 ELSE
158 nwindow = 0
159 END IF
160
161 ALLOCATE (ev1(1:nwindow))
162 ALLOCATE (ev2(1:nwindow))
163 ALLOCATE (sev1(1:nwindow))
164 ALLOCATE (sev2(1:nwindow))
165 ALLOCATE (trace_dm(1:nwindow))
166 ALLOCATE (matrix_dummy2(1:nwindow))
167
168 DO iwindow = 1, nwindow
169 ev1(iwindow) = ls_scf_env%chebyshev%min_energy(iwindow)
170 ev2(iwindow) = ls_scf_env%chebyshev%max_energy(iwindow)
171 END DO
172
173 IF (unit_nr > 0) THEN
174 WRITE (unit_nr, '()')
175 WRITE (unit_nr, '(T2,A)') "STARTING CHEBYSHEV CALCULATION"
176 END IF
177
178 ! create 3 temporary matrices
179 CALL dbcsr_create(matrix_tmp1, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
180 CALL dbcsr_create(matrix_tmp2, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
181 CALL dbcsr_create(matrix_tmp3, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
182 CALL dbcsr_create(matrix_f, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
183 CALL dbcsr_create(matrix_dummy1, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
184
185 DO iwindow = 1, nwindow
186 CALL dbcsr_create(matrix_dummy2(iwindow), template=ls_scf_env%matrix_s, &
187 matrix_type=dbcsr_type_no_symmetry)
188 END DO
189
190 DO ispin = 1, SIZE(ls_scf_env%matrix_ks)
191 ! create matrix_F=inv(sqrt(S))*H*inv(sqrt(S))
192 CALL dbcsr_multiply("N", "N", 1.0_dp, ls_scf_env%matrix_s_sqrt_inv, ls_scf_env%matrix_ks(ispin), &
193 0.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter)
194 CALL dbcsr_multiply("N", "N", 1.0_dp, matrix_tmp1, ls_scf_env%matrix_s_sqrt_inv, &
195 0.0_dp, matrix_f, filter_eps=ls_scf_env%eps_filter)
196
197 ! find largest and smallest eigenvalues
198 CALL arnoldi_extremal(matrix_f, max_ev, min_ev, converged=converged, max_iter=ls_scf_env%max_iter_lanczos, &
199 threshold=ls_scf_env%eps_lanczos) !Lanczos algorithm to calculate eigenvalue
200 IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,2F16.8,A,L2)') &
201 "smallest largest eigenvalue", min_ev, max_ev, " converged ", converged
202 IF (nwindow > 0) THEN
203 IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,1000F16.8)') "requested interval-min_energy", ev1(:)
204 IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,1000F16.8)') "requested interval-max_energy", ev2(:)
205 END IF
206 interval_a = (max_ev - min_ev)*scale_evals/2
207 interval_b = (max_ev + min_ev)/2
208
209 sev1(:) = (ev1(:) - interval_b)/interval_a !scaled ev1 vector
210 sev2(:) = (ev2(:) - interval_b)/interval_a !scaled ev2 vector
211
212 !chebyshev domain,pi*sqrt(1-x^2) vector construction and chebyshev polynomials for integration (for g(E))
213 ALLOCATE (e_inte(1:ninte + 1, 1:nwindow))
214 ALLOCATE (sqrt_vec(1:ninte + 1, 1:nwindow))
215
216 DO iwindow = 1, nwindow
217 DO iinte = 1, ninte + 1
218 e_inte(iinte, iwindow) = sev1(iwindow) + ((sev2(iwindow) - sev1(iwindow))/ninte)*(iinte - 1)
219 sqrt_vec(iinte, iwindow) = pi*sqrt(1.0_dp - e_inte(iinte, iwindow)*e_inte(iinte, iwindow))
220 END DO
221 END DO
222
223 !integral.. (identical to the coefficient for g(E))
224
225 ALLOCATE (aitchev_t(1:ncheb, 1:nwindow)) !after intergral. =>ainte
226
227 DO iwindow = 1, nwindow
228 DO icheb = 1, ncheb
229 CALL chebyshev_poly(initial, e_inte(1, iwindow), icheb)
230 CALL chebyshev_poly(final, e_inte(1, iwindow), icheb)
231 summa = (sev2(iwindow) - sev1(iwindow))/(2.0_dp*ninte)*(initial/sqrt_vec(1, iwindow) + final/sqrt_vec(ninte + 1, iwindow))
232 DO iinte = 2, ninte
233 CALL chebyshev_poly(chev_t, e_inte(iinte, iwindow), icheb)
234 summa = summa + ((sev2(iwindow) - sev1(iwindow))/ninte)*(chev_t/sqrt_vec(iinte, iwindow))
235 END DO
236 aitchev_t(icheb, iwindow) = summa
237 summa = 0
238 END DO
239 END DO
240
241 ! scale the matrix to get evals in the interval -1,1
242 CALL dbcsr_add_on_diag(matrix_f, -interval_b)
243 CALL dbcsr_scale(matrix_f, 1/interval_a)
244
245 ! compute chebyshev matrix recursion
246 CALL dbcsr_get_info(matrix=matrix_f, nfullrows_total=nrows) !get information about a matrix
247 CALL dbcsr_set(matrix_dummy1, 0.0_dp) !empty matrix creation(for density matrix)
248
249 DO iwindow = 1, nwindow
250 CALL dbcsr_set(matrix_dummy2(iwindow), 0.0_dp) !empty matrix creation(for density matrix)
251 END DO
252
253 ALLOCATE (mu(1:ncheb))
254 ALLOCATE (kernel_g(1:ncheb))
255 CALL kernel(kernel_g(1), 1, ncheb)
256 CALL kernel(kernel_g(2), 2, ncheb)
257
258 CALL dbcsr_set(matrix_tmp1, 0.0_dp) !matrix creation
259 CALL dbcsr_add_on_diag(matrix_tmp1, 1.0_dp) !add a only number to diagonal elements
260 CALL dbcsr_trace(matrix_tmp1, trace=mu(1))
261 CALL dbcsr_copy(matrix_tmp2, matrix_f) !make matrix_tmp2 = matrix_F
262 CALL dbcsr_trace(matrix_tmp2, trace=mu(2))
263
264 DO iwindow = 1, nwindow
265 CALL dbcsr_copy(matrix_dummy1, matrix_tmp1)
266 CALL dbcsr_copy(matrix_dummy2(iwindow), matrix_tmp2) !matrix_dummy2=
267 CALL dbcsr_scale(matrix_dummy1, kernel_g(1)*aitchev_t(1, iwindow)) !first term of chebyshev poly(matrix)
268 CALL dbcsr_scale(matrix_dummy2(iwindow), 2.0_dp*kernel_g(2)*aitchev_t(2, iwindow)) !second term of chebyshev poly(matrix)
269
270 CALL dbcsr_add(matrix_dummy2(iwindow), matrix_dummy1, 1.0_dp, 1.0_dp)
271 END DO
272
273 DO icheb = 2, ncheb - 1
274 t1 = m_walltime()
275 CALL dbcsr_multiply("N", "N", 2.0_dp, matrix_f, matrix_tmp2, &
276 -1.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter) !matrix multiplication(Recursion)
277 CALL dbcsr_copy(matrix_tmp3, matrix_tmp1)
278 CALL dbcsr_copy(matrix_tmp1, matrix_tmp2)
279 CALL dbcsr_copy(matrix_tmp2, matrix_tmp3)
280 CALL dbcsr_trace(matrix_tmp2, trace=mu(icheb + 1)) !icheb+1 th coefficient
281 CALL kernel(kernel_g(icheb + 1), icheb + 1, ncheb)
282
283 DO iwindow = 1, nwindow
284
285 CALL dbcsr_copy(matrix_dummy1, matrix_tmp2)
286 CALL dbcsr_scale(matrix_dummy1, 2.0_dp*kernel_g(icheb + 1)*aitchev_t(icheb + 1, iwindow)) !second term of chebyshev poly(matrix)
287 CALL dbcsr_add(matrix_dummy2(iwindow), matrix_dummy1, 1.0_dp, 1.0_dp)
288 CALL dbcsr_trace(matrix_dummy2(iwindow), trace=trace_dm(iwindow)) !icheb+1 th coefficient
289
290 END DO
291
292 occ = dbcsr_get_occupation(matrix_tmp1)
293 t2 = m_walltime()
294 IF (unit_nr > 0 .AND. mod(icheb, 20) == 0) THEN
295 CALL m_flush(unit_nr)
296 IF (nwindow > 0) THEN
297 WRITE (unit_nr, '(T2,A,I5,1X,A,1X,F8.3,1X,A,1X,F8.6,1X,A,1X,1000F16.8)') &
298 "Iter.", icheb, "time=", t2 - t1, "occ=", occ, "traces=", trace_dm(:)
299 ELSE
300 WRITE (unit_nr, '(T2,A,I5,1X,A,1X,F8.3,1X,A,1X,F8.6)') &
301 "Iter.", icheb, "time=", t2 - t1, "occ=", occ
302 END IF
303 END IF
304 END DO
305
306 DO iwindow = 1, nwindow
307 IF (SIZE(ls_scf_env%matrix_ks) == 1) THEN
308 orbital_occ = 2.0_dp
309 ELSE
310 orbital_occ = 1.0_dp
311 END IF
312 CALL dbcsr_multiply("N", "N", 1.0_dp, ls_scf_env%matrix_s_sqrt_inv, matrix_dummy2(iwindow), &
313 0.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter)
314 CALL dbcsr_multiply("N", "N", orbital_occ, matrix_tmp1, ls_scf_env%matrix_s_sqrt_inv, &
315 0.0_dp, matrix_tmp2, filter_eps=ls_scf_env%eps_filter)
316 CALL dbcsr_copy(matrix_dummy2(iwindow), matrix_tmp2)
317
318 ! look at the difference with the density matrix from the ls routines
319 IF (.false.) THEN
320 CALL dbcsr_copy(matrix_tmp1, matrix_tmp2)
321 CALL dbcsr_add(matrix_tmp1, ls_scf_env%matrix_p(ispin), 1.0_dp, -1.0_dp) !comparison
322 frob_matrix = dbcsr_frobenius_norm(matrix_tmp1)
323 IF (unit_nr > 0) WRITE (unit_nr, *) "Difference between Chebyshev DM and LS DM", frob_matrix
324 END IF
325 END DO
326
327 write_cubes = btest(cp_print_key_should_output(logger%iter_info, &
328 ls_scf_env%chebyshev%print_key_cube), cp_p_file)
329 IF (write_cubes) THEN
330 DO iwindow = 1, nwindow
331 WRITE (middle_name, "(A,I0)") "E_DENSITY_WINDOW_", iwindow
332 WRITE (title, "(A,1X,F16.8,1X,A,1X,F16.8)") "Energy range : ", ev1(iwindow), "to", ev2(iwindow)
333 unit_cube = cp_print_key_unit_nr(logger, ls_scf_env%chebyshev%print_key_cube, &
334 "", extension=".cube", & !added 01/22/2012
335 middle_name=trim(middle_name), log_filename=.false.)
336 CALL write_matrix_to_cube(qs_env, ls_scf_env, matrix_dummy2(iwindow), unit_cube, title, &
337 section_get_ivals(ls_scf_env%chebyshev%print_key_cube, "STRIDE"))
338 CALL cp_print_key_finished_output(unit_cube, logger, ls_scf_env%chebyshev%print_key_cube, "")
339 END DO
340 END IF
341
342 END DO
343
344 ! Chebyshev expansion with calculated coefficient
345 ! grid construction and rescaling (by J)
346 unit_dos = cp_print_key_unit_nr(logger, ls_scf_env%chebyshev%print_key_dos, "", extension=".xy", &
347 middle_name="DOS", log_filename=.false.)
348
349 IF (unit_dos > 0) THEN
350 ALLOCATE (dos(1:n_gridpoint_dos))
351 ALLOCATE (gdensity(1:n_gridpoint_dos, 1:nwindow))
352 ALLOCATE (chev_e(1:n_gridpoint_dos))
353 ALLOCATE (chev_es_dos(1:n_gridpoint_dos))
354 ALLOCATE (dummy2(1:nwindow))
355 DO igrid = 1, n_gridpoint_dos
356 chev_e(igrid) = min_ev + (igrid - 1)*(max_ev - min_ev)/(n_gridpoint_dos - 1)
357 chev_es_dos(igrid) = (chev_e(igrid) - interval_b)/interval_a
358 END DO
359 DO igrid = 1, n_gridpoint_dos
360 dummy1 = 0.0_dp !summation of polynomials
361 dummy2(:) = 0.0_dp !summation of polynomials
362 DO icheb = 2, ncheb
363 CALL chebyshev_poly(chev_t_dos, chev_es_dos(igrid), icheb)
364 dummy1 = dummy1 + kernel_g(icheb)*mu(icheb)*chev_t_dos
365 DO iwindow = 1, nwindow
366 dummy2(iwindow) = dummy2(iwindow) + kernel_g(icheb)*aitchev_t(icheb, iwindow)*chev_t_dos
367 END DO
368 END DO
369 dos(igrid) = 1.0_dp/(interval_a*nrows* &
370 (pi*sqrt(1.0_dp - chev_es_dos(igrid)*chev_es_dos(igrid))))*(kernel_g(1)*mu(1) + 2.0_dp*dummy1)
371 DO iwindow = 1, nwindow
372 gdensity(igrid, iwindow) = kernel_g(1)*aitchev_t(1, iwindow) + 2.0_dp*dummy2(iwindow)
373 END DO
374 WRITE (unit_dos, '(1000F16.8)') chev_e(igrid), dos(igrid), gdensity(igrid, :)
375 END DO
376 DEALLOCATE (chev_es_dos, chev_e, dos, gdensity)
377 END IF
378 CALL cp_print_key_finished_output(unit_dos, logger, ls_scf_env%chebyshev%print_key_dos, "")
379
380 ! free the matrices
381 CALL dbcsr_release(matrix_tmp1)
382 CALL dbcsr_release(matrix_tmp2)
383 CALL dbcsr_release(matrix_tmp3)
384 CALL dbcsr_release(matrix_f)
385 CALL dbcsr_release(matrix_dummy1)
386
387 DO iwindow = 1, nwindow
388 CALL dbcsr_release(matrix_dummy2(iwindow))
389 END DO
390
391 DEALLOCATE (ev1, ev2, sev1, sev2, matrix_dummy2)
392
393 !Need deallocation
394 DEALLOCATE (mu, kernel_g, aitchev_t, e_inte, sqrt_vec)
395
396 IF (unit_nr > 0) WRITE (unit_nr, '(T2,A)') "ENDING CHEBYSHEV CALCULATION"
397
398 CALL timestop(handle)
399
400 END SUBROUTINE compute_chebyshev
401
402END MODULE dm_ls_chebyshev
arnoldi iteration using dbcsr
Definition arnoldi_api.F:16
subroutine, public arnoldi_extremal(matrix_a, max_ev, min_ev, converged, threshold, max_iter)
simple wrapper to estimate extremal eigenvalues with arnoldi, using the old lanczos interface this hi...
subroutine, public dbcsr_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_multiply(transa, transb, alpha, matrix_a, matrix_b, beta, matrix_c, first_row, last_row, first_column, last_column, first_k, last_k, retain_sparsity, filter_eps, flop)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
real(kind=dp) function, public dbcsr_get_occupation(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
subroutine, public dbcsr_add_on_diag(matrix, alpha)
Adds the given scalar to the diagonal of the matrix. Reserves any missing diagonal blocks.
subroutine, public dbcsr_trace(matrix, trace)
Computes the trace of the given matrix, also known as the sum of its diagonal elements.
real(dp) function, public dbcsr_frobenius_norm(matrix)
Compute the frobenius norm of a dbcsr matrix.
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
Routines using linear scaling chebyshev methods.
subroutine, public compute_chebyshev(qs_env, ls_scf_env)
compute properties based on chebyshev expansion
Routines for a linear scaling quickstep SCF run based on the density matrix, with a focus on the inte...
subroutine, public write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, stride)
...
Types needed for a linear scaling quickstep SCF run based on the density matrix.
objects that represent the structure of input sections and the data contained in an input section
integer function, dimension(:), pointer, public section_get_ivals(section_vals, keyword_name)
...
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 dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Machine interface based on Fortran 2003 and POSIX.
Definition machine.F:17
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition machine.F:130
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
Definition machine.F:147
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
type of a logger, at the moment it contains just a print level starting at which level it should be l...