Octopus
lda_u_oct_m Module Reference

Data Types

module  lda_u_t
 Class to describe DFT+U parameters. More...
 

Functions/Subroutines

subroutine, public lda_u_init (this, namespace, space, level, gr, ions, st, mc, kpoints)
 
subroutine lda_u_init_coulomb_integrals (this, namespace, space, gr, st, psolver)
 
subroutine, public lda_u_end (this)
 
subroutine, public lda_u_rebind_after_copy (this, ions)
 Rebind non-owning pointers after intrinsic assignment of lda_u_t. More...
 
subroutine, public lda_u_accel_rebuild (this, kpt)
 Rebuild DFT+U accelerator buffers after intrinsic assignment. More...
 
subroutine, public lda_u_update_basis (this, space, gr, ions, st, psolver, namespace, kpoints, has_phase, aug_overlap)
 
subroutine, public lda_u_update_occ_matrices (this, namespace, mesh, st, phase, energy, aug_overlap)
 
subroutine, public lda_u_build_phase_correction (this, space, std, boundaries, namespace, kpoints, vec_pot, vec_pot_var)
 Build the phase correction to the global phase for all orbitals. More...
 
subroutine, public compute_acbno_u_kanamori (this, st, kanamori)
 
subroutine, public lda_u_freeze_occ (this)
 
subroutine, public lda_u_freeze_u (this)
 
subroutine, public lda_u_set_effectiveu (this, Ueff)
 
subroutine, public lda_u_get_effectiveu (this, Ueff)
 
subroutine, public lda_u_set_effectivev (this, Veff)
 
subroutine, public lda_u_get_effectivev (this, Veff)
 
subroutine, public lda_u_write_info (this, iunit, namespace)
 
subroutine lda_u_loadbasis (this, namespace, space, st, mesh, mc, ierr)
 
subroutine build_symmetrization_map (this, ions, gr)
 Builds a mapping between the orbital sets based on symmetries. More...
 
subroutine orbitals_get_symm_weight (os, space, latt, gr, symm, weight)
 Computes the weight of each rotated orbitals in the basis of the same localized subspace. More...
 
subroutine compute_complex_coulomb_integrals (this, gr, st, psolver, namespace, space)
 
subroutine compute_acbno_u_noncollinear (this, ios, namespace)
 This routine computes the effective U in the non-collinear case. More...
 
subroutine compute_acbno_v_noncollinear (this, ios)
 This routine computes the effective V in the noncollinear case. More...
 
subroutine, public dlda_u_apply_overlap (aug_overlap, mesh, std, psib, spsib)
 Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phase-corrected) batch: spsib = S psib. More...
 
subroutine dlda_u_normalize_orbitals_uspp (this, mesh, aug_overlap)
 S-normalize the localized Hubbard orbitals for ultrasoft/PAW. More...
 
subroutine, public dlda_u_add_plus_u_ket (this, d, mesh, psib, kpsib, aug_overlap)
 Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib. More...
 
subroutine, public dlda_u_apply (this, d, mesh, psib, hpsib, aug_overlap)
 Apply the +U nonlocal potential to psib and adds the result to hpsib. More...
 
subroutine dupdate_occ_matrices (this, namespace, mesh, st, lda_u_energy, aug_overlap, phase)
 This routine computes the values of the occupation matrices. More...
 
subroutine dsymmetrize_occ_matrices (this, occ)
 Symmetrize the occupation matrices. More...
 
subroutine, public dcompute_dftu_energy (this, energy, st)
 This routine computes the value of the double counting term in the DFT+U energy. More...
 
subroutine, public dlda_u_update_potential (this, st)
 This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and m' for all the atoms gives the full Hubbard potential. More...
 
subroutine dcompute_acbno_u (this, ios, namespace)
 This routine computes the effective U following the expression given in Agapito et al., Phys. Rev. X 5, 011006 (2015) More...
 
subroutine dcompute_acbno_u_restricted (this)
 This routine computes the effective Uin the spin-unpolarised case. More...
 
subroutine dcompute_acbno_v (this, ios)
 This routine computes the effective V in the spin-polarized case. More...
 
subroutine dcompute_acbno_v_restricted (this)
 This routine computes the effective V in the spin-unpolarised case. More...
 
subroutine dcompute_acbno_u_kanamori (this, kanamori)
 This routine computes the Kanamori U, Up, and J. More...
 
subroutine dcompute_acbno_u_kanamori_restricted (this, kanamori)
 This routine computes the Kanamori U, Up, and J. More...
 
subroutine dcompute_coulomb_integrals (this, namespace, space, gr, psolver)
 
subroutine, public dlda_u_commute_r_single (this, mesh, space, d, namespace, ist, ik, psi, gpsi, has_phase)
 
subroutine, public dlda_u_commute_r (this, mesh, space, d, namespace, psib, gpsib)
 This routine computes [r,V_lda+u] . More...
 
subroutine, public dlda_u_force (this, namespace, space, mesh, st, iq, psib, grad_psib, force, der, vnl, aug_overlap, phase)
 
