ABINIT/m_hamiltonian [ Modules ]

This module provides the definition of the gs_hamiltonian_type and rf_hamiltonian_type
datastructures used in the "getghc" and "getgh1c" routines to apply the Hamiltonian (or
its derivative) on a wavefunction.
Methods to initialize or destroy the objects are defined here.
It also defines the ddiago_ctl_type structures datatype used to control the algorithm
used in ks_ddiago for performing the direct diagonalization of the KS Hamiltonian.

m_hamiltonian/copy_hamiltonian [ Functions ]

Copy a gs_hamiltonian_type variable (gs_hamk_in) in another (gs_hamk_out).
In contrast to an assignment statement (gs_hamk_out=gs_hamk_in), this
subroutine allocate memoryspace for the pointers contained in the data
structure (gs_hamk_out) and copy the content of the corresponding memoryspace of gs_hamk_in in it. In contrast, the assignment statement would
only associate the pointers of gs_hamk_out to the same memoryspace than
the corresponding ones in gs_hamk_in. This can cause trouble if one data
structure is destroyed before a reading/writing statement for the other
structure, causing access to unallocated memoryspace (silently, without
segmentation fault being generated).

OUTPUT

gs_hamk_out<gs_hamiltonian_type>=Structured datatype containing separate
copies of all data of gs_hamk_in upon exit.

m_hamiltonian/gs_hamiltonian_type [ Types ]

This datastructure contains the information about one Hamiltonian,
needed in the "getghc" routine, that apply the Hamiltonian
on a wavefunction.
The Hamiltonian is expressed in reciprocal space:
H_k^prime,k = exp(-i.k^prime.r^prime) H exp(i.k.r)
In most cases k=k^prime and the k^prime objects are simply pointers
to k objects.

m_hamiltonian/init_hamiltonian [ Functions ]

Creation method for the gs_hamiltonian_type structure.
It allocates memory and initializes all quantities that do not depend on the k-point or spin.

INPUTS

[comm_atom]=optional, MPI communicator over atoms
[fockcommon <type(fock_common_type)>]= common quantities to calculate Fock exact exchange
[fockbz <type(fock_BZ_type)>]= quantities to calculate Fock exact exchange in the total BZ
natom=Number of atoms in the unit cell.
nfft=Number of FFT grid points (for this processors).
nspinor=Number of spinorial components
nsppol=1 for unpolarized, 2 for spin-polarized
nspden=Number of spin density components.
mgfft=Maximum size for 1D FFTs i.e., MAXVAL(ngfft(1:3))
[mpi_atmtab(:)]=optional, indexes of the atoms treated by current proc
[mpi_spintab(2)]=optional, flags defining the spin(s) treated be current process:
mpi_spintab(1)=1 if non-polarized or spin-up treated
mpi_spintab(2)=1 if polarized and spin-dn treated
psps<pseudopotential_type>=structure datatype gathering data on the pseudopotentials.
[electronpositron<electronpositron_type>]=Structured datatype storing data for the
electron-positron two-component DFT (optional).
ngfft(18)=integer array with FFT box dimensions and other information on FFTs, for the FINE rectangular grid.
nloalg(3)=governs the choice of the algorithm for non-local operator
[nucdipmom(3,natom)]= (optional) array of nuclear dipole moments at atomic sites
[ph1d(2,3*(2*mgfft+1)*natom)]=1-dimensions phase arrays for structure factor (see getph.f).
Optional, recalculated inside the routine if not present in input.
rprimd(3,3)=Direct lattice vectors in Bohr.
typat(natom)=Type of each atom.
[usecprj]=flag use only for PAW; 1 if cprj datastructure is allocated
xred(3,natom)=Reduced coordinates of the atoms.
pawtab(ntypat*psps%usepaw)<pawtab_type>=PAW TABulated data initialized at start.
[paw_ij(:) <type(paw_ij_type)>]=optional, paw arrays given on (i,j) channels

SIDE EFFECTS

Ham<gs_hamiltonian_type>=Structured datatype almost completely initialized:
* Basic variables and dimensions are transfered to the structure.
* All pointers are allocated with correct dimensions.
* Quantities that do not depend on the k-point or spin are initialized.

m_hamiltonian/init_rf_hamiltonian [ Functions ]

Creation method for the rf_hamiltonian_type structure.
It allocates memory and initializes all quantities that do not depend on the k-point or spin.

INPUTS

[comm_atom]=optional, MPI communicator over atoms
cplex_paw=1 if all on-site PAW quantities are real (GS), 2 if they are complex (RF)
gs_Ham<gs_hamiltonian_type>=Structured datatype containing data for ground-state Hamiltonian at (k+q)
[has_e1kbsc]=optional, true if rf_Ham%e1kbsc has to be initialized.
e1kbsc contains the self-consistent 1st-order PAW Dij coefficients (depending on VHxc^(1))
ipert=index of perturbation
[mpi_atmtab(:)]=optional, indexes of the atoms treated by current proc
[mpi_spintab(2)]=optional, flags defining the spin(s) treated be current process:
mpi_spintab(1)=1 if non-polarized or spin-up treated
mpi_spintab(2)=1 if polarized and spin-dn treated
[paw_ij1(:)<paw_ij_type>]=Various 1st-order arrays given on (i,j) (partial waves)
channels (paw_ij1%dij and paw_ij1%difr only used here).

SIDE EFFECTS

rf_Ham<rf_hamiltonian_type>=Structured datatype almost completely initialized:
* Basic variables and dimensions are transfered to the structure.
* All pointers are allocated with correct dimensions.
* Quantities that do not depend on the k-point or spin are initialized.

ham<gs_hamiltonian_type>=structured datatype completed with k-dependent quantitites.
Quantities at k^prime are set equal to quantities at k.
k-dependent scalars and pointers associated
phkxred=exp(.k.xred) for each atom
[ham%gbound_k]=G sphere boundary, for each plane wave
[ham%ph3d_k]=3-dim structure factors, for each atom and plane wave

m_hamiltonian/load_spin_hamiltonian [ Functions ]

isppol=index of current spin
[vlocal(n4,n5,n6,nvloc)]=optional, local potential in real space
[vxctaulocal(n4,n5,n6,nvloc,4)]=optional, derivative of XC energy density with respect
to kinetic energy density in real space
[with_nonlocal]=optional, true if non-local factors have to be loaded