96 real(real64),
allocatable :: dchi(:,:,:,:)
97 complex(real64),
allocatable :: zchi(:,:,:,:)
98 type(wfs_elec_t),
allocatable :: chib(:)
111 type(states_elec_t),
public,
pointer :: st => null()
112 type(xc_cam_t) :: cam
113 type(poisson_t) :: psolver
114 type(singularity_t) :: singul
117 logical :: compute_single_precision = .false.
119 type(isdf_options_t) :: isdf
125 type(fourier_space_op_t) :: coulb
132 type(states_elec_t) :: st_single_shadow, xst_single_shadow
133 logical :: single_shadows_init = .false.
134 integer :: single_shadows_np = 0
136 real(real64),
parameter,
private :: TOL_EXX_WEIGHT = 1.0e-3_real64
141 subroutine ace_init(this, namespace, st)
142 class(ACE_t),
intent(inout) :: this
143 type(namespace_t),
intent(in) :: namespace
144 type(states_elec_t),
intent(in ) :: st
161 if (this%nst > st%nst)
then
165 if (this%nst < st%nst)
then
166 call messages_experimental(
"Adaptively-compressed exchange defined with a subset of states", namespace=namespace)
169 if (this%nst * st%smear%el_per_state < st%qtot)
then
170 write(
message(1),
'(a)')
"ACESize should at least equal the number of occupied states."
183 class(ACE_t),
intent(inout) :: this
190 safe_deallocate_a(this%dchi)
191 safe_deallocate_a(this%zchi)
193 if (
allocated(this%chib))
then
194 do ik = lbound(this%chib, 1), ubound(this%chib, 1)
195 call this%chib(ik)%end()
197 safe_deallocate_a(this%chib)
205 class(ACE_t),
intent(in) :: this
211 &
" approximately exact (ACESize)", this%nst, namespace=namespace)
270 call parse_variable(namespace,
'ExchangeSinglePrecision', .false., this%compute_single_precision)
283 call parse_variable(namespace,
'ACEWithISDF', .false., this%with_isdf)
285 if (this%with_isdf .and. .not. this%useACE)
then
287 '"ACEWithISDF = yes" must be used with "AdaptivelyCompressedExchange = yes"')
291 if (this%useACE)
then
292 call this%ace%init(namespace, st)
293 if (this%with_isdf)
call this%isdf%init(namespace, space, der%mesh, this%ace%nst)
300 call poisson_init(this%psolver, namespace, space, der, mc, stencil, st%qtot, &
302 fft_batch_size = st%block_size, single_precision = this%compute_single_precision)
312 if (this%compute_single_precision .and. &
315 "(needs AdaptivelyCompressedExchange = yes, ACEWithISDF = no and an FFT Poisson solver " // &
316 "with a batch-capable kernel)", namespace=namespace)
332 if (
present(st))
then
346 if (
associated(this%st) .and. .not. this%useACE)
then
349 safe_deallocate_p(this%st)
353 if (single_shadows_init)
then
356 single_shadows_init = .false.
357 single_shadows_np = 0
371 type(
mesh_t),
intent(in) :: mesh
378 call batch_scal(mesh%np, this%st%occ(:, hpsib%ik), hpsib)
391 if (this%useACE)
then
392 call this%ace%write_info(namespace)
393 if (this%with_isdf)
then
395 call this%isdf%write_info(namespace)
406#include "exchange_operator_inc.F90"
409#include "complex.F90"
410#include "exchange_operator_inc.F90"
415#include "exchange_operator_potentials_inc.F90"
418#include "complex.F90"
419#include "exchange_operator_potentials_inc.F90"
423#include "exchange_operator_potentials_inc.F90"
426#include "complex32.F90"
427#include "exchange_operator_potentials_inc.F90"
scale a batch by a constant or vector
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
This module contains interfaces for BLAS routines You should not use these routines directly....
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dexchange_operator_hartree_apply(this, namespace, mesh, st_d, kpoints, exx_coef, psib, hpsib)
subroutine, public dexchange_operator_ace(this, namespace, mesh, st, xst, phase)
Construct the ACE vectors.
subroutine ace_write_info(this, namespace)
subroutine ace_init(this, namespace, st)
Initialize an instance of ACE_t.
subroutine, public zexchange_operator_compute_potentials(this, namespace, space, gr, st, xst, kpoints, F_out)
subroutine, public zexchange_operator_commute_r(this, namespace, mesh, st_d, ik, psi, gpsi)
subroutine, public exchange_operator_init(this, namespace, space, st, der, mc, stencil, kpoints, cam)
subroutine, public exchange_operator_reinit(this, cam, st)
subroutine exchange_operator_write_info(this, namespace)
subroutine, public dexchange_operator_compute_potentials(this, namespace, space, gr, st, xst, kpoints, F_out)
subroutine, public zexchange_operator_single(this, namespace, space, mesh, st_d, kpoints, phase, ist, ik, psi, hpsi, rdmft, force_noace)
subroutine, public dexchange_operator_single(this, namespace, space, mesh, st_d, kpoints, phase, ist, ik, psi, hpsi, rdmft, force_noace)
subroutine ace_end(this)
End an instance of ACE_t.
subroutine, public dexchange_operator_commute_r(this, namespace, mesh, st_d, ik, psi, gpsi)
subroutine, public zexchange_operator_hartree_apply(this, namespace, mesh, st_d, kpoints, exx_coef, psib, hpsib)
subroutine, public exchange_operator_end(this)
subroutine, public zexchange_operator_apply(this, namespace, space, mesh, st_d, kpoints, phase, psib, hpsib, rdmft, force_noace)
subroutine, public dexchange_operator_apply(this, namespace, space, mesh, st_d, kpoints, phase, psib, hpsib, rdmft, force_noace)
subroutine, public zexchange_operator_ace(this, namespace, mesh, st, xst, phase)
Construct the ACE vectors.
real(real64) function, public dexchange_operator_compute_ex(mesh, st, xst)
Compute the exact exchange energy.
subroutine, public exchange_operator_rdmft_occ_apply(this, mesh, hpsib)
real(real64) function, public zexchange_operator_compute_ex(mesh, st, xst)
Compute the exact exchange energy.
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
integer, parameter, public fftlib_accel
This module implements the underlying real-space grid.
This module is intended to contain "only mathematical" functions and procedures.
This module defines functions over batches of mesh functions.
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
subroutine, public messages_not_implemented(feature, namespace)
character(len=512), private msg
subroutine, public messages_warning(no_lines, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
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.
Some general things and nomenclature:
subroutine, public poisson_init(this, namespace, space, der, mc, stencil, qtot, label, solver, verbose, force_serial, force_cmplx, fft_library, fft_batch_size, single_precision)
logical function, public poisson_is_batch_capable(this)
Whether this solver can transform a whole batch of functions in one call.
subroutine, public poisson_end(this)
This module is an helper to perform ring-pattern communications among all states.
subroutine, public singularity_end(this)
subroutine, public singularity_init(this, namespace, space, st, kpoints)
pure logical function, public states_are_real(st)
This module provides routines for communicating all batches in a ring-pattern scheme.
This module handles spin dimensions of the states and the k-point distribution.
subroutine, public states_elec_end(st)
finalize the states_elec_t object
This module provides routines for communicating states when using states parallelization.
subroutine, public states_elec_parallel_remote_access_stop(this)
stop remote memory access for states on other processors
This module defines stencils used in Octopus.
subroutine, public dsymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public zsymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public ssymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
subroutine, public csymmetrizer_apply_batch(this, mesh, iop, src, dst)
Symmetrize a whole batch, returning another batch with the same layout.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
class representing derivatives
Describes mesh distribution to nodes.
Stores all communicators and groups.
The states_elec_t class contains all electronic wave functions.
The class representing the stencil, which is used for non-local mesh operations.
batches of electronic states
Coulomb-attenuating method parameters, used in the partitioning of the Coulomb potential into a short...