subroutine, public dlda_u_rvu (this, mesh, space, d, namespace, psib, gpsib)
 This routine computes \((r-R_J)V_{\rm DFT+U}|\psi_{n,\mathbf{k}}\rangle\). More...
 
subroutine, public dlda_u_set_occupations (this, occ)
 
subroutine, public dlda_u_get_occupations (this, occ)
 
subroutine dlda_u_allocate (this, st)
 
subroutine ddft_u_get_weight_projectors (this, os, ios, spin_component, psib, phi_dot_psi, weight)
 Given the dot products \(<phi mp | psi >\), this computes the weight of the DFT+U projectors. More...
 
subroutine, public zlda_u_apply_overlap (aug_overlap, mesh, std, psib, spsib)
 Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phase-corrected) batch: spsib = S psib. More...
 
subroutine zlda_u_normalize_orbitals_uspp (this, mesh, aug_overlap)
 S-normalize the localized Hubbard orbitals for ultrasoft/PAW. More...
 
subroutine, public zlda_u_add_plus_u_ket (this, d, mesh, psib, kpsib, aug_overlap)
 Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib. More...
 
subroutine, public zlda_u_apply (this, d, mesh, psib, hpsib, aug_overlap)
 Apply the +U nonlocal potential to psib and adds the result to hpsib. More...
 
subroutine zupdate_occ_matrices (this, namespace, mesh, st, lda_u_energy, aug_overlap, phase)
 This routine computes the values of the occupation matrices. More...
 
subroutine zsymmetrize_occ_matrices (this, occ)
 Symmetrize the occupation matrices. More...
 
subroutine, public zcompute_dftu_energy (this, energy, st)
 This routine computes the value of the double counting term in the DFT+U energy. More...
 
subroutine, public zlda_u_update_potential (this, st)
 This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and m' for all the atoms gives the full Hubbard potential. More...
 
subroutine zcompute_acbno_u (this, ios, namespace)
 This routine computes the effective U following the expression given in Agapito et al., Phys. Rev. X 5, 011006 (2015) More...
 
subroutine zcompute_acbno_u_restricted (this)
 This routine computes the effective Uin the spin-unpolarised case. More...
 
subroutine zcompute_acbno_v (this, ios)
 This routine computes the effective V in the spin-polarized case. More...
 
subroutine zcompute_acbno_v_restricted (this)
 This routine computes the effective V in the spin-unpolarised case. More...
 
subroutine zcompute_acbno_u_kanamori (this, kanamori)
 This routine computes the Kanamori U, Up, and J. More...
 
subroutine zcompute_acbno_u_kanamori_restricted (this, kanamori)
 This routine computes the Kanamori U, Up, and J. More...
 
subroutine zcompute_coulomb_integrals (this, namespace, space, gr, psolver)
 
subroutine, public zlda_u_commute_r_single (this, mesh, space, d, namespace, ist, ik, psi, gpsi, has_phase)
 
subroutine, public zlda_u_commute_r (this, mesh, space, d, namespace, psib, gpsib)
 This routine computes [r,V_lda+u] . More...
 
subroutine, public zlda_u_force (this, namespace, space, mesh, st, iq, psib, grad_psib, force, der, vnl, aug_overlap, phase)
 
subroutine, public zlda_u_rvu (this, mesh, space, d, namespace, psib, gpsib)
 This routine computes \((r-R_J)V_{\rm DFT+U}|\psi_{n,\mathbf{k}}\rangle\). More...
 
subroutine, public zlda_u_set_occupations (this, occ)
 
subroutine, public zlda_u_get_occupations (this, occ)
 
subroutine zlda_u_allocate (this, st)
 
subroutine zdft_u_get_weight_projectors (this, os, ios, spin_component, psib, phi_dot_psi, weight)
 Given the dot products \(<phi mp | psi >\), this computes the weight of the DFT+U projectors. More...
 

Variables

integer, parameter, public dft_u_none = 0
 
integer, parameter, public dft_u_empirical = 1
 
integer, parameter, public dft_u_acbn0 = 2
 
integer, parameter, public dft_u_fll = 0
 
integer, parameter, public dft_u_amf = 1
 
integer, parameter, public dft_u_mix = 2
 

Function/Subroutine Documentation

◆ lda_u_init()

subroutine, public lda_u_oct_m::lda_u_init ( type(lda_u_t), intent(inout), target  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
integer, intent(in)  level,
type(grid_t), intent(in)  gr,
type(ions_t), intent(in), target  ions,
type(states_elec_t), intent(in)  st,
type(multicomm_t), intent(in)  mc,
type(kpoints_t), intent(in)  kpoints 
)

Definition at line 269 of file lda_u.F90.

◆ lda_u_init_coulomb_integrals()

subroutine lda_u_oct_m::lda_u_init_coulomb_integrals ( type(lda_u_t), intent(inout), target  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  st,
type(poisson_t), intent(in)  psolver 
)
private

Definition at line 605 of file lda_u.F90.

◆ lda_u_end()

subroutine, public lda_u_oct_m::lda_u_end ( type(lda_u_t), intent(inout)  this)

