Density and hamiltonian objects¶

class
gpaw.density.
Density
(gd, finegd, nspins, collinear, charge, redistributor, background_charge=None)[source]¶ Density object.
 Attributes:
gd
Grid descriptor for coarse grids. finegd
Grid descriptor for fine grids. interpolate
Function for interpolating the electron density. mixer
DensityMixer
object. Soft and smooth pseudo functions on uniform 3D grids:
nt_sG
Electron density on the coarse grid. nt_sg
Electron density on the fine grid. nt_g
Electron density on the fine grid. rhot_g
Charge density on the fine grid. nct_G
Core electrondensity on the coarse grid.
Create the Density object.

calculate_pseudo_density
(wfs)[source]¶ Calculate nt_sG from scratch.
nt_sG will be equal to nct_G plus the contribution from wfs.add_to_density().

get_all_electron_density
(atoms=None, gridrefinement=2, spos_ac=None, skip_core=False)[source]¶ Return real allelectron density array.
 Usage: Either get_all_electron_density(atoms) or
 get_all_electron_density(spos_ac=spos_ac)
 skip_core=True theoretically returns the
 allelectron valence density (use with care; will not in general integrate to valence)

get_correction
(a, spin)[source]¶ Integrated atomic density correction.
Get the integrated correction to the pseuso density relative to the allelectron density.

get_spin_contamination
(atoms, majority_spin=0)[source]¶ Calculate the spin contamination.
Spin contamination is defined as the integral over the spin density difference, where it is negative (i.e. the minority spin density is larger than the majority spin density.

initialize_from_atomic_densities
(basis_functions)[source]¶ Initialize D_asp, nt_sG and Q_aL from atomic densities.
nt_sG is initialized from atomic orbitals, and will be constructed with the specified magnetic moments and obeying Hund’s rules if
hund
is true.

class
gpaw.hamiltonian.
Hamiltonian
(gd, finegd, nspins, collinear, setups, timer, xc, world, redistributor, vext=None)[source]¶ 
apply
(a_xG, b_xG, wfs, kpt, calculate_P_ani=True)[source]¶ Apply the Hamiltonian operator to a set of vectors.
Parameters:
 a_nG: ndarray
 Set of vectors to which the overlap operator is applied.
 b_nG: ndarray, output
 Resulting S times a_nG vectors.
 wfs: WaveFunctions
 Wavefunction object defined in wavefunctions.py
 kpt: KPoint object
 kpoint object defined in kpoint.py.
 calculate_P_ani: bool
 When True, the integrals of projector times vectors P_ni = <p_i  a_nG> are calculated. When False, existing P_ani are used

apply_local_potential
(psit_nG, Htpsit_nG, s)[source]¶ Apply the Hamiltonian operator to a set of vectors.
XXX Parameter description is deprecated!
Parameters:
 a_nG: ndarray
 Set of vectors to which the overlap operator is applied.
 b_nG: ndarray, output
 Resulting H times a_nG vectors.
 kpt: KPoint object
 kpoint object defined in kpoint.py.
 calculate_projections: bool
 When True, the integrals of projector times vectors P_ni = <p_i  a_nG> are calculated. When False, existing P_uni are used
 local_part_only: bool
 When True, the nonlocal atomic parts of the Hamiltonian are not applied and calculate_projections is ignored.
