33 use,
intrinsic :: iso_fortran_env
80 integer,
public,
parameter :: &
86 integer,
public,
parameter :: &
87 OEP_MIXING_SCHEME_CONST = 1, &
92 integer,
public,
parameter :: &
99 integer,
public :: level
100 real(real64) :: mixing
101 integer :: mixing_scheme
103 type(linear_solver_t) :: solver
104 type(scf_tol_t) :: scftol
106 integer,
allocatable :: eigen_type(:), eigen_index(:)
107 real(real64) :: socc, sfact
108 real(real64),
allocatable,
public :: vxc(:,:), uxc_bar(:,:,:)
109 real(real64),
allocatable :: dlxc(:, :, :, :)
110 complex(real64),
allocatable :: zlxc(:, :, :, :)
111 real(real64),
public :: norm2ss
112 real(real64),
allocatable :: vxc_old(:,:), ss_old(:,:)
116 logical :: scdm_for_pzsic
118 integer,
public ::
type = -1
124 subroutine xc_oep_init(oep, namespace, gr, st, mc, space, oep_type)
125 type(xc_oep_t),
intent(inout) :: oep
126 type(namespace_t),
intent(in) :: namespace
127 type(grid_t),
intent(inout) :: gr
128 type(states_elec_t),
intent(in) :: st
129 type(multicomm_t),
intent(in) :: mc
130 class(space_t),
intent(in) :: space
131 integer,
intent(in) :: oep_type
157 if (oep%level == oep_level_none)
then
166 if (st%d%nspin ==
spinors)
then
200 call parse_variable(namespace,
'OEPMixingScheme', oep_mixing_scheme_const, oep%mixing_scheme)
203 safe_allocate(oep%vxc_old(1:gr%np,st%d%ispin))
204 safe_allocate(oep%ss_old(1:gr%np,st%d%ispin))
217 safe_allocate(oep%vxc(1:gr%np,st%d%nspin))
219 safe_allocate(oep%vxc(1:gr%np,1:min(st%d%nspin, 2)))
225 call scf_tol_init(oep%scftol, namespace, st%qtot, def_maximumiter=10)
239 call parse_variable(namespace,
'SCDMforPZSIC', .false., oep%scdm_for_pzsic)
240 if (oep%scdm_for_pzsic)
call scdm_init(oep%scdm, namespace)
246 if (st%d%nspin ==
spinors)
then
254 if (st%d%kpt%parallel .and. oep%type ==
oep_type_sic)
then
264 class(
xc_oep_t),
intent(inout) :: oep
268 if (oep%level /= oep_level_none)
then
269 safe_deallocate_a(oep%vxc)
275 safe_deallocate_a(oep%vxc_old)
276 safe_deallocate_a(oep%ss_old)
287 integer,
optional,
intent(in) :: iunit
288 type(
namespace_t),
optional,
intent(in) :: namespace
290 if (oep%level == oep_level_none)
return
304 class(
xc_oep_t),
intent(inout) :: oep
305 integer,
intent(in) :: nspin
326 class(
xc_oep_t),
intent(inout) :: oep
328 integer,
intent(in) :: is
331 real(real64) :: max_eigen
343 max_eigen = minval(st%eigenval(:, is))
345 if ((st%occ(ist, is) >
m_min_occ).and.(st%eigenval(ist, is) > max_eigen))
then
346 max_eigen = st%eigenval(ist, is)
352 if (abs(st%eigenval(ist, is)-max_eigen) <= 1e-3_real64)
then
353 oep%eigen_type(ist) = 2
356 oep%eigen_type(ist) = 1
357 oep%eigen_index(oep%eigen_n+1) = ist
358 oep%eigen_n = oep%eigen_n + 1
360 oep%eigen_type(ist) = 0
367 if (st%occ(ist, is) >
m_min_occ) oep%noccst = ist
371 assert(all(oep%eigen_type >= 0))
377#include "xc_kli_pauli_inc.F90"
378#include "xc_oep_sic_pauli_inc.F90"
382#include "xc_kli_inc.F90"
383#include "xc_oep_sic_inc.F90"
384#include "xc_oep_inc.F90"
387#include "complex.F90"
388#include "xc_kli_inc.F90"
389#include "xc_oep_sic_inc.F90"
390#include "xc_oep_inc.F90"
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
integer, parameter, public spinors
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_half
real(real64), parameter, public m_one
real(real64), parameter, public m_min_occ
Minimal occupation that is considered to be non-zero.
This module implements the underlying real-space grid.
subroutine, public lr_init(lr)
subroutine, public lr_dealloc(lr)
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.
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_obsolete_variable(namespace, name, rep)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
This module handles the communicators for the various parallelization strategies.
This module provides routines for perform the Selected Column of Density Matrix (SCDM) method This fo...
subroutine, public scdm_init(this, namespace)
subroutine, public scf_tol_init(this, namespace, qtot, def_maximumiter, tol_scheme)
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.
integer, parameter, public oep_type_mgga
subroutine, public xc_oep_spinfactor(oep, nspin)
A couple of auxiliary functions for oep.
subroutine, public xc_oep_end(oep)
subroutine, public zxc_oep_calc(oep, namespace, xcs, gr, hm, st, space, rcell_volume, ex, ec, vxc)
This file handles the evaluation of the OEP potential, in the KLI or full OEP as described in S....
integer, parameter, public oep_type_photons
subroutine, public xc_oep_analyzeeigen(oep, st, is)
integer, parameter, public oep_mixing_scheme_dens
subroutine, public dxc_oep_calc(oep, namespace, xcs, gr, hm, st, space, rcell_volume, ex, ec, vxc)
This file handles the evaluation of the OEP potential, in the KLI or full OEP as described in S....
integer, parameter, public oep_mixing_scheme_bb
subroutine, public xc_oep_write_info(oep, iunit, namespace)
subroutine, public dxc_oep_mix(oep, mesh, ss, rho, is)
A routine that takes care of mixing the potential.
integer, parameter, public oep_level_full
subroutine, public xc_oep_init(oep, namespace, gr, st, mc, space, oep_type)
subroutine, public zxc_oep_mix(oep, mesh, ss, rho, is)
A routine that takes care of mixing the potential.
integer, parameter, public oep_type_sic
integer, parameter, public oep_level_kli
The states_elec_t class contains all electronic wave functions.