Definition at line 666 of file lda_u.F90.

◆ lda_u_rebind_after_copy()

subroutine, public lda_u_oct_m::lda_u_rebind_after_copy ( type(lda_u_t), intent(inout), target  this,
type(ions_t), intent(in), target  ions 
)

Rebind non-owning pointers after intrinsic assignment of lda_u_t.

This is used by hamiltonian snapshot copy to keep DFT+U state while redirecting pointers to the copied ions and copied orbital basis.

Definition at line 712 of file lda_u.F90.

◆ lda_u_accel_rebuild()

subroutine, public lda_u_oct_m::lda_u_accel_rebuild ( type(lda_u_t), intent(inout)  this,
type(distributed_t), intent(in)  kpt 
)

Rebuild DFT+U accelerator buffers after intrinsic assignment.

After hm_out = hm_in, accelerator handles in orbsets alias source buffers. This routine detaches copied handles and rebuilds device data from host orbital arrays.

Definition at line 757 of file lda_u.F90.

◆ lda_u_update_basis()

subroutine, public lda_u_oct_m::lda_u_update_basis ( type(lda_u_t), intent(inout), target  this,
class(space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(ions_t), intent(in), target  ions,
type(states_elec_t), intent(in)  st,
type(poisson_t), intent(in)  psolver,
type(namespace_t), intent(in)  namespace,
type(kpoints_t), intent(in)  kpoints,
logical, intent(in)  has_phase,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap 
)
Parameters
[in]aug_overlapgeneralized overlap S (ultrasoft/PAW)

Definition at line 800 of file lda_u.F90.

◆ lda_u_update_occ_matrices()

subroutine, public lda_u_oct_m::lda_u_update_occ_matrices ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(inout)  st,
type(phase_t), intent(in)  phase,
type(energy_t), intent(inout)  energy,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap 
)
Parameters
aug_overlapthe ultrasoft/PAW generalized overlap S; for ultrasoft/PAW the occupation matrix uses the S-augmented projection <phi|S|psi~>.

Definition at line 914 of file lda_u.F90.

◆ lda_u_build_phase_correction()

subroutine, public lda_u_oct_m::lda_u_build_phase_correction ( type(lda_u_t), intent(inout)  this,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  std,
type(boundaries_t), intent(in)  boundaries,
type(namespace_t), intent(in)  namespace,
type(kpoints_t), intent(in)  kpoints,
real(real64), dimension(:), intent(in), optional, allocatable  vec_pot,
real(real64), dimension(:, :), intent(in), optional, allocatable  vec_pot_var 
)

Build the phase correction to the global phase for all orbitals.

Parameters
[in]vec_pot(spacedim)
[in]vec_pot_var(1:spacedim, 1:ns)

Definition at line 941 of file lda_u.F90.

◆ compute_acbno_u_kanamori()

subroutine, public lda_u_oct_m::compute_acbno_u_kanamori ( type(lda_u_t), intent(in)  this,
type(states_elec_t), intent(in)  st,
real(real64), dimension(:,:), intent(out), contiguous  kanamori 
)

Definition at line 981 of file lda_u.F90.

◆ lda_u_freeze_occ()

subroutine, public lda_u_oct_m::lda_u_freeze_occ ( type(lda_u_t), intent(inout)  this)

Definition at line 1004 of file lda_u.F90.

◆ lda_u_freeze_u()

subroutine, public lda_u_oct_m::lda_u_freeze_u ( type(lda_u_t), intent(inout)  this)

Definition at line 1011 of file lda_u.F90.

◆ lda_u_set_effectiveu()

subroutine, public lda_u_oct_m::lda_u_set_effectiveu ( type(lda_u_t), intent(inout)  this,
real(real64), dimension(:), intent(in), contiguous  Ueff 
)
Parameters
[in]ueff(thisnorbsets)

Definition at line 1018 of file lda_u.F90.

◆ lda_u_get_effectiveu()

subroutine, public lda_u_oct_m::lda_u_get_effectiveu ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:), intent(inout), contiguous  Ueff 
)
Parameters
[in,out]ueff(thisnorbsets)

Definition at line 1034 of file lda_u.F90.

◆ lda_u_set_effectivev()

subroutine, public lda_u_oct_m::lda_u_set_effectivev ( type(lda_u_t), intent(inout)  this,
real(real64), dimension(:), intent(in), contiguous  Veff 
)

Definition at line 1050 of file lda_u.F90.

◆ lda_u_get_effectivev()

subroutine, public lda_u_oct_m::lda_u_get_effectivev ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:), intent(inout), contiguous  Veff 
)

Definition at line 1068 of file lda_u.F90.

◆ lda_u_write_info()

subroutine, public lda_u_oct_m::lda_u_write_info ( type(lda_u_t), intent(in)  this,
integer, intent(in), optional  iunit,
type(namespace_t), intent(in), optional  namespace 
)

Definition at line 1086 of file lda_u.F90.

◆ lda_u_loadbasis()

subroutine lda_u_oct_m::lda_u_loadbasis ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
type(multicomm_t), intent(in)  mc,
integer, intent(out)  ierr 
)
private

