Octopus
sternheimer.F90
Go to the documentation of this file.
1!! Copyright (C) 2004-2012 Xavier Andrade, Eugene S. Kadantsev (ekadants@mjs1.phy.queensu.ca), David Strubbe
2!! Copyright (C) 2021 Davis Welakuh
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19
20#include "global.h"
21
23 use batch_oct_m
25 use debug_oct_m
28 use global_oct_m
29 use grid_oct_m
31 use io_oct_m
32 use, intrinsic :: iso_fortran_env
37 use math_oct_m
38 use mesh_oct_m
41 use mix_oct_m
42 use mpi_oct_m
45 use parser_oct_m
52 use smear_oct_m
53 use space_oct_m
57 use unit_oct_m
59 use types_oct_m
61 use xc_oct_m
62 use xc_f03_lib_m
63
64 implicit none
65
66 private
67 public :: &
90 swap_sigma, &
93 dcalc_hvar, &
94 zcalc_hvar, &
95 dcalc_kvar, &
97
98 character(len=*), public, parameter :: EM_RESP_PHOTONS_DIR = "em_resp_photons/"
99
100 type sternheimer_t
101 private
102 type(linear_solver_t) :: solver
103 type(mix_t) :: mixer
104 type(scf_tol_t) :: scf_tol
105 real(real64) :: lrc_alpha
106 real(real64), allocatable :: fxc(:,:,:)
107 real(real64), allocatable :: kxc(:,:,:,:)
108 real(real64), pointer, contiguous :: drhs(:, :, :, :) => null()
109 complex(real64), pointer, contiguous :: zrhs(:, :, :, :) => null()
110 real(real64), pointer, contiguous :: dinhomog(:, :, :, :, :) => null()
111 complex(real64), pointer, contiguous :: zinhomog(:, :, :, :, :) => null()
112 logical :: add_fxc
113 logical :: add_hartree
114 logical :: ok
115 logical :: occ_response
116 logical :: last_occ_response
117 logical :: occ_response_by_sternheimer
118 logical :: preorthogonalization
119 logical, public :: has_photons
120 real(real64) :: domega
121 complex(real64) :: zomega
122 real(real64), allocatable, public :: dphoton_coord_q(:, :)
123 complex(real64), allocatable, public :: zphoton_coord_q(:, :)
124 real(real64) :: pt_eta
125 type(photon_mode_t) :: pt_modes
126 end type sternheimer_t
127
128
129contains
130
131 !-----------------------------------------------------------
132 subroutine sternheimer_init(this, namespace, space, gr, st, hm, xc, mc, wfs_are_cplx, set_ham_var, set_occ_response, &
133 set_last_occ_response, occ_response_by_sternheimer)
134 type(sternheimer_t), intent(out) :: this
135 type(namespace_t), intent(in) :: namespace
136 class(space_t), intent(in) :: space
137 type(grid_t), intent(inout) :: gr
138 type(states_elec_t), intent(in) :: st
139 type(hamiltonian_elec_t), intent(in) :: hm
140 type(xc_t), intent(in) :: xc
141 type(multicomm_t), intent(in) :: mc
142 logical, intent(in) :: wfs_are_cplx
143 integer, optional, intent(in) :: set_ham_var
144 logical, optional, intent(in) :: set_occ_response
145 logical, optional, intent(in) :: set_last_occ_response
146 logical, optional, intent(in) :: occ_response_by_sternheimer
147
148 integer :: ham_var, iunit
149 logical :: default_preorthog
150
151 push_sub(sternheimer_init)
152
153 if (st%smear%method == smear_fixed_occ) then
154 call messages_experimental("Sternheimer equation for arbitrary occupations", namespace=namespace)
155 end if
156 if (st%smear%method == smear_semiconductor .and. &
157 (abs(st%smear%ef_occ) > m_epsilon) .and. abs(st%smear%ef_occ - m_one) > m_epsilon) then
158 write(message(1),'(a,f12.6)') 'Partial occupation at the Fermi level: ', st%smear%ef_occ
159 message(2) = 'Semiconducting smearing cannot be used for Sternheimer in this situation.'
160 call messages_fatal(2, namespace=namespace)
161 end if
162
163 if (wfs_are_cplx) then
164 call mix_init(this%mixer, namespace, space, gr%der, gr%np, st%d%nspin, func_type_= type_cmplx)
165 else
166 call mix_init(this%mixer, namespace, space, gr%der, gr%np, st%d%nspin, func_type_= type_float)
167 end if
168
169 if (present(set_occ_response)) then
170 this%occ_response = set_occ_response
171 else
172 this%occ_response = .false.
173 end if
174
175 this%occ_response_by_sternheimer = optional_default(occ_response_by_sternheimer, .false.)
176
177 !%Variable Preorthogonalization
178 !%Type logical
179 !%Section Linear Response::Sternheimer
180 !%Description
181 !% Whether initial linear-response wavefunctions should be orthogonalized
182 !% or not against the occupied states, at the start of each SCF cycle.
183 !% Default is true only if <tt>SmearingFunction = semiconducting</tt>,
184 !% or if the <tt>Occupations</tt> block specifies all full or empty states,
185 !% and we are not solving for linear response in the occupied subspace too.
186 !%End
187 default_preorthog = (st%smear%method == smear_semiconductor .or. &
188 (st%smear%method == smear_fixed_occ .and. st%smear%integral_occs)) &
189 .and. .not. this%occ_response
190 call parse_variable(namespace, 'Preorthogonalization', default_preorthog, this%preorthogonalization)
192 !%Variable HamiltonianVariation
193 !%Type integer
194 !%Default hartree+fxc
195 !%Section Linear Response::Sternheimer
196 !%Description
197 !% The terms to be considered in the variation of the
198 !% Hamiltonian. The external potential (V_ext) is always considered. The default is to include
199 !% also the exchange-correlation and Hartree terms, which fully
200 !% takes into account local fields.
201 !% Just <tt>hartree</tt> gives you the random-phase approximation (RPA).
202 !% If you want to choose the exchange-correlation kernel, use the variable
203 !% <tt>XCKernel</tt>. For <tt>kdotp</tt> and magnetic <tt>em_resp</tt> modes,
204 !% or if <tt>TheoryLevel = independent_particles</tt>,
205 !% the value <tt>V_ext_only</tt> is used and this variable is ignored.
206 !%Option V_ext_only 0
207 !% Neither Hartree nor XC potentials included.
208 !%Option hartree 1
209 !% The variation of the Hartree potential only.
210 !%Option fxc 2
211 !% The exchange-correlation kernel (the variation of the
212 !% exchange-correlation potential) only.
213 !%End
215 if (present(set_ham_var)) then
216 ham_var = set_ham_var
217 else if (hm%theory_level /= independent_particles) then
218 call parse_variable(namespace, 'HamiltonianVariation', 3, ham_var)
219 else
220 ham_var = 0
221 end if
222
223 if (hm%theory_level /= independent_particles) then
224 this%add_fxc = ((ham_var / 2) == 1)
225 this%add_hartree = (mod(ham_var, 2) == 1)
226 else
227 this%add_fxc = .false.
228 this%add_hartree = .false.
229 end if
230
231 if (present(set_last_occ_response)) then
232 this%last_occ_response = set_last_occ_response
233 else
234 this%last_occ_response = .false.
235 end if
236
237 message(1) = "Variation of the Hamiltonian in Sternheimer equation: V_ext"
238 if (this%add_hartree) write(message(1), '(2a)') trim(message(1)), ' + hartree'
239 if (this%add_fxc) write(message(1), '(2a)') trim(message(1)), ' + fxc'
240
241 message(2) = "Solving Sternheimer equation for"
242 if (this%occ_response) then
243 write(message(2), '(2a)') trim(message(2)), ' full linear response.'
244 else
245 write(message(2), '(2a)') trim(message(2)), ' linear response in unoccupied subspace only.'
246 end if
247
248 message(3) = "Sternheimer preorthogonalization:"
249 if (this%preorthogonalization) then
250 write(message(3), '(2a)') trim(message(3)), ' yes'
251 else
252 write(message(3), '(2a)') trim(message(3)), ' no'
253 end if
254 call messages_info(3, namespace=namespace)
255
256 call linear_solver_init(this%solver, namespace, gr, states_are_real(st), mc, space)
257
258 ! will not converge for non-self-consistent calculation unless LRTolScheme = fixed
259 if (ham_var == 0) then
260 call scf_tol_init(this%scf_tol, namespace, st%qtot, tol_scheme = 0) ! fixed
261 else
262 call scf_tol_init(this%scf_tol, namespace, st%qtot)
263 end if
264
265 this%lrc_alpha = xc%kernel_lrc_alpha
266
267 if (this%add_fxc) call sternheimer_build_fxc(this, namespace, gr, st, xc)
268
269
270 ! This variable is documented in xc_oep_init.
271 call parse_variable(namespace, 'EnablePhotons', .false., this%has_photons)
272 call messages_print_var_value('EnablePhotons', this%has_photons, namespace=namespace)
273
274 if (this%has_photons) then
275 call messages_experimental('EnablePhotons = yes', namespace=namespace)
276 call photon_mode_init(this%pt_modes, namespace, space%dim)
277 call photon_mode_set_n_electrons(this%pt_modes, m_zero)
278 call photon_mode_compute_dipoles(this%pt_modes, gr)
279 call io_mkdir(em_resp_photons_dir, namespace)
280 iunit = io_open(em_resp_photons_dir // 'photon_modes', namespace, action='write')
281 call photon_mode_write_info(this%pt_modes, iunit=iunit)
282 safe_allocate(this%zphoton_coord_q(1:this%pt_modes%nmodes, 1:space%dim))
283 end if
284
285 !%Variable PhotonEta
286 !%Type float
287 !%Default 0.0000367
288 !%Section Linear Response::Sternheimer
289 !%Description
290 !% This variable provides the value for the broadening of the photonic spectra
291 !% when the coupling of electrons to photons is enabled in the frequency-dependent Sternheimer equation
292 !%End
293 call parse_variable(namespace, 'PhotonEta', 0.0000367_real64, this%pt_eta, units_inp%energy)
294 call messages_print_var_value('PhotonEta', this%pt_eta, units_inp%energy, namespace=namespace)
295
296 if (family_is_mgga(xc%family)) then
297 message(1) = "Using MGGA in Sternheimer calculation."
298 call messages_fatal(1)
299 end if
300
301 pop_sub(sternheimer_init)
302 end subroutine sternheimer_init
303
304 !-----------------------------------------------------------
305 subroutine sternheimer_end(this)
306 type(sternheimer_t), intent(inout) :: this
307
308 push_sub(sternheimer_end)
309
310 safe_deallocate_a(this%zphoton_coord_q)
311
312 call linear_solver_end(this%solver)
313 call scf_tol_end(this%scf_tol)
314 call mix_end(this%mixer)
315
316 safe_deallocate_a(this%fxc)
317
318 pop_sub(sternheimer_end)
319 end subroutine sternheimer_end
320
321
322 !-----------------------------------------------------------
323 subroutine sternheimer_build_fxc(this, namespace, mesh, st, xc)
324 type(sternheimer_t), intent(inout) :: this
325 type(namespace_t), intent(in) :: namespace
326 class(mesh_t), intent(in) :: mesh
327 type(states_elec_t), intent(in) :: st
328 type(xc_t), intent(in) :: xc
329
330 real(real64), allocatable :: rho(:, :)
331
332 push_sub(sternheimer_build_fxc)
333
334 safe_allocate(this%fxc(1:mesh%np, 1:st%d%nspin, 1:st%d%nspin))
335 this%fxc = m_zero
336
337 safe_allocate(rho(1:mesh%np, 1:st%d%nspin))
338 call states_elec_total_density(st, mesh, rho)
339 call xc_get_fxc(xc, mesh, namespace, rho, st%d%ispin, this%fxc)
340 safe_deallocate_a(rho)
341
342 pop_sub(sternheimer_build_fxc)
343
344 end subroutine sternheimer_build_fxc
345
346
347 !-----------------------------------------------------------
348 subroutine sternheimer_build_kxc(this, namespace, mesh, st, xc)
349 type(sternheimer_t), intent(inout) :: this
350 type(namespace_t), intent(in) :: namespace
351 class(mesh_t), intent(in) :: mesh
352 type(states_elec_t), intent(in) :: st
353 type(xc_t), intent(in) :: xc
354
355 real(real64), allocatable :: rho(:, :)
356
357 push_sub(sternheimer_build_kxc)
358
359 if (this%add_fxc) then
360 safe_allocate(this%kxc(1:mesh%np, 1:st%d%nspin, 1:st%d%nspin, 1:st%d%nspin))
361 this%kxc = m_zero
362
363 safe_allocate(rho(1:mesh%np, 1:st%d%nspin))
364 call states_elec_total_density(st, mesh, rho)
365 call xc_get_kxc(xc, mesh, namespace, rho, st%d%ispin, this%kxc)
366 safe_deallocate_a(rho)
367 end if
368
369 pop_sub(sternheimer_build_kxc)
370
371 end subroutine sternheimer_build_kxc
372
373 !---------------------------------------------
374 subroutine sternheimer_unset_kxc(this)
375 type(sternheimer_t), intent(inout) :: this
376
377 push_sub(sternheimer_unset_kxc)
378
379 safe_deallocate_a(this%kxc)
380
381 pop_sub(sternheimer_unset_kxc)
382 end subroutine sternheimer_unset_kxc
383
384 !-----------------------------------------------------------
385 logical function sternheimer_add_fxc(this) result(rr)
386 type(sternheimer_t), intent(in) :: this
387 rr = this%add_fxc
388 end function sternheimer_add_fxc
389
390
391 !-----------------------------------------------------------
392 logical function sternheimer_add_hartree(this) result(rr)
393 type(sternheimer_t), intent(in) :: this
394 rr = this%add_hartree
395 end function sternheimer_add_hartree
396
397
398 !-----------------------------------------------------------
399 logical function sternheimer_has_converged(this) result(rr)
400 type(sternheimer_t), intent(in) :: this
401 rr = this%ok
402 end function sternheimer_has_converged
403
404 !-----------------------------------------------------------
405 logical pure function sternheimer_have_rhs(this) result(have)
406 type(sternheimer_t), intent(in) :: this
407 have = associated(this%drhs) .or. associated(this%zrhs)
408 end function sternheimer_have_rhs
409
410 !-----------------------------------------------------------
411 subroutine sternheimer_unset_rhs(this)
412 type(sternheimer_t), intent(inout) :: this
413
414 push_sub(sternheimer_unset_rhs)
415
416 nullify(this%drhs)
417 nullify(this%zrhs)
418
419 pop_sub(sternheimer_unset_rhs)
420 end subroutine sternheimer_unset_rhs
421
422 !-----------------------------------------------------------
423 logical pure function sternheimer_have_inhomog(this) result(have)
424 type(sternheimer_t), intent(in) :: this
425 have = associated(this%dinhomog) .or. associated(this%zinhomog)
426 end function sternheimer_have_inhomog
427
428 !-----------------------------------------------------------
429 subroutine sternheimer_unset_inhomog(this)
430 type(sternheimer_t), intent(inout) :: this
431
433
434 nullify(this%dinhomog)
435 nullify(this%zinhomog)
436
438 end subroutine sternheimer_unset_inhomog
439
440 !-----------------------------------------------------------
441 integer pure function swap_sigma(sigma)
442 integer, intent(in) :: sigma
443
444 if (sigma == 1) then
445 swap_sigma = 2
446 else
447 swap_sigma = 1
448 end if
449
450 end function swap_sigma
451
452! ---------------------------------------------------------
453 character(len=100) function wfs_tag_sigma(namespace, base_name, isigma) result(str)
454 type(namespace_t), intent(in) :: namespace
455 character(len=*), intent(in) :: base_name
456 integer, intent(in) :: isigma
457
458 character :: sigma_char
459
460 push_sub(wfs_tag_sigma)
461
462 select case (isigma)
463 case (1)
464 sigma_char = '+'
465 case (2)
466 sigma_char = '-'
467 case default
468 write(message(1),'(a,i2)') "Illegal integer isigma passed to wfs_tag_sigma: ", isigma
469 call messages_fatal(1, namespace=namespace)
470 end select
471
472 str = trim(base_name) // sigma_char
473
474 pop_sub(wfs_tag_sigma)
475
476 end function wfs_tag_sigma
477
478 ! --------------------------------------------------------
479
480 subroutine sternheimer_obsolete_variables(namespace, old_prefix, new_prefix)
481 type(namespace_t), intent(in) :: namespace
482 character(len=*), intent(in) :: old_prefix
483 character(len=*), intent(in) :: new_prefix
484
486
487 call messages_obsolete_variable(namespace, trim(old_prefix)//'Preorthogonalization', trim(new_prefix)//'Preorthogonalization')
488 call messages_obsolete_variable(namespace, trim(old_prefix)//'HamiltonianVariation', trim(new_prefix)//'HamiltonianVariation')
489
490 call linear_solver_obsolete_variables(namespace, old_prefix, new_prefix)
491 call scf_tol_obsolete_variables(namespace, old_prefix, new_prefix)
494 end subroutine sternheimer_obsolete_variables
495
496 !--------------------------------------------------------------
497 subroutine calc_hvar_photons(this, mesh, nspin, lr_rho, nsigma, hvar, idir)
498 type(sternheimer_t), intent(inout) :: this
499 class(mesh_t), intent(in) :: mesh
500 integer, intent(in) :: nspin
501 integer, intent(in) :: nsigma
502 complex(real64), intent(in) :: lr_rho(:,:)
503 complex(real64), intent(inout) :: hvar(:,:,:)
504 integer, optional, intent(in) :: idir
505
506 real(real64), allocatable :: lambda_dot_r(:)
507 complex(real64), allocatable :: s_lr_rho(:), vp_dip_self_ener(:), vp_bilinear_el_pt(:)
508 integer :: nm, is, ii
509 complex(real64) :: first_moments
510
511 push_sub(calc_hvar_photons)
512 call profiling_in('CALC_HVAR_PHOTONS')
513
514 nm = this%pt_modes%nmodes
515
516 ! photonic terms
517 safe_allocate(s_lr_rho(1:mesh%np))
518 safe_allocate(lambda_dot_r(1:mesh%np))
519 safe_allocate(vp_dip_self_ener(1:mesh%np))
520 safe_allocate(vp_bilinear_el_pt(1:mesh%np))
521
522 ! spin summed density
523 s_lr_rho = m_zero
524 do is = 1, nspin
525 s_lr_rho = s_lr_rho + lr_rho(:, is)
526 end do
527
528 ! Compute electron-photon potentials
529 vp_dip_self_ener = m_zero
530 vp_bilinear_el_pt = m_zero
531 do ii = 1, nm
532 lambda_dot_r(1:mesh%np) = this%pt_modes%lambda(ii)*this%pt_modes%pol_dipole(1:mesh%np, ii)
533 first_moments = zmf_integrate(mesh, lambda_dot_r(1:mesh%np)*s_lr_rho(1:mesh%np))
535 ! Compute photon displacement coordinate q_{\alpha}s
536 this%zphoton_coord_q(ii, idir) = (m_one/(m_two*(this%pt_modes%omega(ii))**2)) * &
537 ((m_one/(this%zomega - this%pt_modes%omega(ii) + m_zi*this%pt_eta)) - &
538 (m_one/(this%zomega + this%pt_modes%omega(ii) + m_zi*this%pt_eta))) * &
539 (-(this%pt_modes%omega(ii))**2)*first_moments
540
541 ! Compute potential for bilinear el-pt interaction
542 vp_bilinear_el_pt = vp_bilinear_el_pt - &
543 this%pt_modes%omega(ii)*lambda_dot_r(1:mesh%np)*this%zphoton_coord_q(ii, idir)
544
545 ! Compute potential with dipole-self energy term
546 vp_dip_self_ener = vp_dip_self_ener + first_moments*lambda_dot_r(1:mesh%np)
547 end do
548
549 hvar(1:mesh%np, 1, 1) = hvar(1:mesh%np, 1, 1) + vp_dip_self_ener(1:mesh%np) + vp_bilinear_el_pt(1:mesh%np)
550
551 safe_deallocate_a(s_lr_rho)
552 safe_deallocate_a(lambda_dot_r)
553 safe_deallocate_a(vp_dip_self_ener)
554 safe_deallocate_a(vp_bilinear_el_pt)
555
556 if (nsigma == 2) hvar(1:mesh%np, 1:nspin, 2) = conjg(hvar(1:mesh%np, 1:nspin, 1))
557
558 call profiling_out('CALC_HVAR_PHOTONS')
559 pop_sub(calc_hvar_photons)
560 end subroutine calc_hvar_photons
561
562
563#include "complex.F90"
564#include "sternheimer_inc.F90"
565
566#include "undef.F90"
567
568#include "real.F90"
569#include "sternheimer_inc.F90"
570
571end module sternheimer_oct_m
572
573!! Local Variables:
574!! mode: f90
575!! coding: utf-8
576!! End:
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
Definition: messages.F90:180
This module implements batches of mesh functions.
Definition: batch.F90:133
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:116
This module implements a calculator for the density and defines related functions.
Definition: density.F90:120
subroutine, public states_elec_total_density(st, mesh, total_rho)
This routine calculates the total electronic density.
Definition: density.F90:849
real(real64), parameter, public m_zero
Definition: global.F90:187
real(real64), parameter, public m_epsilon
Definition: global.F90:203
real(real64), parameter, public m_one
Definition: global.F90:188
This module implements the underlying real-space grid.
Definition: grid.F90:117
integer, parameter, public independent_particles
Definition: io.F90:114
subroutine, public io_mkdir(fname, namespace, parents)
Definition: io.F90:354
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:395
subroutine, public linear_solver_end(this)
subroutine, public linear_solver_init(this, namespace, gr, states_are_real, mc, space)
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:115
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:118
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
Definition: messages.F90:624
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:160
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:420
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1097
subroutine, public mix_init(smix, namespace, space, der, d1, d2, def_, func_type_, prefix_)
Initialise mix_t instance.
Definition: mix.F90:265
subroutine, public mix_end(smix)
Definition: mix.F90:522
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:145
subroutine, public photon_mode_compute_dipoles(this, mesh)
Computes the polarization dipole.
subroutine, public photon_mode_write_info(this, iunit, namespace)
subroutine, public photon_mode_set_n_electrons(this, qtot)
subroutine, public photon_mode_init(this, namespace, dim, photon_free)
subroutine, public scf_tol_init(this, namespace, qtot, def_maximumiter, tol_scheme)
Definition: scf_tol.F90:160
subroutine, public scf_tol_end(this)
Definition: scf_tol.F90:365
integer, parameter, public smear_semiconductor
Definition: smear.F90:171
integer, parameter, public smear_fixed_occ
Definition: smear.F90:171
pure logical function, public states_are_real(st)
This module handles reading and writing restart information for the states_elec_t.
subroutine, public zsternheimer_set_inhomog(this, inhomog)
subroutine, public zsternheimer_calc_hvar(this, namespace, mesh, hm, lr, nsigma, hvar, idir)
subroutine, public dsternheimer_solve(this, namespace, space, gr, kpoints, st, hm, mc, lr, nsigma, omega, perturbation, restart, rho_tag, wfs_tag, idir, have_restart_rho, have_exact_freq)
This routine calculates the first-order variations of the wavefunctions for an applied perturbation.
subroutine, public dsternheimer_calc_hvar(this, namespace, mesh, hm, lr, nsigma, hvar, idir)
integer pure function, public swap_sigma(sigma)
subroutine, public dcalc_kvar(this, mesh, st, lr_rho1, lr_rho2, nsigma, kvar)
logical function, public sternheimer_has_converged(this)
subroutine, public zsternheimer_set_rhs(this, rhs)
character(len=100) function, public wfs_tag_sigma(namespace, base_name, isigma)
subroutine calc_hvar_photons(this, mesh, nspin, lr_rho, nsigma, hvar, idir)
logical pure function, public sternheimer_have_rhs(this)
subroutine, public dsternheimer_solve_order2(sh1, sh2, sh_2ndorder, namespace, space, gr, kpoints, st, hm, mc, lr1, lr2, nsigma, omega1, omega2, pert1, pert2, lr_2ndorder, pert_2ndorder, restart, rho_tag, wfs_tag, have_restart_rho, have_exact_freq, give_pert1psi2, give_dl_eig1)
subroutine, public dsternheimer_set_rhs(this, rhs)
logical function, public sternheimer_add_fxc(this)
subroutine, public zsternheimer_solve_order2(sh1, sh2, sh_2ndorder, namespace, space, gr, kpoints, st, hm, mc, lr1, lr2, nsigma, omega1, omega2, pert1, pert2, lr_2ndorder, pert_2ndorder, restart, rho_tag, wfs_tag, have_restart_rho, have_exact_freq, give_pert1psi2, give_dl_eig1)
subroutine, public zcalc_hvar(namespace, add_hartree, mesh, hm, lrc_alpha, lr_rho, nsigma, hvar, fxc)
subroutine, public sternheimer_unset_kxc(this)
subroutine, public sternheimer_init(this, namespace, space, gr, st, hm, xc, mc, wfs_are_cplx, set_ham_var, set_occ_response, set_last_occ_response, occ_response_by_sternheimer)
subroutine, public zsternheimer_solve(this, namespace, space, gr, kpoints, st, hm, mc, lr, nsigma, omega, perturbation, restart, rho_tag, wfs_tag, idir, have_restart_rho, have_exact_freq)
This routine calculates the first-order variations of the wavefunctions for an applied perturbation.
subroutine sternheimer_build_fxc(this, namespace, mesh, st, xc)
subroutine, public sternheimer_unset_inhomog(this)
logical pure function, public sternheimer_have_inhomog(this)
subroutine, public zcalc_kvar(this, mesh, st, lr_rho1, lr_rho2, nsigma, kvar)
subroutine, public sternheimer_end(this)
subroutine, public sternheimer_obsolete_variables(namespace, old_prefix, new_prefix)
subroutine, public sternheimer_build_kxc(this, namespace, mesh, st, xc)
subroutine, public dcalc_hvar(namespace, add_hartree, mesh, hm, lrc_alpha, lr_rho, nsigma, hvar, fxc)
subroutine, public dsternheimer_set_inhomog(this, inhomog)
logical function, public sternheimer_add_hartree(this)
subroutine, public sternheimer_unset_rhs(this)
type(type_t), public type_float
Definition: types.F90:133
type(type_t), public type_cmplx
Definition: types.F90:134
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:132
This module defines the unit system, used for input and output.
type(unit_system_t), public units_inp
the units systems for reading and writing
Definition: xc.F90:114
subroutine, public xc_get_fxc(xcs, mesh, namespace, rho, ispin, fxc, zfxc)
Definition: xc.F90:1974
subroutine, public xc_get_kxc(xcs, mesh, namespace, rho, ispin, kxc)
Definition: xc.F90:2227
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:579
Describes mesh distribution to nodes.
Definition: mesh.F90:186
The states_elec_t class contains all electronic wave functions.