pdos

libra_py.pdos.QE_pdos(prefix, emin, emax, de, projections, Ef, outfile_prefix, do_convolve, de_new, var, nspin=1)[source]

Computes various types of pDOS from the atomic state projections generated by the QE

Parameters
  • prefix (string) – a common prefix of the filenames for files containing the projection information

  • emin (double) – the minimal energy of the pDOS window [eV]

  • emax (double) – maximal energy of the pDOS window [eV]

  • de (double) – the original grid spacing of the pDOS [eV] (not necessarily the one used in pdos.in)

  • projections (list of lists of - see below) – groups of atoms and types of projections. Each element of this list contains 3 sub-lists, whose intersection defines which files to use: e.g. projection = [[“s”,”p”], [1,2,3], [“Cs”, “Br”]] - means s and p orbitals of atoms 1, 2, and 3 as long as any of these atoms are Cs or Br

  • Ef (double) – which energy use as the origin of energy scale (zero) in the output. Usually the Fermi or LUMO energy

  • outfile_prefix (string) – the prefix of the output file that will contain the final projections

  • do_convolve (Bool) – the flag telling whether we want to convolve the original data with the Gaussian envelope. The convolution is done with convolve()

  • de_new (double) – the new energy grid spacing [eV], in effect only if do_convolve == True

  • var (double) – standard deviation of the Gaussian [eV] with which we do a convolution, in effect only if do_convolve == True

  • nspin (int) – specifies which nspin was used in the electronic structure calculation. nspin = 1 nspin = 2 nspin = 4

Returns

( E, pDOSa ), where:

  • E ( MATRIX(N, 1) ): new energy grid, N - the new number of energy grid points

  • pDOSa ( MATRIX(N, Nproj) ): new Y grids, Nproj - len(projections) the number of projections we are interested in

  • if spin = 2, returns pDOSb for beta spin-orbtials as well

  • if spin = 4, returns just the pDOSa (pDOSb = None), but the orbitals now mixed spin states

Return type

tuple

libra_py.pdos.convolve(X0, Y0, dx0, dx, var)[source]

This function convolves the original data with the Gaussian of a given width: exp(- (x - x0)^2 / (2*var^2) ) This also means the energy grid spacing may change (usually to a denser one) The difference in grid densities is defined by the multiplicative factor dx0/dx

Parameters
  • X0 (MATRIX(N0, 1)) – original X grid, N0 - the number of energy grid points

  • Y0 (MATRIX(N0, Nproj)) – original Y grids, Nproj - the number of projections to consider

  • dx0 (double) – original X grid spacing [in units of energy]

  • dx (double) – new X grid spacing [in units of energy]

  • var (double) – width of the Gaussians that broaden the original data [in units of energy]

Returns

( X, Y ), where:

  • X ( MATRIX(N, 1) ): new X grid, N - the new number of energy grid points (N*dx = N0*dx0)

  • Y ( MATRIX(N, Nproj) ): new Y grids, Nproj has the same meaning as in Y0

Return type

tuple

libra_py.pdos.convolve_cp2k_pdos(params: dict)[source]

This function reads the pdos file produced by CP2K and extract the pdos at each time step and then convolve them with Gaussian functions.

Parameters

params (dictionary) –

cp2k_pdos_file (str): The CP2K .pdos file.

time_step (int): The time step of molecular dynamics.

sigma (float): The standard deviation in Gaussian function.

coef (float): The coefficient multiplied in Gaussian function.

npoints (int): The number of points used in convolution.

energy_conversion (float): The energy conversion unit from Hartree. For example 27.211386 is

for unit conversion from Hartree to eV. This value comes from libra_py.units. For example for Hartree to eV one needs to call libra_py.units.au2ev in the input. The default value is Hartree to eV.

angular_momentum_cols (list): The angular momentum columns in the *.pdos files produced by CP2K.

Returns

The energy grid points vector.

convolved_pdos (numpy array): The convolved pDOS vector.

homo_energy (float): The average HOMO energy.

Return type

energy_grid (numpy array)

libra_py.pdos.libra_pdos(_emin, _emax, _de, projections, prefix, outfile, Nel, do_convolve, _de_new, _var)[source]
Parameters
  • _emin (*) – minimal energy of the spectrum [eV]

  • _emax (*) – maximal energy of the spectrum [eV]

  • _de (*) – original energy grid spacing [eV]

  • projections (*) –

    groups of atoms and types of projections e.g. projections = [[“s”,[1,2,3]], [“p”,[1,2,3]], …

    Possible projections (examples) proj = [[“s”,range(0,360)],[“p”,range(0,360)],[“d”,range(0,360)]] proj = [[“s”,range(0,1)],[“p”,range(0,1)],[“d”,range(0,1)]] proj = [[“tot”,range(0,112)]]

  • prefix (*) – the common prefix of the files containing the projection information

  • outfile (*) – the name of the file that will contain the computed pDOSs

  • Nel (*) – the number of electrons, to compute the Fermi energy

  • _de_new (*) – new energy grid (for convolved) spacing [eV]

  • _var (*) – the width of the Gaussian used to broaden each energy grid point [eV]

# Example: of call - for Si QD # Si #main(-35.0, 35.0, 0.1,[[“tot”,range(0,103)]],”_alpha_wfc_atom”,”dos_proj.txt”,238)