Definition at line 1119 of file lda_u.F90.

◆ build_symmetrization_map()

subroutine lda_u_oct_m::build_symmetrization_map ( type(lda_u_t), intent(inout)  this,
type(ions_t), intent(in)  ions,
type(grid_t), intent(in)  gr 
)
private

Builds a mapping between the orbital sets based on symmetries.

Definition at line 1376 of file lda_u.F90.

◆ orbitals_get_symm_weight()

subroutine lda_u_oct_m::orbitals_get_symm_weight ( type(orbitalset_t), intent(in)  os,
type(space_t), intent(in)  space,
type(lattice_vectors_t), intent(in)  latt,
type(grid_t), intent(in)  gr,
type(symmetries_t), intent(in)  symm,
real(real64), dimension(:,:,:), intent(inout), contiguous  weight 
)
private

Computes the weight of each rotated orbitals in the basis of the same localized subspace.

Definition at line 1428 of file lda_u.F90.

◆ compute_complex_coulomb_integrals()

subroutine lda_u_oct_m::compute_complex_coulomb_integrals ( type(lda_u_t), intent(inout)  this,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  st,
type(poisson_t), intent(in)  psolver,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space 
)
private

Definition at line 1509 of file lda_u.F90.

◆ compute_acbno_u_noncollinear()

subroutine lda_u_oct_m::compute_acbno_u_noncollinear ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios,
type(namespace_t), intent(in)  namespace 
)
private

This routine computes the effective U in the non-collinear case.

Definition at line 1631 of file lda_u.F90.

◆ compute_acbno_v_noncollinear()

subroutine lda_u_oct_m::compute_acbno_v_noncollinear ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios 
)
private

This routine computes the effective V in the noncollinear case.

See Eq. A6 in Tancogne-Dejean et al., PRB 102, 155117 (2020)

Definition at line 1748 of file lda_u.F90.

◆ dlda_u_apply_overlap()

subroutine, public lda_u_oct_m::dlda_u_apply_overlap ( type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
class(mesh_t), intent(in)  mesh,
type(states_elec_dim_t), intent(in)  std,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  spsib 
)

Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phase-corrected) batch: spsib = S psib.

Used to build the S-augmented Hubbard projection <phi|S|psi~> = <phi|(S psi~)> (S is Hermitian) and the S-dressed +U operator ket sum_m w_m S|phi_m> = S (sum_m w_m |phi_m>).

Definition at line 1880 of file lda_u.F90.

◆ dlda_u_normalize_orbitals_uspp()

subroutine lda_u_oct_m::dlda_u_normalize_orbitals_uspp ( type(lda_u_t), intent(inout)  this,
class(mesh_t), intent(in)  mesh,
type(nonlocal_pseudopotential_t), intent(in), target  aug_overlap 
)
private

S-normalize the localized Hubbard orbitals for ultrasoft/PAW.

The orbitals are built normalized in the bare metric (<phi|phi> = 1), but the S-augmented occupation <phi|S|phi> projects through the generalized overlap, so for a physical occupation the orbitals must satisfy <phi|S|phi> = 1. Without this the occupation is over-counted by a factor <phi|S|phi> = 1 + sum_ij <phi|beta_i> q_ij <beta_j|phi>, which is negligible for soft channels (e.g. Si 3p) but large for hard ones (e.g. O 2p, 3d metals). The norm uses only the augmentation of the orbital own atom, S_I = 1 + sum_ij |beta_i^I> q_ij <beta_j^I|, evaluated for the isolated orbital on its sphere. It is therefore configuration independent, as the norm-conserving AONormalize, so that the Hubbard forces and stress need no normalization term. The orbital Bloch phases are added afterwards.

Definition at line 1912 of file lda_u.F90.

◆ dlda_u_add_plus_u_ket()

subroutine, public lda_u_oct_m::dlda_u_add_plus_u_ket ( type(lda_u_t), intent(in)  this,
type(states_elec_dim_t), intent(in)  d,
class(mesh_t), intent(in)  mesh,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  kpsib,
type(nonlocal_pseudopotential_t), intent(in), optional  aug_overlap 
)

Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib.

For ultrasoft/PAW (aug_overlap present) the projection is S-augmented, <phi_mp|S|psi~>, so chi = P S psi~. The +U operator is then S chi (see lda_u_apply), while the ultrasoft DFT+U force needs chi itself.

Definition at line 2019 of file lda_u.F90.

◆ dlda_u_apply()

subroutine, public lda_u_oct_m::dlda_u_apply ( type(lda_u_t), intent(in)  this,
type(states_elec_dim_t), intent(in)  d,
class(mesh_t), intent(in)  mesh,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  hpsib,
type(nonlocal_pseudopotential_t), intent(in), optional  aug_overlap 
)

Apply the +U nonlocal potential to psib and adds the result to hpsib.

For ultrasoft/PAW (aug_overlap present) both the projection and the orbital ket are dressed with the generalized overlap S, so the applied operator is the variational derivative of E_U evaluated on the S-augmented occupations: hpsi += sum_m S|phi_m> sum_mp V_mmp <phi_mp|S|psi>.

