![]() |
Octopus
|
Data Types | |
| type | hamiltonian_elec_t |
Functions/Subroutines | |
| subroutine, public | hamiltonian_elec_init (hm, namespace, space, gr, ions, ext_partners, st, theory_level, xc, mc, kpoints, need_exchange, xc_photons) |
| subroutine, public | hamiltonian_elec_end (hm) |
| subroutine | hamiltonian_elec_release_copy_owned (hm) |
| Release owned pointer targets created by hamiltonian_elec_copy. More... | |
| subroutine, public | hamiltonian_elec_copy (hm_out, hm_in) |
| Deep-copy a hamiltonian_elec_t snapshot. More... | |
| subroutine | hamiltonian_elec_copy_guard_supported (hm_in) |
| Hard-fail guard matrix for unsupported hamiltonian snapshots. More... | |
| logical function | hamiltonian_elec_hermitian (hm) |
| pure logical function | hamiltonian_elec_needs_mgga_term (hm, terms) |
| subroutine | hamiltonian_elec_span (hm, delta, emin, namespace) |
| pure logical function, public | hamiltonian_elec_inh_term (hm) |
| subroutine, public | hamiltonian_elec_set_inh (hm, st) |
| subroutine, public | hamiltonian_elec_remove_inh (hm) |
| subroutine, public | hamiltonian_elec_adjoint (hm) |
| subroutine, public | hamiltonian_elec_not_adjoint (hm) |
| subroutine | hamiltonian_elec_update (this, mesh, namespace, space, ext_partners, time) |
| (re-)build the Hamiltonian for the next application: More... | |
| subroutine, public | hamiltonian_elec_update_pot (this, mesh, accumulate) |
| Update the KS potential of the electronic Hamiltonian. More... | |
| subroutine, public | hamiltonian_elec_xc_nhat (this, mesh, nhat) |
| PAW with the Bloechl compensation scheme (usexcnhat = false): the compensation charge n^hat_s(r) = sum_ij rho^s_ij Qhat_ij(r) of each spin channel s, on the mesh. It is included in the density, and must be removed from the XC density (xc_get_vxc). nhat is only allocated for this scheme, and is zero until the one-center density matrix has been computed. More... | |
| subroutine, public | hamiltonian_elec_epot_generate (this, namespace, space, gr, ions, ext_partners, st, time) |
| real(real64) function, public | hamiltonian_elec_get_time (this) |
| pure logical function, public | hamiltonian_elec_apply_packed (this) |
| subroutine, public | zhamiltonian_elec_apply_atom (hm, namespace, space, latt, species, pos, ia, mesh, psi, vpsi) |
| subroutine, public | hamiltonian_elec_update_with_ext_pot (this, mesh, space, ext_partners, time, mu) |
| This is an extension of "hamiltonian_elec_update_pot" to be used by the CFM4 propagator. It updates the Hamiltonian by considering a weighted sum of the external potentials at times time(1) and time(2), weighted by alpha(1) and alpha(2). More... | |
| subroutine | hamiltonian_elec_build_projector_phases (this, nlpp, async) |
| Build the projector phases for a given nonlocal-pseudopotential set. More... | |
| logical function, public | hamiltonian_elec_needs_current (hm, states_are_real) |
| subroutine, public | zhamiltonian_elec_apply_all (hm, namespace, gr, st, hst) |
| logical function, public | hamiltonian_elec_has_kick (hm) |
| subroutine | hamiltonian_elec_set_mass (this, namespace, mass) |
| set the effective electron mass, checking whether it was previously redefined. More... | |
| subroutine, public | hamiltonian_elec_diagonal (hm, mesh, diag, ik) |
| subroutine | dhamiltonian_elec_apply (hm, namespace, mesh, psib, hpsib, terms, set_bc) |
| subroutine, public | dhamiltonian_elec_apply_batch (hm, namespace, mesh, psib, hpsib, terms, set_bc, set_phase, spsib) |
| subroutine, public | dhamiltonian_elec_apply_overlap_batch (hm, namespace, mesh, psib, spsib, set_bc, inverse, set_phase) |
| Apply the generalized ultrasoft overlap operator S (or its inverse) to a batch. More... | |
| subroutine, public | dhamiltonian_elec_apply_sinvh_batch (hm, namespace, mesh, psib, hspsib, terms, set_bc, set_phase) |
| Apply the operator A = S^{-1} H to a batch (for ultrasoft/PAW). More... | |
| subroutine | dhamiltonian_elec_external (this, mesh, psib, vpsib) |
| subroutine, public | dhamiltonian_elec_apply_single (hm, namespace, mesh, psi, hpsi, ist, ik, terms, set_bc, set_phase) |
| subroutine, public | dhamiltonian_elec_apply_sinvh_single (hm, namespace, mesh, psi, hspsi, ist, ik, terms, set_bc, set_phase) |
| Apply A = S^{-1} H to a single state (wrapper around the batch routine). More... | |
| subroutine, public | dhamiltonian_elec_apply_overlap_single (hm, namespace, mesh, psi, spsi, ist, ik, set_bc, set_phase, inverse) |
| Apply the overlap S (or its inverse) to a single state (wrapper around the batch routine). More... | |
| subroutine | dh_mgga_terms (hm, mesh, psib, hpsib, lapl_psib) |
| Computes the orbital-dependent part of the mGGA potential. More... | |
| subroutine, public | dvmask (mesh, hm, st) |
| subroutine | zhamiltonian_elec_apply (hm, namespace, mesh, psib, hpsib, terms, set_bc) |
| subroutine, public | zhamiltonian_elec_apply_batch (hm, namespace, mesh, psib, hpsib, terms, set_bc, set_phase, spsib) |
| subroutine, public | zhamiltonian_elec_apply_overlap_batch (hm, namespace, mesh, psib, spsib, set_bc, inverse, set_phase) |
| Apply the generalized ultrasoft overlap operator S (or its inverse) to a batch. More... | |
| subroutine, public | zhamiltonian_elec_apply_sinvh_batch (hm, namespace, mesh, psib, hspsib, terms, set_bc, set_phase) |
| Apply the operator A = S^{-1} H to a batch (for ultrasoft/PAW). More... | |
| subroutine, public | zhamiltonian_elec_external (this, mesh, psib, vpsib) |
| subroutine, public | zhamiltonian_elec_apply_single (hm, namespace, mesh, psi, hpsi, ist, ik, terms, set_bc, set_phase) |
| subroutine, public | zhamiltonian_elec_apply_sinvh_single (hm, namespace, mesh, psi, hspsi, ist, ik, terms, set_bc, set_phase) |
| Apply A = S^{-1} H to a single state (wrapper around the batch routine). More... | |
| subroutine, public | zhamiltonian_elec_apply_overlap_single (hm, namespace, mesh, psi, spsi, ist, ik, set_bc, set_phase, inverse) |
| Apply the overlap S (or its inverse) to a single state (wrapper around the batch routine). More... | |
| subroutine | zh_mgga_terms (hm, mesh, psib, hpsib, lapl_psib) |
| Computes the orbital-dependent part of the mGGA potential. More... | |
| subroutine, public | zvmask (mesh, hm, st) |
Variables | |
| integer, parameter, public | length = 1 |
| integer, parameter, public | velocity = 2 |
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_init | ( | type(hamiltonian_elec_t), intent(inout), target | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(space_t), intent(in) | space, | ||
| type(grid_t), intent(inout), target | gr, | ||
| type(ions_t), intent(inout), target | ions, | ||
| type(partner_list_t), intent(inout) | ext_partners, | ||
| type(states_elec_t), intent(inout), target | st, | ||
| integer, intent(in) | theory_level, | ||
| type(xc_t), intent(in), target | xc, | ||
| type(multicomm_t), intent(in) | mc, | ||
| type(kpoints_t), intent(in), target | kpoints, | ||
| logical, intent(in), optional | need_exchange, | ||
| type(xc_photons_t), intent(in), optional, target | xc_photons | ||
| ) |
Definition at line 316 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_end | ( | type(hamiltonian_elec_t), intent(inout), target | hm | ) |
Definition at line 803 of file hamiltonian_elec.F90.
|
private |
Release owned pointer targets created by hamiltonian_elec_copy.
This avoids running the full hamiltonian finalizer on shallow-alias snapshots.
Definition at line 911 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_copy | ( | type(hamiltonian_elec_t), intent(out), target | hm_out, |
| type(hamiltonian_elec_t), intent(inout) | hm_in | ||
| ) |
Deep-copy a hamiltonian_elec_t snapshot.
Pointer semantics:
ions is cloned and owned by the copy.der, xc, xc_photons, kpoints) are aliased.zora is cloned when present. Definition at line 962 of file hamiltonian_elec.F90.
|
private |
Hard-fail guard matrix for unsupported hamiltonian snapshots.
Definition at line 1092 of file hamiltonian_elec.F90.
|
private |
Definition at line 1133 of file hamiltonian_elec.F90.
|
private |
Definition at line 1145 of file hamiltonian_elec.F90.
|
private |
Definition at line 1166 of file hamiltonian_elec.F90.
| pure logical function, public hamiltonian_elec_oct_m::hamiltonian_elec_inh_term | ( | type(hamiltonian_elec_t), intent(in) | hm | ) |
Definition at line 1188 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_set_inh | ( | type(hamiltonian_elec_t), intent(inout) | hm, |
| type(states_elec_t), intent(in) | st | ||
| ) |
Definition at line 1196 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_remove_inh | ( | type(hamiltonian_elec_t), intent(inout) | hm | ) |
Definition at line 1211 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_adjoint | ( | type(hamiltonian_elec_t), intent(inout) | hm | ) |
Definition at line 1225 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_not_adjoint | ( | type(hamiltonian_elec_t), intent(inout) | hm | ) |
Definition at line 1242 of file hamiltonian_elec.F90.
|
private |
(re-)build the Hamiltonian for the next application:
Definition at line 1260 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_update_pot | ( | type(hamiltonian_elec_t), intent(inout) | this, |
| class(mesh_t), intent(in) | mesh, | ||
| logical, intent(in), optional | accumulate | ||
| ) |
Update the KS potential of the electronic Hamiltonian.
Adds PCM contributions
Adds possible absorbing potential
Definition at line 1461 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_xc_nhat | ( | type(hamiltonian_elec_t), intent(in) | this, |
| class(mesh_t), intent(in) | mesh, | ||
| real(real64), dimension(:,:), intent(inout), allocatable | nhat | ||
| ) |
PAW with the Bloechl compensation scheme (usexcnhat = false): the compensation charge n^hat_s(r) = sum_ij rho^s_ij Qhat_ij(r) of each spin channel s, on the mesh. It is included in the density, and must be removed from the XC density (xc_get_vxc). nhat is only allocated for this scheme, and is zero until the one-center density matrix has been computed.
| [in,out] | nhat | (np_part, spin_channels) |
Definition at line 1606 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_epot_generate | ( | type(hamiltonian_elec_t), intent(inout), target | this, |
| type(namespace_t), intent(in) | namespace, | ||
| class(electron_space_t), intent(in) | space, | ||
| type(grid_t), intent(in) | gr, | ||
| type(ions_t), intent(inout), target | ions, | ||
| type(partner_list_t), intent(in) | ext_partners, | ||
| type(states_elec_t), intent(inout) | st, | ||
| real(real64), intent(in), optional | time | ||
| ) |
Generates the real-space PCM potential due to nuclei which do not change during the SCF calculation.
Local field effects due to static electrostatic potentials (if they were). The laser and the kick are included in subroutine v_ks_hartree (module v_ks).
Definition at line 1632 of file hamiltonian_elec.F90.
| real(real64) function, public hamiltonian_elec_oct_m::hamiltonian_elec_get_time | ( | type(hamiltonian_elec_t), intent(inout) | this | ) |
Definition at line 1749 of file hamiltonian_elec.F90.
| pure logical function, public hamiltonian_elec_oct_m::hamiltonian_elec_apply_packed | ( | class(hamiltonian_elec_t), intent(in) | this | ) |
Definition at line 1757 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_atom | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(space_t), intent(in) | space, | ||
| type(lattice_vectors_t), intent(in) | latt, | ||
| class(species_t), intent(in) | species, | ||
| real(real64), dimension(1:space%dim), intent(in) | pos, | ||
| integer, intent(in) | ia, | ||
| class(mesh_t), intent(in) | mesh, | ||
| complex(real64), dimension(:,:), intent(in), contiguous | psi, | ||
| complex(real64), dimension(:,:), intent(out), contiguous | vpsi | ||
| ) |
| [in] | psi | (grnp_part, hmddim) |
| [out] | vpsi | (grnp, hmddim) |
Definition at line 1766 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_update_with_ext_pot | ( | type(hamiltonian_elec_t), intent(inout) | this, |
| class(mesh_t), intent(in) | mesh, | ||
| class(space_t), intent(in) | space, | ||
| type(partner_list_t), intent(in) | ext_partners, | ||
| real(real64), dimension(1:2), intent(in) | time, | ||
| real(real64), dimension(1:2), intent(in) | mu | ||
| ) |
This is an extension of "hamiltonian_elec_update_pot" to be used by the CFM4 propagator. It updates the Hamiltonian by considering a weighted sum of the external potentials at times time(1) and time(2), weighted by alpha(1) and alpha(2).
Definition at line 1804 of file hamiltonian_elec.F90.
|
private |
Build the projector phases for a given nonlocal-pseudopotential set.
Used for both the standard nonlocal potential (vnl) and, for ultrasoft/PAW, the generalized overlap operator (aug_overlap), which both project onto the same beta functions and therefore share the per-atom phase factors.
Definition at line 1977 of file hamiltonian_elec.F90.
| logical function, public hamiltonian_elec_oct_m::hamiltonian_elec_needs_current | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| logical, intent(in) | states_are_real | ||
| ) |
Definition at line 2030 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_all | ( | type(hamiltonian_elec_t), intent(inout) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| type(grid_t), intent(in) | gr, | ||
| type(states_elec_t), intent(inout) | st, | ||
| type(states_elec_t), intent(inout) | hst | ||
| ) |
Definition at line 2048 of file hamiltonian_elec.F90.
| logical function, public hamiltonian_elec_oct_m::hamiltonian_elec_has_kick | ( | type(hamiltonian_elec_t), intent(in) | hm | ) |
Definition at line 2095 of file hamiltonian_elec.F90.
|
private |
set the effective electron mass, checking whether it was previously redefined.
Definition at line 2107 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::hamiltonian_elec_diagonal | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| class(mesh_t), intent(in) | mesh, | ||
| real(real64), dimension(:,:), intent(out), contiguous | diag, | ||
| integer, intent(in) | ik | ||
| ) |
| [out] | diag | hpsi(grmeshnp, hmdnspin) |
Definition at line 2125 of file hamiltonian_elec.F90.
|
private |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
Definition at line 2245 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout), target | psib, | ||
| type(wfs_elec_t), intent(inout), target | hpsib, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase, | ||
| type(wfs_elec_t), intent(inout), optional | spsib | ||
| ) |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
| [in] | set_phase | override of whether to apply the phase (default: .not. psibhas_phase) |
| [in,out] | spsib | if present (generalized overlap only), also return S|psib>, reusing the V_NL projections <beta|psi>: the fused H+S apply costs one projection pass instead of two. On GPUs, S is applied separately. |
Definition at line 2274 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_overlap_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout), target | psib, | ||
| type(wfs_elec_t), intent(inout), optional, target | spsib, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | inverse, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply the generalized ultrasoft overlap operator S (or its inverse) to a batch.
With spsib present the result is written there (spsib = S psib, the identity part copied first); WITHOUT spsib the overlap is applied IN PLACE (psib := S psib), which saves the identity copy and lets the caller skip a scratch batch when the input is not needed afterwards (e.g. S^{-1} on H|psi> inside SinvH). If the Hamiltonian does not require a generalized overlap, this reduces to a plain copy (or a no-op in place). With inverse=.true. the operator applied is S^{-1} instead of S.
| [in,out] | spsib | result S psib; when absent, in place |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
| [in] | inverse | If .true., apply S^{-1} instead of S. |
| [in] | set_phase | override of whether to apply the phase (default: .not. psibhas_phase) |
Definition at line 2538 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_sinvh_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout) | psib, | ||
| type(wfs_elec_t), intent(inout) | hspsib, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply the operator A = S^{-1} H to a batch (for ultrasoft/PAW).
This is the operator whose lowest eigenpairs are the generalized eigenpairs of (H, S). It is the operator that the Chebyshev filter must act with: filtering H alone targets the wrong subspace when S deviates from the identity. When the Hamiltonian does not require a generalized overlap, S^{-1} = 1 and this reduces to applying H.
| [in,out] | psib | input batch |
| [in,out] | hspsib | result = S^{-1} H psib |
Definition at line 2620 of file hamiltonian_elec.F90.
|
private |
Definition at line 2648 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | hpsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
| [in] | ist | the index of the state |
| [in] | ik | the index of the k-point |
| [in,out] | psi | (grmeshnp_part, hmddim) |
| [in,out] | hpsi | (grmeshnp, hmddim) |
Definition at line 2697 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_sinvh_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | hspsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply A = S^{-1} H to a single state (wrapper around the batch routine).
| [in,out] | psi | (meshnp_part, hmddim) |
| [in,out] | hspsi | (meshnp, hmddim) |
Definition at line 2732 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dhamiltonian_elec_apply_overlap_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| real(real64), dimension(:,:), intent(inout), target, contiguous | spsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase, | ||
| logical, intent(in), optional | inverse | ||
| ) |
Apply the overlap S (or its inverse) to a single state (wrapper around the batch routine).
| [in,out] | psi | (meshnp_part, hmddim) |
| [in,out] | spsi | (meshnp, hmddim) |
Definition at line 2766 of file hamiltonian_elec.F90.
|
private |
Computes the orbital-dependent part of the mGGA potential.
This reads as \( L\psi =-\nabla \cdot [\vtau \nabla \psi]\).
It is trivial to show that this operator is self-adjoint. However, this is never the case with finite differences. This is thus reimplemented as L\psi = -1/2(v_\tau \Delta \psi - \psi \Delta[v_\tau] + \Delta [v_\tau \psi]
The same expression was proposed in Richter et al., J. Chem. Phys. 159, 124117 (2023).
Definition at line 2810 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::dvmask | ( | class(mesh_t), intent(in) | mesh, |
| type(hamiltonian_elec_t), intent(in) | hm, | ||
| type(states_elec_t), intent(inout) | st | ||
| ) |
Definition at line 2860 of file hamiltonian_elec.F90.
|
private |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
Definition at line 2968 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout), target | psib, | ||
| type(wfs_elec_t), intent(inout), target | hpsib, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase, | ||
| type(wfs_elec_t), intent(inout), optional | spsib | ||
| ) |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
| [in] | set_phase | override of whether to apply the phase (default: .not. psibhas_phase) |
| [in,out] | spsib | if present (generalized overlap only), also return S|psib>, reusing the V_NL projections <beta|psi>: the fused H+S apply costs one projection pass instead of two. On GPUs, S is applied separately. |
Definition at line 2997 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_overlap_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout), target | psib, | ||
| type(wfs_elec_t), intent(inout), optional, target | spsib, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | inverse, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply the generalized ultrasoft overlap operator S (or its inverse) to a batch.
With spsib present the result is written there (spsib = S psib, the identity part copied first); WITHOUT spsib the overlap is applied IN PLACE (psib := S psib), which saves the identity copy and lets the caller skip a scratch batch when the input is not needed afterwards (e.g. S^{-1} on H|psi> inside SinvH). If the Hamiltonian does not require a generalized overlap, this reduces to a plain copy (or a no-op in place). With inverse=.true. the operator applied is S^{-1} instead of S.
| [in,out] | spsib | result S psib; when absent, in place |
| [in] | set_bc | If set to .false. the boundary conditions are assumed to be set previously. |
| [in] | inverse | If .true., apply S^{-1} instead of S. |
| [in] | set_phase | override of whether to apply the phase (default: .not. psibhas_phase) |
Definition at line 3261 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_sinvh_batch | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(inout) | psib, | ||
| type(wfs_elec_t), intent(inout) | hspsib, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply the operator A = S^{-1} H to a batch (for ultrasoft/PAW).
This is the operator whose lowest eigenpairs are the generalized eigenpairs of (H, S). It is the operator that the Chebyshev filter must act with: filtering H alone targets the wrong subspace when S deviates from the identity. When the Hamiltonian does not require a generalized overlap, S^{-1} = 1 and this reduces to applying H.
| [in,out] | psib | input batch |
| [in,out] | hspsib | result = S^{-1} H psib |
Definition at line 3343 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_external | ( | type(hamiltonian_elec_t), intent(in) | this, |
| class(mesh_t), intent(in) | mesh, | ||
| type(wfs_elec_t), intent(in) | psib, | ||
| type(wfs_elec_t), intent(inout) | vpsib | ||
| ) |
Definition at line 3371 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | hpsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
| [in] | ist | the index of the state |
| [in] | ik | the index of the k-point |
| [in,out] | psi | (grmeshnp_part, hmddim) |
| [in,out] | hpsi | (grmeshnp, hmddim) |
Definition at line 3420 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_sinvh_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | hspsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| integer, intent(in), optional | terms, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase | ||
| ) |
Apply A = S^{-1} H to a single state (wrapper around the batch routine).
| [in,out] | psi | (meshnp_part, hmddim) |
| [in,out] | hspsi | (meshnp, hmddim) |
Definition at line 3455 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zhamiltonian_elec_apply_overlap_single | ( | type(hamiltonian_elec_t), intent(in) | hm, |
| type(namespace_t), intent(in) | namespace, | ||
| class(mesh_t), intent(in) | mesh, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | psi, | ||
| complex(real64), dimension(:,:), intent(inout), target, contiguous | spsi, | ||
| integer, intent(in) | ist, | ||
| integer, intent(in) | ik, | ||
| logical, intent(in), optional | set_bc, | ||
| logical, intent(in), optional | set_phase, | ||
| logical, intent(in), optional | inverse | ||
| ) |
Apply the overlap S (or its inverse) to a single state (wrapper around the batch routine).
| [in,out] | psi | (meshnp_part, hmddim) |
| [in,out] | spsi | (meshnp, hmddim) |
Definition at line 3489 of file hamiltonian_elec.F90.
|
private |
Computes the orbital-dependent part of the mGGA potential.
This reads as \( L\psi =-\nabla \cdot [\vtau \nabla \psi]\).
It is trivial to show that this operator is self-adjoint. However, this is never the case with finite differences. This is thus reimplemented as L\psi = -1/2(v_\tau \Delta \psi - \psi \Delta[v_\tau] + \Delta [v_\tau \psi]
The same expression was proposed in Richter et al., J. Chem. Phys. 159, 124117 (2023).
Definition at line 3533 of file hamiltonian_elec.F90.
| subroutine, public hamiltonian_elec_oct_m::zvmask | ( | class(mesh_t), intent(in) | mesh, |
| type(hamiltonian_elec_t), intent(in) | hm, | ||
| type(states_elec_t), intent(inout) | st | ||
| ) |
Definition at line 3583 of file hamiltonian_elec.F90.
| integer, parameter, public hamiltonian_elec_oct_m::length = 1 |
Definition at line 308 of file hamiltonian_elec.F90.
| integer, parameter, public hamiltonian_elec_oct_m::velocity = 2 |
Definition at line 308 of file hamiltonian_elec.F90.