Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2024 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 : ! **************************************************************************************************
14 : MODULE dm_ls_chebyshev
15 : USE arnoldi_api, ONLY: arnoldi_extremal
16 : USE cp_dbcsr_api, ONLY: &
17 : dbcsr_add, dbcsr_add_on_diag, dbcsr_copy, dbcsr_create, dbcsr_frobenius_norm, &
18 : dbcsr_get_info, dbcsr_get_occupation, dbcsr_multiply, dbcsr_release, dbcsr_scale, &
19 : dbcsr_set, dbcsr_trace, dbcsr_type, dbcsr_type_no_symmetry
20 : USE cp_log_handling, ONLY: cp_get_default_logger,&
21 : cp_logger_get_default_unit_nr,&
22 : cp_logger_type
23 : USE cp_output_handling, ONLY: cp_p_file,&
24 : cp_print_key_finished_output,&
25 : cp_print_key_should_output,&
26 : cp_print_key_unit_nr
27 : USE dm_ls_scf_qs, ONLY: write_matrix_to_cube
28 : USE dm_ls_scf_types, ONLY: ls_scf_env_type
29 : USE input_section_types, ONLY: section_get_ivals,&
30 : section_vals_val_get
31 : USE kinds, ONLY: default_string_length,&
32 : dp
33 : USE machine, ONLY: m_flush,&
34 : m_walltime
35 : USE mathconstants, ONLY: pi
36 : USE qs_environment_types, ONLY: qs_environment_type
37 : #include "./base/base_uses.f90"
38 :
39 : IMPLICIT NONE
40 :
41 : PRIVATE
42 :
43 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'dm_ls_chebyshev'
44 :
45 : PUBLIC :: compute_chebyshev
46 :
47 : CONTAINS
48 :
49 : ! **************************************************************************************************
50 : !> \brief compute chebyshev polynomials up to order n for a given value of x
51 : !> \param value ...
52 : !> \param x ...
53 : !> \param n ...
54 : !> \par History
55 : !> 2012.11 created [Jinwoong Cha]
56 : !> \author Jinwoong Cha
57 : ! **************************************************************************************************
58 3729300 : SUBROUTINE chebyshev_poly(value, x, n)
59 : REAL(KIND=dp), INTENT(OUT) :: value
60 : REAL(KIND=dp), INTENT(IN) :: x
61 : INTEGER, INTENT(IN) :: n
62 :
63 : !polynomial values
64 : !number of chev polynomials
65 :
66 3729300 : value = COS((n - 1)*ACOS(x))
67 :
68 3729300 : END SUBROUTINE chebyshev_poly
69 :
70 : ! **************************************************************************************************
71 : !> \brief kernel for chebyshev polynomials expansion (Jackson kernel)
72 : !> \param value ...
73 : !> \param n ...
74 : !> \param nc ...
75 : !> \par History
76 : !> 2012.11 created [Jinwoong Cha]
77 : !> \author Jinwoong Cha
78 : ! **************************************************************************************************
79 3000 : SUBROUTINE kernel(value, n, nc)
80 : REAL(KIND=dp), INTENT(OUT) :: value
81 : INTEGER, INTENT(IN) :: n, nc
82 :
83 : !kernel at n
84 : !n-1 order of chebyshev polynomials
85 : !number of total chebyshev polynomials
86 : !Kernel define
87 :
88 : value = 1.0_dp/(nc + 1.0_dp)*((nc - (n - 1) + 1.0_dp)* &
89 3000 : 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)))
90 :
91 3000 : END SUBROUTINE kernel
92 :
93 : ! **************************************************************************************************
94 : !> \brief compute properties based on chebyshev expansion
95 : !> \param qs_env ...
96 : !> \param ls_scf_env ...
97 : !> \par History
98 : !> 2012.10 created [Jinwoong Cha]
99 : !> \author Jinwoong Cha
100 : ! **************************************************************************************************
101 6 : SUBROUTINE compute_chebyshev(qs_env, ls_scf_env)
102 : TYPE(qs_environment_type), POINTER :: qs_env
103 : TYPE(ls_scf_env_type) :: ls_scf_env
104 :
105 : CHARACTER(len=*), PARAMETER :: routineN = 'compute_chebyshev'
106 : REAL(KIND=dp), PARAMETER :: scale_evals = 1.01_dp
107 :
108 : CHARACTER(LEN=30) :: middle_name
109 : CHARACTER(LEN=default_string_length) :: title
110 : INTEGER :: handle, icheb, igrid, iinte, ispin, &
111 : iwindow, n_gridpoint_dos, ncheb, &
112 : ninte, Nrows, nwindow, unit_cube, &
113 : unit_dos, unit_nr
114 : LOGICAL :: converged, write_cubes
115 : REAL(KIND=dp) :: chev_T, chev_T_dos, dummy1, final, frob_matrix, initial, interval_a, &
116 : interval_b, max_ev, min_ev, occ, orbital_occ, summa, t1, t2
117 6 : REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: chev_E, chev_Es_dos, dos, dummy2, ev1, &
118 6 : ev2, kernel_g, mu, sev1, sev2, trace_dm
119 6 : REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: aitchev_T, E_inte, gdensity, sqrt_vec
120 6 : REAL(KIND=dp), DIMENSION(:), POINTER :: tmp_r
121 : TYPE(cp_logger_type), POINTER :: logger
122 : TYPE(dbcsr_type) :: matrix_dummy1, matrix_F, matrix_tmp1, &
123 : matrix_tmp2, matrix_tmp3
124 6 : TYPE(dbcsr_type), DIMENSION(:), POINTER :: matrix_dummy2
125 :
126 6 : IF (.NOT. ls_scf_env%chebyshev%compute_chebyshev) RETURN
127 :
128 6 : CALL timeset(routineN, handle)
129 :
130 : ! get a useful output_unit
131 6 : logger => cp_get_default_logger()
132 6 : IF (logger%para_env%is_source()) THEN
133 3 : unit_nr = cp_logger_get_default_unit_nr(logger, local=.TRUE.)
134 : ELSE
135 3 : unit_nr = -1
136 : END IF
137 :
138 6 : ncheb = ls_scf_env%chebyshev%n_chebyshev
139 6 : ninte = 2*ncheb
140 6 : n_gridpoint_dos = ls_scf_env%chebyshev%n_gridpoint_dos
141 :
142 6 : write_cubes = BTEST(cp_print_key_should_output(logger%iter_info, ls_scf_env%chebyshev%print_key_cube), cp_p_file)
143 6 : IF (write_cubes) THEN
144 2 : IF (ASSOCIATED(ls_scf_env%chebyshev%min_energy)) DEALLOCATE (ls_scf_env%chebyshev%min_energy)
145 2 : CALL section_vals_val_get(ls_scf_env%chebyshev%print_key_cube, "MIN_ENERGY", r_vals=tmp_r)
146 6 : ALLOCATE (ls_scf_env%chebyshev%min_energy(SIZE(tmp_r)))
147 8 : ls_scf_env%chebyshev%min_energy = tmp_r
148 :
149 2 : IF (ASSOCIATED(ls_scf_env%chebyshev%max_energy)) DEALLOCATE (ls_scf_env%chebyshev%max_energy)
150 2 : CALL section_vals_val_get(ls_scf_env%chebyshev%print_key_cube, "MAX_ENERGY", r_vals=tmp_r)
151 6 : ALLOCATE (ls_scf_env%chebyshev%max_energy(SIZE(tmp_r)))
152 8 : ls_scf_env%chebyshev%max_energy = tmp_r
153 :
154 2 : nwindow = SIZE(ls_scf_env%chebyshev%min_energy)
155 : ELSE
156 : nwindow = 0
157 : END IF
158 :
159 14 : ALLOCATE (ev1(1:nwindow))
160 8 : ALLOCATE (ev2(1:nwindow))
161 8 : ALLOCATE (sev1(1:nwindow))
162 8 : ALLOCATE (sev2(1:nwindow))
163 8 : ALLOCATE (trace_dm(1:nwindow))
164 20 : ALLOCATE (matrix_dummy2(1:nwindow))
165 :
166 12 : DO iwindow = 1, nwindow
167 6 : ev1(iwindow) = ls_scf_env%chebyshev%min_energy(iwindow)
168 12 : ev2(iwindow) = ls_scf_env%chebyshev%max_energy(iwindow)
169 : END DO
170 :
171 6 : IF (unit_nr > 0) THEN
172 3 : WRITE (unit_nr, '()')
173 3 : WRITE (unit_nr, '(T2,A)') "STARTING CHEBYSHEV CALCULATION"
174 : END IF
175 :
176 : ! create 3 temporary matrices
177 6 : CALL dbcsr_create(matrix_tmp1, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
178 6 : CALL dbcsr_create(matrix_tmp2, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
179 6 : CALL dbcsr_create(matrix_tmp3, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
180 6 : CALL dbcsr_create(matrix_F, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
181 6 : CALL dbcsr_create(matrix_dummy1, template=ls_scf_env%matrix_s, matrix_type=dbcsr_type_no_symmetry)
182 :
183 12 : DO iwindow = 1, nwindow
184 : CALL dbcsr_create(matrix_dummy2(iwindow), template=ls_scf_env%matrix_s, &
185 12 : matrix_type=dbcsr_type_no_symmetry)
186 : END DO
187 :
188 12 : DO ispin = 1, SIZE(ls_scf_env%matrix_ks)
189 : ! create matrix_F=inv(sqrt(S))*H*inv(sqrt(S))
190 : CALL dbcsr_multiply("N", "N", 1.0_dp, ls_scf_env%matrix_s_sqrt_inv, ls_scf_env%matrix_ks(ispin), &
191 6 : 0.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter)
192 : CALL dbcsr_multiply("N", "N", 1.0_dp, matrix_tmp1, ls_scf_env%matrix_s_sqrt_inv, &
193 6 : 0.0_dp, matrix_F, filter_eps=ls_scf_env%eps_filter)
194 :
195 : ! find largest and smallest eigenvalues
196 : CALL arnoldi_extremal(matrix_F, max_ev, min_ev, converged=converged, max_iter=ls_scf_env%max_iter_lanczos, &
197 6 : threshold=ls_scf_env%eps_lanczos) !Lanczos algorithm to calculate eigenvalue
198 6 : IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,2F16.8,A,L2)') &
199 3 : "smallest largest eigenvalue", min_ev, max_ev, " converged ", converged
200 6 : IF (nwindow > 0) THEN
201 2 : IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,1000F16.8)') "requested interval-min_energy", ev1(:)
202 2 : IF (unit_nr > 0) WRITE (unit_nr, '(T2,A,1000F16.8)') "requested interval-max_energy", ev2(:)
203 : END IF
204 6 : interval_a = (max_ev - min_ev)*scale_evals/2
205 6 : interval_b = (max_ev + min_ev)/2
206 :
207 12 : sev1(:) = (ev1(:) - interval_b)/interval_a !scaled ev1 vector
208 12 : sev2(:) = (ev2(:) - interval_b)/interval_a !scaled ev2 vector
209 :
210 : !chebyshev domain,pi*sqrt(1-x^2) vector construction and chebyshev polynomials for integration (for g(E))
211 20 : ALLOCATE (E_inte(1:ninte + 1, 1:nwindow))
212 14 : ALLOCATE (sqrt_vec(1:ninte + 1, 1:nwindow))
213 :
214 12 : DO iwindow = 1, nwindow
215 4818 : DO iinte = 1, ninte + 1
216 4806 : E_inte(iinte, iwindow) = sev1(iwindow) + ((sev2(iwindow) - sev1(iwindow))/ninte)*(iinte - 1)
217 4812 : sqrt_vec(iinte, iwindow) = pi*SQRT(1.0_dp - E_inte(iinte, iwindow)*E_inte(iinte, iwindow))
218 : END DO
219 : END DO
220 :
221 : !integral.. (identical to the coefficient for g(E))
222 :
223 20 : ALLOCATE (aitchev_T(1:ncheb, 1:nwindow)) !after intergral. =>ainte
224 :
225 12 : DO iwindow = 1, nwindow
226 2412 : DO icheb = 1, ncheb
227 2400 : CALL chebyshev_poly(initial, E_inte(1, iwindow), icheb)
228 2400 : CALL chebyshev_poly(final, E_inte(1, iwindow), icheb)
229 2400 : summa = (sev2(iwindow) - sev1(iwindow))/(2.0_dp*ninte)*(initial/sqrt_vec(1, iwindow) + final/sqrt_vec(ninte + 1, iwindow))
230 1920000 : DO iinte = 2, ninte
231 1917600 : CALL chebyshev_poly(chev_T, E_inte(iinte, iwindow), icheb)
232 1920000 : summa = summa + ((sev2(iwindow) - sev1(iwindow))/ninte)*(chev_T/sqrt_vec(iinte, iwindow))
233 : END DO
234 2400 : aitchev_T(icheb, iwindow) = summa
235 4806 : summa = 0
236 : END DO
237 : END DO
238 :
239 : ! scale the matrix to get evals in the interval -1,1
240 6 : CALL dbcsr_add_on_diag(matrix_F, -interval_b)
241 6 : CALL dbcsr_scale(matrix_F, 1/interval_a)
242 :
243 : ! compute chebyshev matrix recursion
244 6 : CALL dbcsr_get_info(matrix=matrix_F, nfullrows_total=Nrows) !get information about a matrix
245 6 : CALL dbcsr_set(matrix_dummy1, 0.0_dp) !empty matrix creation(for density matrix)
246 :
247 12 : DO iwindow = 1, nwindow
248 12 : CALL dbcsr_set(matrix_dummy2(iwindow), 0.0_dp) !empty matrix creation(for density matrix)
249 : END DO
250 :
251 18 : ALLOCATE (mu(1:ncheb))
252 12 : ALLOCATE (kernel_g(1:ncheb))
253 6 : CALL kernel(kernel_g(1), 1, ncheb)
254 6 : CALL kernel(kernel_g(2), 2, ncheb)
255 :
256 6 : CALL dbcsr_set(matrix_tmp1, 0.0_dp) !matrix creation
257 6 : CALL dbcsr_add_on_diag(matrix_tmp1, 1.0_dp) !add a only number to diagonal elements
258 6 : CALL dbcsr_trace(matrix_tmp1, trace=mu(1))
259 6 : CALL dbcsr_copy(matrix_tmp2, matrix_F) !make matrix_tmp2 = matrix_F
260 6 : CALL dbcsr_trace(matrix_tmp2, trace=mu(2))
261 :
262 12 : DO iwindow = 1, nwindow
263 6 : CALL dbcsr_copy(matrix_dummy1, matrix_tmp1)
264 6 : CALL dbcsr_copy(matrix_dummy2(iwindow), matrix_tmp2) !matrix_dummy2=
265 6 : CALL dbcsr_scale(matrix_dummy1, kernel_g(1)*aitchev_T(1, iwindow)) !first term of chebyshev poly(matrix)
266 6 : CALL dbcsr_scale(matrix_dummy2(iwindow), 2.0_dp*kernel_g(2)*aitchev_T(2, iwindow)) !second term of chebyshev poly(matrix)
267 :
268 12 : CALL dbcsr_add(matrix_dummy2(iwindow), matrix_dummy1, 1.0_dp, 1.0_dp)
269 : END DO
270 :
271 2994 : DO icheb = 2, ncheb - 1
272 2988 : t1 = m_walltime()
273 : CALL dbcsr_multiply("N", "N", 2.0_dp, matrix_F, matrix_tmp2, &
274 2988 : -1.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter) !matrix multiplication(Recursion)
275 2988 : CALL dbcsr_copy(matrix_tmp3, matrix_tmp1)
276 2988 : CALL dbcsr_copy(matrix_tmp1, matrix_tmp2)
277 2988 : CALL dbcsr_copy(matrix_tmp2, matrix_tmp3)
278 2988 : CALL dbcsr_trace(matrix_tmp2, trace=mu(icheb + 1)) !icheb+1 th coefficient
279 2988 : CALL kernel(kernel_g(icheb + 1), icheb + 1, ncheb)
280 :
281 5376 : DO iwindow = 1, nwindow
282 :
283 2388 : CALL dbcsr_copy(matrix_dummy1, matrix_tmp2)
284 2388 : CALL dbcsr_scale(matrix_dummy1, 2.0_dp*kernel_g(icheb + 1)*aitchev_T(icheb + 1, iwindow)) !second term of chebyshev poly(matrix)
285 2388 : CALL dbcsr_add(matrix_dummy2(iwindow), matrix_dummy1, 1.0_dp, 1.0_dp)
286 5376 : CALL dbcsr_trace(matrix_dummy2(iwindow), trace=trace_dm(iwindow)) !icheb+1 th coefficient
287 :
288 : END DO
289 :
290 2988 : occ = dbcsr_get_occupation(matrix_tmp1)
291 2988 : t2 = m_walltime()
292 2994 : IF (unit_nr > 0 .AND. MOD(icheb, 20) == 0) THEN
293 72 : CALL m_flush(unit_nr)
294 72 : IF (nwindow > 0) THEN
295 : WRITE (unit_nr, '(T2,A,I5,1X,A,1X,F8.3,1X,A,1X,F8.6,1X,A,1X,1000F16.8)') &
296 19 : "Iter.", icheb, "time=", t2 - t1, "occ=", occ, "traces=", trace_dm(:)
297 : ELSE
298 : WRITE (unit_nr, '(T2,A,I5,1X,A,1X,F8.3,1X,A,1X,F8.6)') &
299 53 : "Iter.", icheb, "time=", t2 - t1, "occ=", occ
300 : END IF
301 : END IF
302 : END DO
303 :
304 12 : DO iwindow = 1, nwindow
305 6 : IF (SIZE(ls_scf_env%matrix_ks) == 1) THEN
306 6 : orbital_occ = 2.0_dp
307 : ELSE
308 0 : orbital_occ = 1.0_dp
309 : END IF
310 : CALL dbcsr_multiply("N", "N", 1.0_dp, ls_scf_env%matrix_s_sqrt_inv, matrix_dummy2(iwindow), &
311 6 : 0.0_dp, matrix_tmp1, filter_eps=ls_scf_env%eps_filter)
312 : CALL dbcsr_multiply("N", "N", orbital_occ, matrix_tmp1, ls_scf_env%matrix_s_sqrt_inv, &
313 6 : 0.0_dp, matrix_tmp2, filter_eps=ls_scf_env%eps_filter)
314 6 : CALL dbcsr_copy(matrix_dummy2(iwindow), matrix_tmp2)
315 :
316 : ! look at the difference with the density matrix from the ls routines
317 6 : IF (.FALSE.) THEN
318 : CALL dbcsr_copy(matrix_tmp1, matrix_tmp2)
319 : CALL dbcsr_add(matrix_tmp1, ls_scf_env%matrix_p(ispin), 1.0_dp, -1.0_dp) !comparison
320 : frob_matrix = dbcsr_frobenius_norm(matrix_tmp1)
321 : IF (unit_nr > 0) WRITE (unit_nr, *) "Difference between Chebyshev DM and LS DM", frob_matrix
322 : END IF
323 : END DO
324 :
325 : write_cubes = BTEST(cp_print_key_should_output(logger%iter_info, &
326 6 : ls_scf_env%chebyshev%print_key_cube), cp_p_file)
327 24 : IF (write_cubes) THEN
328 8 : DO iwindow = 1, nwindow
329 6 : WRITE (middle_name, "(A,I0)") "E_DENSITY_WINDOW_", iwindow
330 6 : WRITE (title, "(A,1X,F16.8,1X,A,1X,F16.8)") "Energy range : ", ev1(iwindow), "to", ev2(iwindow)
331 : unit_cube = cp_print_key_unit_nr(logger, ls_scf_env%chebyshev%print_key_cube, &
332 : "", extension=".cube", & !added 01/22/2012
333 6 : middle_name=TRIM(middle_name), log_filename=.FALSE.)
334 : CALL write_matrix_to_cube(qs_env, ls_scf_env, matrix_dummy2(iwindow), unit_cube, title, &
335 6 : section_get_ivals(ls_scf_env%chebyshev%print_key_cube, "STRIDE"))
336 8 : CALL cp_print_key_finished_output(unit_cube, logger, ls_scf_env%chebyshev%print_key_cube, "")
337 : END DO
338 : END IF
339 :
340 : END DO
341 :
342 : ! Chebyshev expansion with calculated coefficient
343 : ! grid construction and rescaling (by J)
344 : unit_dos = cp_print_key_unit_nr(logger, ls_scf_env%chebyshev%print_key_dos, "", extension=".xy", &
345 6 : middle_name="DOS", log_filename=.FALSE.)
346 :
347 6 : IF (unit_dos > 0) THEN
348 9 : ALLOCATE (dos(1:n_gridpoint_dos))
349 10 : ALLOCATE (gdensity(1:n_gridpoint_dos, 1:nwindow))
350 6 : ALLOCATE (chev_E(1:n_gridpoint_dos))
351 6 : ALLOCATE (chev_Es_dos(1:n_gridpoint_dos))
352 4 : ALLOCATE (dummy2(1:nwindow))
353 3103 : DO igrid = 1, n_gridpoint_dos
354 3100 : chev_E(igrid) = min_ev + (igrid - 1)*(max_ev - min_ev)/(n_gridpoint_dos - 1)
355 3103 : chev_Es_dos(igrid) = (chev_E(igrid) - interval_b)/interval_a
356 : END DO
357 3103 : DO igrid = 1, n_gridpoint_dos
358 9100 : dummy1 = 0.0_dp !summation of polynomials
359 9100 : dummy2(:) = 0.0_dp !summation of polynomials
360 1810000 : DO icheb = 2, ncheb
361 1806900 : CALL chebyshev_poly(chev_T_dos, chev_Es_dos(igrid), icheb)
362 1806900 : dummy1 = dummy1 + kernel_g(icheb)*mu(icheb)*chev_T_dos
363 4204000 : DO iwindow = 1, nwindow
364 4200900 : dummy2(iwindow) = dummy2(iwindow) + kernel_g(icheb)*aitchev_T(icheb, iwindow)*chev_T_dos
365 : END DO
366 : END DO
367 : dos(igrid) = 1.0_dp/(interval_a*Nrows* &
368 3100 : (pi*SQRT(1.0_dp - chev_Es_dos(igrid)*chev_Es_dos(igrid))))*(kernel_g(1)*mu(1) + 2.0_dp*dummy1)
369 9100 : DO iwindow = 1, nwindow
370 9100 : gdensity(igrid, iwindow) = kernel_g(1)*aitchev_T(1, iwindow) + 2.0_dp*dummy2(iwindow)
371 : END DO
372 3103 : WRITE (unit_dos, '(1000F16.8)') chev_E(igrid), dos(igrid), gdensity(igrid, :)
373 : END DO
374 3 : DEALLOCATE (chev_Es_dos, chev_E, dos, gdensity)
375 : END IF
376 6 : CALL cp_print_key_finished_output(unit_dos, logger, ls_scf_env%chebyshev%print_key_dos, "")
377 :
378 : ! free the matrices
379 6 : CALL dbcsr_release(matrix_tmp1)
380 6 : CALL dbcsr_release(matrix_tmp2)
381 6 : CALL dbcsr_release(matrix_tmp3)
382 6 : CALL dbcsr_release(matrix_F)
383 6 : CALL dbcsr_release(matrix_dummy1)
384 :
385 12 : DO iwindow = 1, nwindow
386 12 : CALL dbcsr_release(matrix_dummy2(iwindow))
387 : END DO
388 :
389 6 : DEALLOCATE (ev1, ev2, sev1, sev2, matrix_dummy2)
390 :
391 : !Need deallocation
392 6 : DEALLOCATE (mu, kernel_g, aitchev_T, E_inte, sqrt_vec)
393 :
394 6 : IF (unit_nr > 0) WRITE (unit_nr, '(T2,A)') "ENDING CHEBYSHEV CALCULATION"
395 :
396 6 : CALL timestop(handle)
397 :
398 12 : END SUBROUTINE compute_chebyshev
399 :
400 : END MODULE dm_ls_chebyshev
|