Definition at line 2085 of file lda_u.F90.

◆ dupdate_occ_matrices()

subroutine lda_u_oct_m::dupdate_occ_matrices ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(inout), target  st,
real(real64), intent(inout)  lda_u_energy,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
type(phase_t), intent(in), optional  phase 
)
private

This routine computes the values of the occupation matrices.

Definition at line 2120 of file lda_u.F90.

◆ dsymmetrize_occ_matrices()

subroutine lda_u_oct_m::dsymmetrize_occ_matrices ( type(lda_u_t), intent(inout)  this,
real(real64), dimension(:,:,:,:), intent(inout), contiguous  occ 
)
private

Symmetrize the occupation matrices.

At the moment this is only done for the case of real spherical harmonics using the fact that a rotated spherical harmonic \(Y_m^l\) can be expressed in the basis of the spherical harmonics of the l.

The other cases (complex spherical harmonics, basis from state) are not symmetrized at the moment. The intersite generalized occupation matrices are also not treated at the moment

Definition at line 2487 of file lda_u.F90.

◆ dcompute_dftu_energy()

subroutine, public lda_u_oct_m::dcompute_dftu_energy ( type(lda_u_t), intent(inout)  this,
real(real64), intent(inout)  energy,
type(states_elec_t), intent(in)  st 
)

This routine computes the value of the double counting term in the DFT+U energy.

Definition at line 2539 of file lda_u.F90.

◆ dlda_u_update_potential()

subroutine, public lda_u_oct_m::dlda_u_update_potential ( type(lda_u_t), intent(inout)  this,
type(states_elec_t), intent(in)  st 
)

This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and m' for all the atoms gives the full Hubbard potential.

Definition at line 2613 of file lda_u.F90.

◆ dcompute_acbno_u()

subroutine lda_u_oct_m::dcompute_acbno_u ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios,
type(namespace_t), intent(in)  namespace 
)
private

This routine computes the effective U following the expression given in Agapito et al., Phys. Rev. X 5, 011006 (2015)

Definition at line 2671 of file lda_u.F90.

◆ dcompute_acbno_u_restricted()

subroutine lda_u_oct_m::dcompute_acbno_u_restricted ( type(lda_u_t), intent(inout)  this)
private

This routine computes the effective Uin the spin-unpolarised case.

Definition at line 2816 of file lda_u.F90.

◆ dcompute_acbno_v()

subroutine lda_u_oct_m::dcompute_acbno_v ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios 
)
private

This routine computes the effective V in the spin-polarized case.

Definition at line 2888 of file lda_u.F90.

◆ dcompute_acbno_v_restricted()

subroutine lda_u_oct_m::dcompute_acbno_v_restricted ( type(lda_u_t), intent(inout)  this)
private

This routine computes the effective V in the spin-unpolarised case.

Definition at line 2955 of file lda_u.F90.

◆ dcompute_acbno_u_kanamori()

subroutine lda_u_oct_m::dcompute_acbno_u_kanamori ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:,:), intent(out), contiguous  kanamori 
)
private

This routine computes the Kanamori U, Up, and J.

Definition at line 3000 of file lda_u.F90.

◆ dcompute_acbno_u_kanamori_restricted()

subroutine lda_u_oct_m::dcompute_acbno_u_kanamori_restricted ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:,:), intent(out), contiguous  kanamori 
)
private

This routine computes the Kanamori U, Up, and J.

Definition at line 3099 of file lda_u.F90.

◆ dcompute_coulomb_integrals()

subroutine lda_u_oct_m::dcompute_coulomb_integrals ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(poisson_t), intent(in)  psolver 
)
private

Definition at line 3174 of file lda_u.F90.

◆ dlda_u_commute_r_single()

subroutine, public lda_u_oct_m::dlda_u_commute_r_single ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  ist,
integer, intent(in)  ik,
real(real64), dimension(:,:), intent(inout), target, contiguous  psi,
real(real64), dimension(:,:,:), intent(inout), target, contiguous  gpsi,
logical, intent(in)  has_phase 
)
Parameters
[in,out]gpsi(1:grnp, 1:grderdim, 1:stddim)

Definition at line 3302 of file lda_u.F90.

◆ dlda_u_commute_r()

subroutine, public lda_u_oct_m::dlda_u_commute_r ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
type(wfs_elec_t), intent(in)  psib,
class(wfs_elec_t), dimension(:), intent(inout), contiguous  gpsib 
)

This routine computes [r,V_lda+u] .

Definition at line 3353 of file lda_u.F90.

◆ dlda_u_force()

subroutine, public lda_u_oct_m::dlda_u_force ( type(lda_u_t), intent(in)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st,
integer, intent(in)  iq,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), dimension(:), intent(in), contiguous  grad_psib,
real(real64), dimension(:, :), intent(inout), contiguous  force,
type(derivatives_t), intent(in)  der,
type(nonlocal_pseudopotential_t), intent(in)  vnl,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
class(phase_t), intent(in)  phase 
)
Parameters
[in]derused by the ultrasoft/PAW force
[in]vnlcarries q_ij for the overlap-derivative term
[in]aug_overlapgeneralized overlap S (ultrasoft/PAW)
[in]phaseBloch phases, to set the boundary points of S psi~ and chi

