Octopus
propagator_etrs.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
22 use accel_oct_m
23 use batch_oct_m
24 use debug_oct_m
29 use grid_oct_m
31 use global_oct_m
36 use ions_oct_m
38 use lda_u_oct_m
40 use math_oct_m
44 use parser_oct_m
48 use space_oct_m
51 use types_oct_m
52 use v_ks_oct_m
55 use xc_oct_m
56
57 implicit none
58
59 private
60
61 public :: &
62 td_etrs, &
63 td_etrs_sc, &
64 td_aetrs, &
66
67contains
68
69 ! ---------------------------------------------------------
71 subroutine td_etrs(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, &
72 ions_dyn, ions)
73 type(v_ks_t), intent(inout) :: ks
74 type(namespace_t), intent(in) :: namespace
75 type(electron_space_t), intent(in) :: space
76 type(hamiltonian_elec_t), intent(inout) :: hm
77 type(partner_list_t), intent(in) :: ext_partners
78 type(grid_t), intent(in) :: gr
79 type(states_elec_t), intent(inout) :: st
80 type(propagator_base_t), intent(inout) :: tr
81 real(real64), intent(in) :: time
82 real(real64), intent(in) :: dt
83 type(ion_dynamics_t), intent(inout) :: ions_dyn
84 type(ions_t), intent(inout) :: ions
85
86 real(real64), allocatable :: vhxc_t1(:,:), vhxc_t2(:,:)
87 real(real64), allocatable :: vtau_t1(:,:), vtau_t2(:,:)
88 type(gauge_field_t), pointer :: gfield
89
90 push_sub(td_etrs)
91
92 if (hm%theory_level /= independent_particles) then
93
94 safe_allocate(vhxc_t1(1:gr%np, 1:st%d%nspin))
95 safe_allocate(vhxc_t2(1:gr%np, 1:st%d%nspin))
96 call lalg_copy(gr%np, st%d%nspin, hm%vhxc, vhxc_t1)
97 if (family_is_mgga_with_exc(hm%xc)) then
98 safe_allocate(vtau_t1(1:gr%np, 1:st%d%nspin))
99 safe_allocate(vtau_t2(1:gr%np, 1:st%d%nspin))
100 call lalg_copy(gr%np, st%d%nspin, hm%vtau, vtau_t1)
101 end if
102
103 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt, dt)
104
105 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
106 calc_current = .false., calc_energy = .false., calc_eigenval = .false.)
107
108 call lalg_copy(gr%np, st%d%nspin, hm%vhxc, vhxc_t2)
109 call lalg_copy(gr%np, st%d%nspin, vhxc_t1, hm%vhxc)
110 if(family_is_mgga_with_exc(hm%xc)) then
111 call lalg_copy(gr%np, st%d%nspin, hm%vtau, vtau_t2)
112 call lalg_copy(gr%np, st%d%nspin, vtau_t1, hm%vtau)
113 end if
114 call hm%update(gr, namespace, space, ext_partners, time = time - dt)
115
116 else
117
118 call propagation_ops_elec_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt)
119
120 end if
121
122 ! propagate dt/2 with H(t)
123
124 ! first move the ions to time t
125 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, ions, &
126 ext_partners, time, dt)
127
128 gfield => list_get_gauge_field(ext_partners)
129 if(associated(gfield)) then
130 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, dt, time)
131 end if
132
133 if (hm%theory_level /= independent_particles) then
134 call lalg_copy(gr%np, st%d%nspin, vhxc_t2, hm%vhxc)
135 if(family_is_mgga_with_exc(hm%xc)) then
136 call lalg_copy(gr%np, st%d%nspin, vtau_t2, hm%vtau)
137 end if
138 end if
139
140 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time)
141
142 ! propagate dt/2 with H(time - dt)
143 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt)
144
145 if (hm%theory_level /= independent_particles) then
146 safe_deallocate_a(vhxc_t1)
147 safe_deallocate_a(vhxc_t2)
148 safe_deallocate_a(vtau_t1)
149 safe_deallocate_a(vtau_t2)
150 end if
151
152 pop_sub(td_etrs)
153 end subroutine td_etrs
154
155 ! ---------------------------------------------------------
157 subroutine td_etrs_sc(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, &
158 ions_dyn, ions, sctol, scsteps)
159 type(v_ks_t), intent(inout) :: ks
160 type(namespace_t), intent(in) :: namespace
161 type(electron_space_t), intent(in) :: space
162 type(hamiltonian_elec_t), intent(inout) :: hm
163 type(partner_list_t), intent(in) :: ext_partners
164 type(grid_t), intent(in) :: gr
165 type(states_elec_t), intent(inout) :: st
166 type(propagator_base_t), intent(inout) :: tr
167 real(real64), intent(in) :: time
168 real(real64), intent(in) :: dt
169 type(ion_dynamics_t), intent(inout) :: ions_dyn
170 type(ions_t), intent(inout) :: ions
171 real(real64), intent(in) :: sctol
172 integer, optional, intent(out) :: scsteps
173
174 real(real64) :: diff
175 real(real64), allocatable :: vhxc_t1(:,:), vhxc_t2(:,:), vtau_t1(:,:), vtau_t2(:,:)
176 integer :: ik, ib, iter, ip
177 class(wfs_elec_t), allocatable :: psi2(:, :)
178 ! these are hardcoded for the moment
179 integer, parameter :: niter = 10
180 type(gauge_field_t), pointer :: gfield
181
182 push_sub(td_etrs_sc)
183
184 assert(hm%theory_level /= independent_particles)
185
186 safe_allocate(vhxc_t1(1:gr%np, 1:st%d%nspin))
187 safe_allocate(vhxc_t2(1:gr%np, 1:st%d%nspin))
188 call lalg_copy(gr%np, st%d%nspin, hm%vhxc, vhxc_t1)
189 if (family_is_mgga_with_exc(hm%xc)) then
190 safe_allocate(vtau_t1(1:gr%np, 1:st%d%nspin))
191 safe_allocate(vtau_t2(1:gr%np, 1:st%d%nspin))
192 call lalg_copy(gr%np, st%d%nspin, hm%vtau, vtau_t1)
193 end if
194
195 call messages_new_line()
196 call messages_write(' Self-consistency iteration:')
197 call messages_info(namespace=namespace)
198
199 !Propagate the states to t+dt/2 and compute the density at t+dt
200 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt, dt)
201
202 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
203 calc_current = .false., calc_energy = .false., calc_eigenval = .false.)
204
205 call lalg_copy(gr%np, st%d%nspin, hm%vhxc, vhxc_t2)
206 call lalg_copy(gr%np, st%d%nspin, vhxc_t1, hm%vhxc)
207 if(family_is_mgga_with_exc(hm%xc)) then
208 call lalg_copy(gr%np, st%d%nspin, hm%vtau, vtau_t2)
209 call lalg_copy(gr%np, st%d%nspin, vtau_t1, hm%vtau)
210 end if
211
212 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time - dt)
213
214 ! propagate dt/2 with H(t)
215
216 ! first move the ions to time t
217 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, ions, &
218 ext_partners, time, dt)
219
220 gfield => list_get_gauge_field(ext_partners)
221 if(associated(gfield)) then
222 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, dt, time)
223 end if
224
225 call lalg_copy(gr%np, st%d%nspin, vhxc_t2, hm%vhxc)
226 if(family_is_mgga_with_exc(hm%xc)) then
227 call lalg_copy(gr%np, st%d%nspin, vtau_t2, hm%vtau)
228 end if
229
230 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time)
231
232 safe_allocate_type_array(wfs_elec_t, psi2, (st%group%block_start:st%group%block_end, st%d%kpt%start:st%d%kpt%end))
233
234 ! store the state at half iteration
235 do ik = st%d%kpt%start, st%d%kpt%end
236 do ib = st%group%block_start, st%group%block_end
237 call st%group%psib(ib, ik)%copy_to(psi2(ib, ik), copy_data=.true.)
238 end do
239 end do
240
241 do iter = 1, niter
242
243 call lalg_copy(gr%np, st%d%nspin, hm%vhxc, vhxc_t2)
244 if(family_is_mgga_with_exc(hm%xc)) then
245 call lalg_copy(gr%np, st%d%nspin, hm%vtau, vtau_t2)
246 end if
247
248 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, m_half * dt)
249
250 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
251 time = time, calc_current = .false., calc_energy = .false., calc_eigenval = .false.)
252 call lda_u_update_occ_matrices(hm%lda_u, namespace, gr, st, hm%hm_base, hm%phase, hm%energy)
253
254 ! now check how much the potential changed
255 ! We multiply by the density to compute the first moment
256 ! This avoids spurious effects for post-LDA functionals when at the
257 ! border of the box for isolated systems.
258 do ip = 1, gr%np
259 vhxc_t2(ip, 1) = sum(abs(vhxc_t2(ip, 1:st%d%nspin) - hm%vhxc(ip, 1:st%d%nspin))*st%rho(ip, 1:st%d%nspin))
260 end do
261 diff = dmf_integrate(gr, vhxc_t2(:, 1)) / st%qtot
262
263 call messages_write(' step ')
264 call messages_write(iter)
265 call messages_write(', residue = ')
266 call messages_write(abs(diff), fmt = '(1x,es9.2)')
267 call messages_info(namespace=namespace)
268
269 if (diff <= sctol) exit
270
271 if (iter /= niter) then
272 ! we are not converged, restore the states
273 do ik = st%d%kpt%start, st%d%kpt%end
274 do ib = st%group%block_start, st%group%block_end
275 call psi2(ib, ik)%copy_data_to(gr%np, st%group%psib(ib, ik))
276 end do
277 end do
278 end if
279
280 end do
281
282 if (hm%lda_u_level /= dft_u_none) then
283 call lda_u_write_u(hm%lda_u, namespace=namespace)
284 call lda_u_write_v(hm%lda_u, namespace=namespace)
285 end if
286
287 ! print an empty line
288 call messages_info(namespace=namespace)
289
290 if (present(scsteps)) scsteps = iter
291
292 safe_deallocate_a(vhxc_t1)
293 safe_deallocate_a(vhxc_t2)
294 safe_deallocate_a(vtau_t1)
295 safe_deallocate_a(vtau_t2)
296
297 do ik = st%d%kpt%start, st%d%kpt%end
298 do ib = st%group%block_start, st%group%block_end
299 call psi2(ib, ik)%end()
300 end do
301 end do
302
303 safe_deallocate_a(psi2)
304
305 pop_sub(td_etrs_sc)
306 end subroutine td_etrs_sc
307
308 ! ---------------------------------------------------------
310 subroutine td_aetrs(namespace, space, hm, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
311 type(namespace_t), intent(in) :: namespace
312 type(electron_space_t), intent(in) :: space
313 type(hamiltonian_elec_t), intent(inout) :: hm
314 type(grid_t), intent(in) :: gr
315 type(states_elec_t), intent(inout) :: st
316 type(propagator_base_t), intent(inout) :: tr
317 real(real64), intent(in) :: time
318 real(real64), intent(in) :: dt
319 type(ion_dynamics_t), intent(inout) :: ions_dyn
320 type(ions_t), intent(inout) :: ions
321 type(partner_list_t), intent(in) :: ext_partners
322
323 type(gauge_field_t), pointer :: gfield
324
325 push_sub(td_aetrs)
326
327 ! propagate half of the time step with H(time - dt)
328 call propagation_ops_elec_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt)
329
330 !Get the potentials from the interpolator
331 call propagation_ops_elec_interpolate_get(gr, hm, tr%vksold)
332
333 ! move the ions to time t
334 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, &
335 ions, ext_partners, time, dt)
336
337 !Propagate gauge field
338 gfield => list_get_gauge_field(ext_partners)
339 if(associated(gfield)) then
340 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, dt, time)
341 end if
342
343 !Update Hamiltonian
344 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time)
345
346 !Do the time propagation for the second half of the time step
347 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt)
348
349 pop_sub(td_aetrs)
350 end subroutine td_aetrs
351
352 ! ---------------------------------------------------------
354 subroutine td_caetrs(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, &
355 ions_dyn, ions)
356 type(v_ks_t), intent(inout) :: ks
357 type(namespace_t), intent(in) :: namespace
358 type(electron_space_t), intent(in) :: space
359 type(hamiltonian_elec_t), intent(inout) :: hm
360 type(partner_list_t), intent(in) :: ext_partners
361 type(grid_t), intent(in) :: gr
362 type(states_elec_t), intent(inout) :: st
363 type(propagator_base_t), intent(inout) :: tr
364 real(real64), intent(in) :: time
365 real(real64), intent(in) :: dt
366 type(ion_dynamics_t), intent(inout) :: ions_dyn
367 type(ions_t), intent(inout) :: ions
368
369 integer :: ik, ispin, ip, ist, ib
370 real(real64) :: vv
371 complex(real64) :: phase
372 type(density_calc_t) :: dens_calc
373 integer(int64) :: pnp, wgsize, dim2, dim3
374 real(real64), allocatable :: vold(:, :), vtauold(:, :)
375 type(accel_mem_t) :: phase_buff
376 type(gauge_field_t), pointer :: gfield
377
378 push_sub(td_caetrs)
379
380 safe_allocate(vold(1:gr%np, 1:st%d%nspin))
381 if (family_is_mgga_with_exc(hm%xc)) then
382 safe_allocate(vtauold(1:gr%np, 1:st%d%nspin))
383 call potential_interpolation_get(tr%vksold, gr%np, st%d%nspin, 2, vold, vtau = vtauold)
384 call hamiltonian_elec_set_vhxc(hm, gr, vold, vtauold)
385 else
386 call potential_interpolation_get(tr%vksold, gr%np, st%d%nspin, 2, vold)
387 call hamiltonian_elec_set_vhxc(hm, gr, vold)
388 end if
389
390 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time - dt)
391
392 call v_ks_calc_start(ks, namespace, space, hm, st, ions, ions%latt, ext_partners, &
393 time = time - dt, calc_energy = .false., calc_current = .false.)
394
395 ! propagate half of the time step with H(time - dt)
396 call propagation_ops_elec_exp_apply(tr%te, namespace, st, gr, hm, m_half*dt)
397
398 call v_ks_calc_finish(ks, hm, namespace, space, ions%latt, st, ext_partners)
399
400 if (family_is_mgga_with_exc(hm%xc)) then
401 call potential_interpolation_set(tr%vksold, gr%np, st%d%nspin, 1, hm%vhxc, vtau = hm%vtau)
402 call interpolate( (/time - dt, time - m_two*dt, time - m_three*dt/), &
403 tr%vksold%v_old(:, :, 1:3), time, tr%vksold%v_old(:, :, 0))
404 call interpolate( (/time - dt, time - m_two*dt, time - m_three*dt/), &
405 tr%vksold%vtau_old(:, :, 1:3), time, tr%vksold%vtau_old(:, :, 0))
406 do ispin = 1, st%d%nspin
407 do ip = 1, gr%np
408 vold(ip, ispin) = m_half*dt*(hm%vhxc(ip, ispin) - vold(ip, ispin))
409 vtauold(ip, ispin) = m_half*dt*(hm%vtau(ip, ispin) - vtauold(ip, ispin))
410 end do
411 end do
412 else
413 call potential_interpolation_set(tr%vksold, gr%np, st%d%nspin, 1, hm%vhxc)
414 call interpolate( (/time - dt, time - m_two*dt, time - m_three*dt/), &
415 tr%vksold%v_old(:, :, 1:3), time, tr%vksold%v_old(:, :, 0))
416
417 do ispin = 1, st%d%nspin
418 do ip = 1, gr%np
419 vold(ip, ispin) = m_half*dt*(hm%vhxc(ip, ispin) - vold(ip, ispin))
420 end do
421 end do
422 end if
423
424 ! copy vold to a cl buffer
425 if (accel_is_enabled() .and. hm%apply_packed()) then
426 if (family_is_mgga_with_exc(hm%xc)) then
427 call messages_not_implemented('CAETRS propagator with accel and MGGA with energy functionals', namespace=namespace)
428 end if
429 pnp = accel_padded_size(gr%np)
430 call accel_create_buffer(phase_buff, accel_mem_read_only, type_float, pnp*st%d%nspin)
431 assert(ubound(vold, dim = 1) == gr%np)
432 do ispin = 1, st%d%nspin
433 call accel_write_buffer(phase_buff, int(gr%np, int64), vold(:, ispin), offset = (ispin - 1)*pnp)
434 end do
435 end if
436
437 !Get the potentials from the interpolator
438 call propagation_ops_elec_interpolate_get(gr, hm, tr%vksold)
439
440 ! move the ions to time t
441 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, &
442 ions, ext_partners, time, dt)
443
444 gfield => list_get_gauge_field(ext_partners)
445 if(associated(gfield)) then
446 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, dt, time)
447 end if
448
449 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time)
450
451 call density_calc_init(dens_calc, st, gr, st%rho)
452
453 ! propagate the other half with H(t)
454 do ik = st%d%kpt%start, st%d%kpt%end
455 ispin = st%d%get_spin_index(ik)
456
457 do ib = st%group%block_start, st%group%block_end
458 if (hm%apply_packed()) then
459 call st%group%psib(ib, ik)%do_pack()
460 if (hamiltonian_elec_inh_term(hm)) call hm%inh_st%group%psib(ib, ik)%do_pack()
461 end if
462
463 call profiling_in("CAETRS_PHASE")
464 select case (st%group%psib(ib, ik)%status())
465 case (batch_not_packed)
466 do ip = 1, gr%np
467 vv = vold(ip, ispin)
468 phase = cmplx(cos(vv), -sin(vv), real64)
469 do ist = 1, st%group%psib(ib, ik)%nst_linear
470 st%group%psib(ib, ik)%zff_linear(ip, ist) = st%group%psib(ib, ik)%zff_linear(ip, ist)*phase
471 end do
472 end do
473 case (batch_packed)
474 do ip = 1, gr%np
475 vv = vold(ip, ispin)
476 phase = cmplx(cos(vv), -sin(vv), real64)
477 do ist = 1, st%group%psib(ib, ik)%nst_linear
478 st%group%psib(ib, ik)%zff_pack(ist, ip) = st%group%psib(ib, ik)%zff_pack(ist, ip)*phase
479 end do
480 end do
482 call accel_set_kernel_arg(kernel_phase, 0, pnp*(ispin - 1))
483 call accel_set_kernel_arg(kernel_phase, 1, phase_buff)
484 call accel_set_kernel_arg(kernel_phase, 2, st%group%psib(ib, ik)%ff_device)
485 call accel_set_kernel_arg(kernel_phase, 3, log2(st%group%psib(ib, ik)%pack_size(1)))
486
487 wgsize = accel_max_workgroup_size()/st%group%psib(ib, ik)%pack_size(1)
488 dim3 = pnp/(accel_max_size_per_dim(2)*wgsize) + 1
489 dim2 = min(accel_max_size_per_dim(2)*wgsize, pad(pnp, wgsize))
490
491 call accel_kernel_run(kernel_phase, (/st%group%psib(ib, ik)%pack_size(1), dim2, dim3/), &
492 (/st%group%psib(ib, ik)%pack_size(1), wgsize, 1_int64/))
493
494 end select
495 call profiling_out("CAETRS_PHASE")
496
497 call hm%phase%set_phase_corr(gr, st%group%psib(ib, ik))
498 if (hamiltonian_elec_inh_term(hm)) then
499 call tr%te%apply_batch(namespace, gr, hm, st%group%psib(ib, ik), m_half*dt, &
500 inh_psib = hm%inh_st%group%psib(ib, ik))
501 else
502 call tr%te%apply_batch(namespace, gr, hm, st%group%psib(ib, ik), m_half*dt)
503 end if
504 call hm%phase%unset_phase_corr(gr, st%group%psib(ib, ik))
505
506 call density_calc_accumulate(dens_calc, st%group%psib(ib, ik))
507
508 if (hm%apply_packed()) then
509 call st%group%psib(ib, ik)%do_unpack()
510 if (hamiltonian_elec_inh_term(hm)) call hm%inh_st%group%psib(ib, ik)%do_unpack()
511 end if
512 end do
513 end do
514
515 call density_calc_end(dens_calc)
516
517 if (accel_is_enabled() .and. hm%apply_packed()) then
518 call accel_release_buffer(phase_buff)
519 end if
520
521 safe_deallocate_a(vold)
522 safe_deallocate_a(vtauold)
523
524 pop_sub(td_caetrs)
525 end subroutine td_caetrs
526
527end module propagator_etrs_oct_m
528
529!! Local Variables:
530!! mode: f90
531!! coding: utf-8
532!! End:
Copies a vector x, to a vector y.
Definition: lalg_basic.F90:185
This is the common interface to a simple-minded polynomical interpolation procedure (simple use of th...
Definition: math.F90:186
double sin(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
integer pure function, public accel_max_size_per_dim(dim)
Definition: accel.F90:2179
subroutine, public accel_release_buffer(this)
Definition: accel.F90:1246
type(accel_kernel_t), target, save, public kernel_phase
Definition: accel.F90:288
pure logical function, public accel_is_enabled()
Definition: accel.F90:400
integer, parameter, public accel_mem_read_only
Definition: accel.F90:183
integer pure function, public accel_max_workgroup_size()
Definition: accel.F90:1472
This module implements batches of mesh functions.
Definition: batch.F90:133
integer, parameter, public batch_not_packed
functions are stored in CPU memory, unpacked order
Definition: batch.F90:276
integer, parameter, public batch_device_packed
functions are stored in device memory in packed order
Definition: batch.F90:276
integer, parameter, public batch_packed
functions are stored in CPU memory, in transposed (packed) order
Definition: batch.F90:276
This module implements a calculator for the density and defines related functions.
Definition: density.F90:120
subroutine, public density_calc_end(this, allreduce, symmetrize)
Finalize the density calculation.
Definition: density.F90:557
subroutine, public density_calc_accumulate(this, psib, async)
Accumulate weighted orbital densities for a batch psib.
Definition: density.F90:390
subroutine, public density_calc_init(this, st, gr, density)
initialize the density calculator
Definition: density.F90:186
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
real(real64), parameter, public m_two
Definition: global.F90:189
real(real64), parameter, public m_half
Definition: global.F90:193
real(real64), parameter, public m_three
Definition: global.F90:190
This module implements the underlying real-space grid.
Definition: grid.F90:117
subroutine, public hamiltonian_elec_set_vhxc(hm, mesh, vold, vold_tau)
integer, parameter, public independent_particles
pure logical function, public hamiltonian_elec_inh_term(hm)
This module defines classes and functions for interaction partners.
subroutine, public lda_u_write_u(this, iunit, namespace)
Definition: lda_u_io.F90:530
subroutine, public lda_u_write_v(this, iunit, namespace)
Definition: lda_u_io.F90:579
integer, parameter, public dft_u_none
Definition: lda_u.F90:200
subroutine, public lda_u_update_occ_matrices(this, namespace, mesh, st, hm_base, phase, energy)
Definition: lda_u.F90:796
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:115
This module defines various routines, operating on mesh functions.
real(real64) function, public dmf_integrate(mesh, ff, mask, reduce)
Integrate a function on the mesh.
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1125
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
Definition: messages.F90:624
subroutine, public messages_new_line()
Definition: messages.F90:1146
subroutine, public potential_interpolation_set(potential_interpolation, np, nspin, i, vhxc, vtau)
subroutine, public potential_interpolation_get(potential_interpolation, np, nspin, i, vhxc, vtau)
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
Definition: profiling.F90:623
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
Definition: profiling.F90:552
subroutine, public propagation_ops_elec_move_ions(wo, gr, hm, st, namespace, space, ions_dyn, ions, ext_partners, time, dt, save_pos)
subroutine, public propagation_ops_elec_propagate_gauge_field(wo, gfield, dt, time, save_gf)
subroutine, public propagation_ops_elec_update_hamiltonian(namespace, space, st, mesh, hm, ext_partners, time)
subroutine, public propagation_ops_elec_exp_apply(te, namespace, st, mesh, hm, dt)
subroutine, public propagation_ops_elec_interpolate_get(mesh, hm, interp)
subroutine, public propagation_ops_elec_fuse_density_exp_apply(te, namespace, st, gr, hm, dt, dt2, vmagnus)
subroutine, public td_caetrs(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, ions_dyn, ions)
Propagator with approximate enforced time-reversal symmetry.
subroutine, public td_etrs_sc(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, ions_dyn, ions, sctol, scsteps)
Propagator with enforced time-reversal symmetry and self-consistency.
subroutine, public td_etrs(ks, namespace, space, hm, ext_partners, gr, st, tr, time, dt, ions_dyn, ions)
Propagator with enforced time-reversal symmetry.
subroutine, public td_aetrs(namespace, space, hm, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
Propagator with approximate enforced time-reversal symmetry.
This module handles spin dimensions of the states and the k-point distribution.
type(type_t), public type_float
Definition: types.F90:133
subroutine, public v_ks_calc_finish(ks, hm, namespace, space, latt, st, ext_partners, force_semilocal)
Definition: v_ks.F90:1102
subroutine, public v_ks_calc_start(ks, namespace, space, hm, st, ions, latt, ext_partners, time, calc_energy, calc_current, force_semilocal)
This routine starts the calculation of the Kohn-Sham potential. The routine v_ks_calc_finish must be ...
Definition: v_ks.F90:774
subroutine, public v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval, time, calc_energy, calc_current, force_semilocal)
Definition: v_ks.F90:732
Definition: xc.F90:114
logical pure function, public family_is_mgga_with_exc(xcs)
Is the xc function part of the mGGA family with an energy functional.
Definition: xc.F90:592
The calculator object.
Definition: density.F90:168
Extension of space that contains the knowledge of the spin dimension.
Description of the grid, containing information on derivatives, stencil, and symmetries.
Definition: grid.F90:168
The states_elec_t class contains all electronic wave functions.
batches of electronic states
Definition: wfs_elec.F90:138
int true(void)