33 use,
intrinsic :: iso_fortran_env
78 integer,
public,
parameter :: &
84 integer,
public,
parameter :: &
85 OEP_MIXING_SCHEME_CONST = 1, &
90 integer,
public,
parameter :: &
97 integer,
public :: level
98 real(real64) :: mixing
99 integer :: mixing_scheme
101 type(linear_solver_t) :: solver
102 type(scf_tol_t) :: scftol
104 integer,
allocatable :: eigen_type(:), eigen_index(:)
105 real(real64) :: socc, sfact
106 real(real64),
allocatable,
public :: vxc(:,:), uxc_bar(:,:,:)
107 real(real64),
allocatable :: dlxc(:, :, :, :)
108 complex(real64),
allocatable :: zlxc(:, :, :, :)
109 real(real64),
public :: norm2ss
110 real(real64),
allocatable :: vxc_old(:,:), ss_old(:,:)
114 logical :: scdm_for_pzsic
116 integer,
public ::
type = -1
122 subroutine xc_oep_init(oep, namespace, gr, st, mc, space, oep_type)
123 type(xc_oep_t),
intent(inout) :: oep
124 type(namespace_t),
intent(in) :: namespace
125 type(grid_t),
intent(inout) :: gr
126 type(states_elec_t),
intent(in) :: st
127 type(multicomm_t),
intent(in) :: mc
128 class(space_t),
intent(in) :: space
129 integer,
intent(in) :: oep_type
155 if (oep%level == oep_level_none)
then
164 if (st%d%ispin ==
spinors)
then
198 call parse_variable(namespace,
'OEPMixingScheme', oep_mixing_scheme_const, oep%mixing_scheme)
201 safe_allocate(oep%vxc_old(1:gr%np,st%d%ispin))
202 safe_allocate(oep%ss_old(1:gr%np,st%d%ispin))
215 safe_allocate(oep%vxc(1:gr%np,st%d%nspin))
217 safe_allocate(oep%vxc(1:gr%np,1:min(st%d%nspin, 2)))
223 call scf_tol_init(oep%scftol, namespace, st%qtot, def_maximumiter=10)
237 call parse_variable(namespace,
'SCDMforPZSIC', .false., oep%scdm_for_pzsic)
238 if (oep%scdm_for_pzsic)
call scdm_init(oep%scdm, namespace)
244 if (st%d%nspin ==
spinors)
then
252 if (st%d%kpt%parallel .and. oep%type ==
oep_type_sic)
then
262 class(
xc_oep_t),
intent(inout) :: oep
266 if (oep%level /= oep_level_none)
then
267 safe_deallocate_a(oep%vxc)
273 safe_deallocate_a(oep%vxc_old)
274 safe_deallocate_a(oep%ss_old)
285 integer,
optional,
intent(in) :: iunit
286 type(
namespace_t),
optional,
intent(in) :: namespace
288 if (oep%level == oep_level_none)
return
302 class(
xc_oep_t),
intent(inout) :: oep
303 integer,
intent(in) :: nspin
324 class(
xc_oep_t),
intent(inout) :: oep
326 integer,
intent(in) :: is
329 real(real64) :: max_eigen
341 max_eigen = minval(st%eigenval(:, is))
343 if ((st%occ(ist, is) >
m_min_occ).and.(st%eigenval(ist, is) > max_eigen))
then
344 max_eigen = st%eigenval(ist, is)
350 if (abs(st%eigenval(ist, is)-max_eigen) <= 1e-3_real64)
then
351 oep%eigen_type(ist) = 2
354 oep%eigen_type(ist) = 1
355 oep%eigen_index(oep%eigen_n+1) = ist
356 oep%eigen_n = oep%eigen_n + 1
358 oep%eigen_type(ist) = 0
365 if (st%occ(ist, is) >
m_min_occ) oep%noccst = oep%noccst + 1
369 assert(all(oep%eigen_type >= 0))
375#include "xc_kli_pauli_inc.F90"
376#include "xc_oep_sic_pauli_inc.F90"
380#include "xc_kli_inc.F90"
381#include "xc_oep_sic_inc.F90"
382#include "xc_oep_inc.F90"
385#include "complex.F90"
386#include "xc_kli_inc.F90"
387#include "xc_oep_sic_inc.F90"
388#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.