Definition at line 3510 of file lda_u.F90.

◆ dlda_u_rvu()

subroutine, public lda_u_oct_m::dlda_u_rvu ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
type(wfs_elec_t), intent(in)  psib,
class(wfs_elec_t), dimension(:), intent(inout), contiguous  gpsib 
)

This routine computes \((r-R_J)V_{\rm DFT+U}|\psi_{n,\mathbf{k}}\rangle\).

Note
The notation is weird and needs to be understood as the fact that the factor \((r_R_J)\) is in fact included in the Bloch sum of the left part of the projector over the orbitals.

Definition at line 3692 of file lda_u.F90.

◆ dlda_u_set_occupations()

subroutine, public lda_u_oct_m::dlda_u_set_occupations ( type(lda_u_t), intent(inout)  this,
real(real64), dimension(:), intent(in), contiguous  occ 
)

Definition at line 3802 of file lda_u.F90.

◆ dlda_u_get_occupations()

subroutine, public lda_u_oct_m::dlda_u_get_occupations ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:), intent(inout), contiguous  occ 
)

Definition at line 3859 of file lda_u.F90.

◆ dlda_u_allocate()

subroutine lda_u_oct_m::dlda_u_allocate ( type(lda_u_t), intent(inout)  this,
type(states_elec_t), intent(in)  st 
)
private

Definition at line 3918 of file lda_u.F90.

◆ ddft_u_get_weight_projectors()

subroutine lda_u_oct_m::ddft_u_get_weight_projectors ( type(lda_u_t), intent(in)  this,
type(orbitalset_t), intent(in)  os,
integer, intent(in)  ios,
integer, intent(in)  spin_component,
type(wfs_elec_t), intent(in)  psib,
real(real64), dimension(:,:,:,:), intent(in), contiguous  phi_dot_psi,
real(real64), dimension(:,:), intent(inout)  weight 
)
private

Given the dot products \(<phi mp | psi >\), this computes the weight of the DFT+U projectors.

For DFT+U+V (intersite interaction), the weight also include the intersite part, such that the resulting weight is applied only once to the localized orbitals.

For the spinor case, the weight is defined per spin component, so the last dimension of weight is of size nst_linear

Parameters
[in]phi_dot_psiDot products \(<phi mp | psi >\) (nspin, norb, nst, norbset)
[in,out]weightResulting weight (norb, nst_linear)

Definition at line 3953 of file lda_u.F90.

◆ zlda_u_apply_overlap()

subroutine, public lda_u_oct_m::zlda_u_apply_overlap ( type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
class(mesh_t), intent(in)  mesh,
type(states_elec_dim_t), intent(in)  std,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  spsib 
)

Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phase-corrected) batch: spsib = S psib.

Used to build the S-augmented Hubbard projection <phi|S|psi~> = <phi|(S psi~)> (S is Hermitian) and the S-dressed +U operator ket sum_m w_m S|phi_m> = S (sum_m w_m |phi_m>).

Definition at line 4112 of file lda_u.F90.

◆ zlda_u_normalize_orbitals_uspp()

subroutine lda_u_oct_m::zlda_u_normalize_orbitals_uspp ( type(lda_u_t), intent(inout)  this,
class(mesh_t), intent(in)  mesh,
type(nonlocal_pseudopotential_t), intent(in), target  aug_overlap 
)
private

S-normalize the localized Hubbard orbitals for ultrasoft/PAW.

The orbitals are built normalized in the bare metric (<phi|phi> = 1), but the S-augmented occupation <phi|S|phi> projects through the generalized overlap, so for a physical occupation the orbitals must satisfy <phi|S|phi> = 1. Without this the occupation is over-counted by a factor <phi|S|phi> = 1 + sum_ij <phi|beta_i> q_ij <beta_j|phi>, which is negligible for soft channels (e.g. Si 3p) but large for hard ones (e.g. O 2p, 3d metals). The norm uses only the augmentation of the orbital own atom, S_I = 1 + sum_ij |beta_i^I> q_ij <beta_j^I|, evaluated for the isolated orbital on its sphere. It is therefore configuration independent, as the norm-conserving AONormalize, so that the Hubbard forces and stress need no normalization term. The orbital Bloch phases are added afterwards.

Definition at line 4144 of file lda_u.F90.

◆ zlda_u_add_plus_u_ket()

subroutine, public lda_u_oct_m::zlda_u_add_plus_u_ket ( type(lda_u_t), intent(in)  this,
type(states_elec_dim_t), intent(in)  d,
class(mesh_t), intent(in)  mesh,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  kpsib,
type(nonlocal_pseudopotential_t), intent(in), optional  aug_overlap 
)

Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib.

For ultrasoft/PAW (aug_overlap present) the projection is S-augmented, <phi_mp|S|psi~>, so chi = P S psi~. The +U operator is then S chi (see lda_u_apply), while the ultrasoft DFT+U force needs chi itself.

Definition at line 4251 of file lda_u.F90.

◆ zlda_u_apply()

subroutine, public lda_u_oct_m::zlda_u_apply ( type(lda_u_t), intent(in)  this,
type(states_elec_dim_t), intent(in)  d,
class(mesh_t), intent(in)  mesh,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), intent(inout)  hpsib,
type(nonlocal_pseudopotential_t), intent(in), optional  aug_overlap 
)

Apply the +U nonlocal potential to psib and adds the result to hpsib.

For ultrasoft/PAW (aug_overlap present) both the projection and the orbital ket are dressed with the generalized overlap S, so the applied operator is the variational derivative of E_U evaluated on the S-augmented occupations: hpsi += sum_m S|phi_m> sum_mp V_mmp <phi_mp|S|psi>.

Definition at line 4317 of file lda_u.F90.

◆ zupdate_occ_matrices()

subroutine lda_u_oct_m::zupdate_occ_matrices ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(inout), target  st,
real(real64), intent(inout)  lda_u_energy,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
type(phase_t), intent(in), optional  phase 
)
private

This routine computes the values of the occupation matrices.

Definition at line 4352 of file lda_u.F90.

◆ zsymmetrize_occ_matrices()

subroutine lda_u_oct_m::zsymmetrize_occ_matrices ( type(lda_u_t), intent(inout)  this,
complex(real64), dimension(:,:,:,:), intent(inout), contiguous  occ 
)
private

Symmetrize the occupation matrices.

At the moment this is only done for the case of real spherical harmonics using the fact that a rotated spherical harmonic \(Y_m^l\) can be expressed in the basis of the spherical harmonics of the l.

The other cases (complex spherical harmonics, basis from state) are not symmetrized at the moment. The intersite generalized occupation matrices are also not treated at the moment

Definition at line 4719 of file lda_u.F90.

◆ zcompute_dftu_energy()

subroutine, public lda_u_oct_m::zcompute_dftu_energy ( type(lda_u_t), intent(inout)  this,
real(real64), intent(inout)  energy,
type(states_elec_t), intent(in)  st 
)

This routine computes the value of the double counting term in the DFT+U energy.

Definition at line 4771 of file lda_u.F90.

◆ zlda_u_update_potential()

subroutine, public lda_u_oct_m::zlda_u_update_potential ( type(lda_u_t), intent(inout)  this,
type(states_elec_t), intent(in)  st 
)

This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and m' for all the atoms gives the full Hubbard potential.

Definition at line 4845 of file lda_u.F90.

◆ zcompute_acbno_u()

subroutine lda_u_oct_m::zcompute_acbno_u ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios,
type(namespace_t), intent(in)  namespace 
)
private

This routine computes the effective U following the expression given in Agapito et al., Phys. Rev. X 5, 011006 (2015)

Definition at line 4903 of file lda_u.F90.

◆ zcompute_acbno_u_restricted()

subroutine lda_u_oct_m::zcompute_acbno_u_restricted ( type(lda_u_t), intent(inout)  this)
private

This routine computes the effective Uin the spin-unpolarised case.

Definition at line 5048 of file lda_u.F90.

◆ zcompute_acbno_v()

subroutine lda_u_oct_m::zcompute_acbno_v ( type(lda_u_t), intent(inout)  this,
integer, intent(in)  ios 
)
private

This routine computes the effective V in the spin-polarized case.

Definition at line 5120 of file lda_u.F90.

◆ zcompute_acbno_v_restricted()

subroutine lda_u_oct_m::zcompute_acbno_v_restricted ( type(lda_u_t), intent(inout)  this)
private

This routine computes the effective V in the spin-unpolarised case.

Definition at line 5187 of file lda_u.F90.

◆ zcompute_acbno_u_kanamori()

subroutine lda_u_oct_m::zcompute_acbno_u_kanamori ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:,:), intent(out), contiguous  kanamori 
)
private

This routine computes the Kanamori U, Up, and J.

Definition at line 5232 of file lda_u.F90.

◆ zcompute_acbno_u_kanamori_restricted()

subroutine lda_u_oct_m::zcompute_acbno_u_kanamori_restricted ( type(lda_u_t), intent(in)  this,
real(real64), dimension(:,:), intent(out), contiguous  kanamori 
)
private

This routine computes the Kanamori U, Up, and J.

Definition at line 5331 of file lda_u.F90.

◆ zcompute_coulomb_integrals()

subroutine lda_u_oct_m::zcompute_coulomb_integrals ( type(lda_u_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(poisson_t), intent(in)  psolver 
)
private

Definition at line 5406 of file lda_u.F90.

◆ zlda_u_commute_r_single()

subroutine, public lda_u_oct_m::zlda_u_commute_r_single ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  ist,
integer, intent(in)  ik,
complex(real64), dimension(:,:), intent(inout), target, contiguous  psi,
complex(real64), dimension(:,:,:), intent(inout), target, contiguous  gpsi,
logical, intent(in)  has_phase 
)
Parameters
[in,out]gpsi(1:grnp, 1:grderdim, 1:stddim)

Definition at line 5534 of file lda_u.F90.

◆ zlda_u_commute_r()

subroutine, public lda_u_oct_m::zlda_u_commute_r ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
type(wfs_elec_t), intent(in)  psib,
class(wfs_elec_t), dimension(:), intent(inout), contiguous  gpsib 
)

This routine computes [r,V_lda+u] .

Definition at line 5585 of file lda_u.F90.

◆ zlda_u_force()

subroutine, public lda_u_oct_m::zlda_u_force ( type(lda_u_t), intent(in)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st,
integer, intent(in)  iq,
type(wfs_elec_t), intent(in)  psib,
type(wfs_elec_t), dimension(:), intent(in), contiguous  grad_psib,
real(real64), dimension(:, :), intent(inout), contiguous  force,
type(derivatives_t), intent(in)  der,
type(nonlocal_pseudopotential_t), intent(in)  vnl,
type(nonlocal_pseudopotential_t), intent(in)  aug_overlap,
class(phase_t), intent(in)  phase 
)
Parameters
[in]derused by the ultrasoft/PAW force
[in]vnlcarries q_ij for the overlap-derivative term
[in]aug_overlapgeneralized overlap S (ultrasoft/PAW)
[in]phaseBloch phases, to set the boundary points of S psi~ and chi

Definition at line 5772 of file lda_u.F90.

◆ zlda_u_rvu()

subroutine, public lda_u_oct_m::zlda_u_rvu ( type(lda_u_t), intent(in)  this,
class(mesh_t), intent(in)  mesh,
class(space_t), intent(in)  space,
type(states_elec_dim_t), intent(in)  d,
type(namespace_t), intent(in)  namespace,
type(wfs_elec_t), intent(in)  psib,
class(wfs_elec_t), dimension(:), intent(inout), contiguous  gpsib 
)

This routine computes \((r-R_J)V_{\rm DFT+U}|\psi_{n,\mathbf{k}}\rangle\).

Note
The notation is weird and needs to be understood as the fact that the factor \((r_R_J)\) is in fact included in the Bloch sum of the left part of the projector over the orbitals.

Definition at line 5954 of file lda_u.F90.

◆ zlda_u_set_occupations()

subroutine, public lda_u_oct_m::zlda_u_set_occupations ( type(lda_u_t), intent(inout)  this,
complex(real64), dimension(:), intent(in), contiguous  occ 
)

Definition at line 6085 of file lda_u.F90.

◆ zlda_u_get_occupations()

subroutine, public lda_u_oct_m::zlda_u_get_occupations ( type(lda_u_t), intent(in)  this,
complex(real64), dimension(:), intent(inout), contiguous  occ 
)

Definition at line 6142 of file lda_u.F90.

◆ zlda_u_allocate()

subroutine lda_u_oct_m::zlda_u_allocate ( type(lda_u_t), intent(inout)  this,
type(states_elec_t), intent(in)  st 
)
private

Definition at line 6201 of file lda_u.F90.

◆ zdft_u_get_weight_projectors()

subroutine lda_u_oct_m::zdft_u_get_weight_projectors ( type(lda_u_t), intent(in)  this,
type(orbitalset_t), intent(in)  os,
integer, intent(in)  ios,
integer, intent(in)  spin_component,
type(wfs_elec_t), intent(in)  psib,
complex(real64), dimension(:,:,:,:), intent(in), contiguous  phi_dot_psi,
complex(real64), dimension(:,:), intent(inout)  weight 
)
private

Given the dot products \(<phi mp | psi >\), this computes the weight of the DFT+U projectors.

For DFT+U+V (intersite interaction), the weight also include the intersite part, such that the resulting weight is applied only once to the localized orbitals.

For the spinor case, the weight is defined per spin component, so the last dimension of weight is of size nst_linear

Parameters
[in]phi_dot_psiDot products \(<phi mp | psi >\) (nspin, norb, nst, norbset)
[in,out]weightResulting weight (norb, nst_linear)

Definition at line 6236 of file lda_u.F90.

Variable Documentation

◆ dft_u_none

integer, parameter, public lda_u_oct_m::dft_u_none = 0

Definition at line 188 of file lda_u.F90.

◆ dft_u_empirical

integer, parameter, public lda_u_oct_m::dft_u_empirical = 1

Definition at line 188 of file lda_u.F90.

◆ dft_u_acbn0

integer, parameter, public lda_u_oct_m::dft_u_acbn0 = 2

Definition at line 188 of file lda_u.F90.

◆ dft_u_fll

integer, parameter, public lda_u_oct_m::dft_u_fll = 0

Definition at line 193 of file lda_u.F90.

◆ dft_u_amf

integer, parameter, public lda_u_oct_m::dft_u_amf = 1

Definition at line 193 of file lda_u.F90.

◆ dft_u_mix

integer, parameter, public lda_u_oct_m::dft_u_mix = 2

Definition at line 193 of file lda_u.F90.