esta.qeBag package
Contents
esta.qeBag package#
Submodules#
esta.qeBag.23 module#
esta.qeBag.bands_kpts_band_gap module#
- esta.qeBag.bands_kpts_band_gap.energies_kpts(filename)#
finding: -nbands, band-energies -nkpts, kpt-coordinate -band gap for spin up channel -band gap for spin down channel -band gap between valence band(of spin up/down) and cond. band (spin up/down) for unpolarised/polarised qe scf.out file
NOTE: use verbosity = ‘high’ to print the band energies
- input:
name of scf.out file with verbosity high to be used in qe pw.x calculation
output: see above
- internal variables:
lspin lfermi nelec nband efermi energies occupations
print(‘no of bands: {}, no of kpts: {}, Fermi level: {}’.format(nband, nkpt, efermi)) print(‘no of elctrons: {}’.format(nelec))
energies = np.zeros((nkpt, nband, 2)) # 2 for spin polarised calc occupations = np.zeros_like(energies)
coord_kpts =[]
- if lspin:
return energies, coord_kpts, band_gap_up, band_gap_down, band_gap, lspin, occupations
- else:
return energies, coord_kpts, band_gap_up, None, None, lspin, occupations
- ====++++++++++++++++============================================================
MORE to do for fermi energy:
see qexml.f90 in Modules of qe6.2 version: lines: 4152,42 89%
- IF ( two_fermi_energies_ ) THEN ! skfermi energies up down or up/down e eneties.. so on
! CALL iotk_scan_dat( iunit, “FERMI_ENERGY_UP”, ef_up_, IERR=ierr ) IF (ierr/=0) RETURN CALL iotk_scan_dat( iunit, “FERMI_ENERGY_DOWN”, ef_dw_, IERR=ierr ) IF (ierr/=0) RETURN CALL iotk_scan_dat( iunit, “ELECTRONS_UP”, nel_up_, IERR=ierr ) IF (ierr/=0) RETURN CALL iotk_scan_dat( iunit, “ELECTRONS_DOWN”, nel_down_, IERR=ierr ) IF (ierr/=0) RETURN !
- ELSE
! CALL iotk_scan_dat ( iunit, “FERMI_ENERGY”, ef_ , FOUND=found ) IF (ierr/=0) RETURN
=====++++++++++++++++++++++++=====================================================
esta.qeBag.gen_qeinput module#
generate qe input file using poscar and other input parameters
- Input:
string, poscar filename string, pseudo-type info; e.g:
ps_info =’.pbe-kjpaw’ or .pbe-rrkjus_ for uspp
- string (optional), cell vectors in angstrom or bohr; default is angstrom
set it to bohr for veiwing the qe input file in xcrysden (version:1.5.53)
- output:
qe input file
Note
Right now only for PBE functional .. can be used for other functionals
NEEDED pseudo-potential directory; default is in ~ with location = ‘/home/sonu/pslibrary.1.0.0/pbe/PSEUDOPOTENTIALS/’
- date: Jan, March 2020
Jan, 2021
author: sk, sonukumar.physics@gmail.com
- esta.qeBag.gen_qeinput.delete_pseudo_pot(pseudo_list, lremove_pseudo, location)#
remove the *UPF files in the current directory if not required
- esta.qeBag.gen_qeinput.get_N1_N2_N3_in_MP_grid(posfile=None, location=None, l_metal_insulator=None)#
For auto-matic k-grid(taken from vasp manual):
N 1 = max(1, l ∗ | b 1 | + 0.5) N 2 = max(1, l ∗ | b 2 | + 0.5) N 3 = max(1, l ∗ | b 3 | + 0.5). Symmetry is used to map equivalent k-points to each other, which can reduce the total number of k-points significantly. Usefulvalues for the length (l) vary between 10 (large gap insulators) and 100 (d-metals).
Note
If length of lv1, lv2, lv3 > 2; then taken N1/N2/N3 = 1, acoordingly
NOTE: need testing of this method/functions????????
- esta.qeBag.gen_qeinput.get_input_parameters(cal_type=None)#
read input parameters provided by the user for different calculation types, such as scf, relax or vc-relax
- esta.qeBag.gen_qeinput.get_parameters_pseudo(loc, ps_info, atmsymbol, lcopy_pseudo=True)#
find - the min kinetic energy cutoff - the min charge density cutoff by the reading the PP header files
- input:
string: loc: location of PP files string: ps_info: PP information list: atmsymbols: atomic labels boolen: lcopy_pseudo: whether to copy PP to current dir from PP database
- output:
scalar: min kinetic enrgy cutoff scalar: min charge density cutoff
- esta.qeBag.gen_qeinput.get_qe_input(posfile, ps_info, lprint_cell='angstrom', lremove_pseudo=False, cal_type=None, lspin=None)#
generate qe input file using poscar and other input parameters
- esta.qeBag.gen_qeinput.max_scalarlist(sequence_list)#
return the max element from scalar elements of a list
- esta.qeBag.gen_qeinput.min_scalarlist(sequence_list)#
return the minimum element from scalar elements of a list
esta.qeBag.gen_qeinput2 module#
generate qe input file using poscar and other input parameters
- Input:
string, poscar filename string, pseudo-type info; e.g:
ps_info =’.pbe-kjpaw’ or .pbe-rrkjus_ for uspp
- string (optional), cell vectors in angstrom or bohr; default is angstrom
set it to bohr for veiwing the qe input file in xcrysden (version:1.5.53)
- output:
qe input file
Note
Right now only for PBE functional .. can be used for other functionals
NEEDED pseudo-potential directory; default is in ~ with location = ‘/home/sonu/pslibrary.1.0.0/pbe/PSEUDOPOTENTIALS/’
- also copy the pseudo pots mentioned in the created input file to
its location .. done
date: Jan, March 2020 author: sk, sonukumar.physics@gmail.com
- esta.qeBag.gen_qeinput2.delete_pseudo_pot(pseudo_list, lremove_pseudo, location)#
remove the *UPF files in the current directory if not required
- esta.qeBag.gen_qeinput2.get_N1_N2_N3_in_MP_grid(l_metal_insulator=None)#
For auto-matic k-grid(taken from vasp manual):
N 1 = max(1, l ∗ | b 1 | + 0.5) N 2 = max(1, l ∗ | b 2 | + 0.5) N 3 = max(1, l ∗ | b 3 | + 0.5). Symmetry is used to map equivalent k-points to each other, which can reduce the total number of k-points significantly. Usefulvalues for the length (l) vary between 10 (large gap insulators) and 100 (d-metals).
Note
If length of lv1, lv2, lv3 > 2; then taken N1/N2/N3 = 1, acoordingly
NOTE: need testing of this method/functions????????
- esta.qeBag.gen_qeinput2.get_cutoff_wfc_rho(loc, ps_info, atmsymbol, lcopy_pseudo=True)#
find - the min kinetic energy cutoff - the min charge density cutoff by the reading the PP header files
- input:
string: loc: location of PP files string: ps_info: PP information list: atmsymbols: atomic labels boolen: lcopy_pseudo: whether to copy PP to current dir from PP database
- output:
scalar: min kinetic enrgy cutoff scalar: min charge density cutoff
- esta.qeBag.gen_qeinput2.get_qe_input(posfile, ps_info, lprint_cell='angstrom', lremove_pseudo=False)#
generate qe input file using poscar and other input parameters
- esta.qeBag.gen_qeinput2.max_scalarlist(sequence_list)#
return the max element from scalar elements of a list
- esta.qeBag.gen_qeinput2.min_scalarlist(sequence_list)#
return the minimum element from scalar elements of a list
esta.qeBag.gen_qeinput_adv module#
generate qe input file using poscar and other input parameters
- Input:
string, poscar filename string, pseudo-type info; e.g:
ps_info =’.pbe-kjpaw’ or .pbe-rrkjus_ for uspp
- string (optional), cell vectors in angstrom or bohr; default is angstrom
set it to bohr for veiwing the qe input file in xcrysden (version:1.5.53)
- output:
qe input file
Note
Right now only for PBE functional .. can be used for other functionals
- NEEDED pseudo-potential directory; default is in ~ with
location = ‘/home/sonu/pslibrary.1.0.0/pbe/PSEUDOPOTENTIALS/’
author: sk, sonukumar.physics@gmail.com
- esta.qeBag.gen_qeinput_adv.delete_pseudo_pot(pseudo_list, lremove_pseudo, location)#
remove the *UPF files in the current directory if not required
- esta.qeBag.gen_qeinput_adv.get_N1_N2_N3_in_MP_grid(posfile=None, location=None, l_metal_insulator=None)#
For auto-matic k-grid(taken from vasp manual):
N 1 = max(1, l ∗ | b 1 | + 0.5) N 2 = max(1, l ∗ | b 2 | + 0.5) N 3 = max(1, l ∗ | b 3 | + 0.5). Symmetry is used to map equivalent k-points to each other, which can reduce the total number of k-points significantly. Usefulvalues for the length (l) vary between 10 (large gap insulators) and 100 (d-metals).
Note
If length of lv1, lv2, lv3 > 2; then taken N1/N2/N3 = 1, acoordingly
NOTE: need testing of this method/functions????????
- esta.qeBag.gen_qeinput_adv.get_input_parameters(cal_type=None)#
read input parameters provided by the user for different calculation types, such as scf, relax or vc-relax
- esta.qeBag.gen_qeinput_adv.get_parameters_pseudo(loc, ps_info, atmsymbol, lcopy_pseudo=True)#
find - the min kinetic energy cutoff - the min charge density cutoff by the reading the PP header files
- input:
string: loc: location of PP files string: ps_info: PP information –> changed to functional_name list: atmsymbols: atomic labels boolen: lcopy_pseudo: whether to copy PP to current dir from PP database
- output:
scalar: min kinetic enrgy cutoff scalar: min charge density cutoff
- esta.qeBag.gen_qeinput_adv.get_qe_input(posfile, ps_info, lprint_cell='angstrom', lremove_pseudo=False, cal_type=None, lspin=None)#
generate qe input file using poscar and other input parameters
- esta.qeBag.gen_qeinput_adv.max_scalarlist(sequence_list)#
return the max element from scalar elements of a list
- esta.qeBag.gen_qeinput_adv.min_scalarlist(sequence_list)#
return the minimum element from scalar elements of a list
esta.qeBag.get_bands_kpts_band_gap_adv3 module#
- esta.qeBag.get_bands_kpts_band_gap_adv3.energies_kpts(filename, epsilon=None)#
finding: -nbands, band-energies -nkpts, kpt-coordinate -band gap for spin up channel -band gap for spin down channel -band gap between valence band(of spin up/down) and cond. band (spin up/down) for unpolarised/polarised qe scf.out file
NOTE: use verbosity = ‘high’ to print the band energies
- filename: string
name of scf.out file with verbosity high to be used in qe pw.x calculation
- epsilontolerance for occupation of energy levels from 1 and 0
default is 0.05 (=> level with occupation 0.95 is assumed to be fully occupied i.e. occupation is 1; similary level with occupation 0.05 is assumed to be completely empty i.e. occupation is 0.)
bandgap: scalar for a given spin/s channels band energies kpts
better see the output:
- if lspin:
return energies, coord_kpts, band_gap_up, band_gap_down, band_gap, lspin, occupations
- else:
return energies, coord_kpts, band_gap_up, None, None, lspin, occupations
esta.qeBag.get_output_qe module#
- esta.qeBag.get_output_qe.get_fermi(infile, lspin=False)#
- esta.qeBag.get_output_qe.get_fermi2(infile)#
- esta.qeBag.get_output_qe.get_forces(infile)#
find Forces acting on atoms (cartesian axes, Ry/au): and print forces in eV/Ang
force values… … … … … …
- esta.qeBag.get_output_qe.get_natoms(infile)#
- esta.qeBag.get_output_qe.get_pressure(infile)#
- esta.qeBag.get_output_qe.get_total_energy(infile)#
- esta.qeBag.get_output_qe.qe_warning()#
read output file of qe code and find: - no of atoms - forces on each atom; average force on each atom - pressure - total energy (last one in the file) - Fermi energy (last one)
Author: sk, sonukumar.physics@gmail.com
esta.qeBag.get_xyz_from_qe_rlxout module#
- esta.qeBag.get_xyz_from_qe_rlxout.get_xyz(filename, optimized=None)#
read qe output file to extract xyz file/files
- esta.qeBag.get_xyz_from_qe_rlxout.get_xyz_all(filename, comment=None)#
read qe output file to extract set of atomic positions into xyz files
filename: string, name of the qe output relaxation file or vc-relaxation file
symbol: list of strings consisting of atomic labels position: array of all atomic positions with shape (number_of_rlx_cycles, natoms, 3)
esta.qeBag.neb_qe module#
- class esta.qeBag.neb_qe.neb#
Bases:
object
python class
1) –to generate supercard along with its contents such as
BEGIN_POSITIONS … content of the supercard here … END_POSITIONS
for details see documentation of neb.x manual link: https://www.quantum-espresso.org/Doc/INPUT_NEB.html
2) – to store data (atom no, no of images, atomic symbols,
atomic positions) from *axsf data
– to generate xyz files from *axsf file from xcrysden
3) – to read pathx files; where x = 0, 1, 2, ….
and then create xyz files …….
4) – read xsf file and store data (atomic number, symbols, atomic positions) from xsf file – create poscar file from xsf file.
more will be added according to the needs …TODO
author: skumar email: sonukumar.physics@gmail.com
- get_grouped_list(llist)#
get same string elements of list grouped together
- get_neach_type(inp)#
get number of list entries of each type
- Returns
list of integers for each type of atoms specifying their number
- get_symbol_from_atomic_number(atomic_num)#
return list of atomic symbols from list of atomic numbers
- get_unique_list(inp)#
get unique elements of list
- Returns
string for each type of atoms
- np = <module 'numpy' from '/home/sonu/anaconda3/envs/py3a/lib/python3.7/site-packages/numpy/__init__.py'>#
- read_axsf(axsf_file)#
str: *axsf file name
rank 3 array: atomic positions: array: rank 3 array of shape (nimages, natoms, 3) list of strings: atomic labels: list/array of strings: rank 1 array of atomic labels scalar: no of images/number of structures rank 2 array: cell vectors rank 3 array: forces on atoms of shape (nimage, natoms, 3)
- read_path(path_file, qe_input)#
rank 3 array: atomic positions: array: rank 3 array of shape (nimages, natoms, 3) list of strings: atomic labels: list/array of strings: rank 1 array of atomic labels scalar: no of images/number of structures rank 3 array: forces on atoms of shape (nimage, natoms, 3) scalar: energy
- return (self.pos_path, self.label_qe_neb,
self.no_strs_path, self.force_path, self.energy_path)
- read_xsf(xsf_file)#
str: *xsf file name
rank 2 array: atomic positions: array: rank 3 array of shape (natoms, 3) list of strings: atomic labels: list/array of strings: rank 1 array of atomic labels rank 2 array: cell vectors rank 2 array: forces on atoms of shape (natoms, 3)
- read_xyz(xyzfiles)#
filenames: list of str, filename xyz file names
atomic positions: array: rank 2 array of shape (natoms, 3) atomic labels: list/array of strings: rank 1 array of atomic labels
- to_poscar(latvec, pos, label, filename='POSCAR', extension='xsf')#
str: filename for the output poscar file; default POSCAR str: extension ; redundant variable; default is xsf file rank 2 array: lattice vectors: latvec rank 2 array: atomic positions: pos list of string : atomic labels: label
or better pass an atom object to this method/function
POSCAR file
- to_xyz_file(pos, label, filename=None, extension='xsf')#
str: filename str: filename extension (e.g. xsf )
atomic positions atomic labels
or better pass an atom object to this method/function
xyz file
- to_xyz_files(filename, extension, qe_neb_input=None)#
str: filename str: filename extension (e.g. axsf or path file from NEB calc of qe)
#atomic positions #atomic labels #no of atoms #no of images
or better pass an atom object to this method/function
xyz files in for NEB calculations
- to_xyz_plus_delta_files(pos, label, no_strs, filename, extension, qe_neb_input=None)#
rank2 array: atomic positions list: atomic labels scalar: no of images
str: filename str: filename extension (e.g. axsf or path file from NEB calc of qe)
or better pass an atom object to this method/function
xyz files with displaced atoms according to vibration pattern or some other displacement vectors for each atomic position
- write_position_card(xyzfiles, atom_fix_index=None)#
xyzfiles: list of strings containg names of the xyz files atom_fix_index: list of atom numbers starting from 1 to be fixed in
supercard containing atomic positions for all xzy strs for NEB calculations
NOTE: output of this method: …
BEGIN_POSITIONS FIRST_IMAGE ATOMIC_POSITIONS { angstrom } –
INTERMEDIATE_IMAGE ATOMIC_POSITIONS { angstrom } – INTERMEDIATE_IMAGE ATOMIC_POSITIONS { angstrom } –
– LAST_IMAGE ATOMIC_POSITIONS { angstrom } – – END_POSITIONS
esta.qeBag.neb_qe1 module#
- class esta.qeBag.neb_qe1.neb#
Bases:
object
python class
1) –to generate supercard along with its contents such as
BEGIN_POSITIONS … content of the supercard here … END_POSITIONS
for details see documentation of neb.x manual link: https://www.quantum-espresso.org/Doc/INPUT_NEB.html
2) – to store data (atom no, no of images, atomic symbols,
atomic positions) from *axsf data
– to generate xyz files from *axsf file from xcrysden
3) – to read pathx files; where x = 0, 1, 2, ….
and then create xyz files …….todo
more will be added according to the needs …TODO
author: skumar email: sonukumar.physics@gmail.com date: July, 2020 Place: QCL, ICReDD, Japan
- np = <module 'numpy' from '/home/sonu/anaconda3/envs/py3a/lib/python3.7/site-packages/numpy/__init__.py'>#
- read_axsf(axsf_file)#
str: *axsf file name
rank 3 array: atomic positions: array: rank 3 array of shape (nimages, natoms, 3) list of strings: atomic labels: list/array of strings: rank 1 array of atomic labels scalar: no of images/number of structures rank 2 array: cell vectors rank 3 array: forces on atoms of shape (nimage, natoms, 3)
- read_path(path_file, qe_input)#
rank 3 array: atomic positions: array: rank 3 array of shape (nimages, natoms, 3) list of strings: atomic labels: list/array of strings: rank 1 array of atomic labels scalar: no of images/number of structures rank 3 array: forces on atoms of shape (nimage, natoms, 3) scalar: energy
- return (self.pos_path, self.label_qe_neb,
self.no_strs_path, self.force_path, self.energy_path)
- read_xyz(xyzfiles)#
filenames: list of str, filename xyz file names
atomic positions: array: rank 2 array of shape (natoms, 3) atomic labels: list/array of strings: rank 1 array of atomic labels
- to_xyz_files(filename, extension, qe_neb_input=None)#
str: filename str: filename extension (e.g. axsf or path file from NEB calc of qe)
#atomic positions #atomic labels #no of atoms #no of images
or better pass an atom object to this method/function
xyz files in for NEB calculations
- to_xyz_plus_delta_files(pos, label, no_strs, filename, extension, qe_neb_input=None)#
rank2 array: atomic positions list: atomic labels scalar: no of images
str: filename str: filename extension (e.g. axsf or path file from NEB calc of qe)
or better pass an atom object to this method/function
xyz files with displaced atoms according to vibration pattern or some other displacement vectors for each atomic position
- write_position_card(xyzfiles)#
list of strings containg xyz files names atomic postions atomic labels
supercard containing atomic positions for all xzy strs for NEB calculations
NOTE:
BEGIN_POSITIONS FIRST_IMAGE ATOMIC_POSITIONS { angstrom } –
INTERMEDIATE_IMAGE ATOMIC_POSITIONS { angstrom } – INTERMEDIATE_IMAGE ATOMIC_POSITIONS { angstrom } –
– LAST_IMAGE ATOMIC_POSITIONS { angstrom } – – END_POSITIONS
esta.qeBag.parse_pseudo module#
- esta.qeBag.parse_pseudo.parse_pseudoUPF(filename)#
read data of UPF file in xml section
filename: name of the pseudo potential UPF file
pseudo potential information of an element or set of elements in a chemical system
esta.qeBag.pspot_core_states module#
- esta.qeBag.pspot_core_states.id_orb2_indx(id_orb)#
change atomic orbital id name to id number
- input:
string: e.g. S, P, D, and F
- output:
scalar: e.g 0, 1, 2, and 3
- esta.qeBag.pspot_core_states.read_UPF_xml(filename, index=- 1)#
Parse pseudo core states from UPF xml; UPF version=”2.0.1”
string: UPF file for a specific atom; e.g: Ni.pbe-n-rrkjus_psl.1.0.0.UPF
string: file containing core states needed for XAS spectra
esta.qeBag.rate_const_adv module#
rate constant calculations
for A* —> B* kind of surface reaction or similar reaction
rate constant ~ r = A * exp ( -Ea/kbT )
- where:
A = ( kb * T/ h ) * (q_vib_TS / q_vib_A*) q = vib partition function = product_i (1/(1-expt(-h*nu_i / kbT)) )
- esta.qeBag.rate_const_adv.get_rate_constant(q_part_is, q_part_ts, energy_barrier, temp)#
get the rate constant of elementray steps
q_part_is: scalar, partition function for the initial state q_part_ts: scalar, partition function for the transition state energy_barrier: scalar, activation energy barrier going from initial to transition state in eV units temp: scalar, tempature of the reaction in K units
rate_const: scalar, rate constant in s^(-1)
- esta.qeBag.rate_const_adv.q_partition(vib_energies_data, temp)#
calculate the partition function based on given vib energies and temp
vib_energies: array of length 3*natoms temp: scalar , temperature in K
q_partition: scalar, parition function
- esta.qeBag.rate_const_adv.read_freq_data(filename, freq_dft)#
read freq data from file generated using qe phonon finite diff caclulations
filename: string, name of the file containing freq data freq_dft: logical, whether dft calculated freq or expt or else..
- vib_energies: array, filtered vib freq data (below 50 cm-1 freqs
are changed to 50 cm-1 by default)
esta.qeBag.read_dynmat_adv module#
- esta.qeBag.read_dynmat_adv.read_dynamical_matrix_q0(filename, natm_type, posfile=None)#
read dyanmatrix at q=(0 0 0) point to find the force constant between atoms as well as corresponding distance between atoms
- filename: string
name of the dynamical martrix file
- natm_type: list
for no. of atoms of each types; e.g. [4, 4, 14] for 3type of atoms
- posfile: str
name of the poscar file, optional
NOTE: lattice is cubic see .f90 file in qe code:
- e.g see: SUBROUTINE write_old_dyn_mat_head(iudyn) in io_dyn_mat_old.f90
or other .f90 files ….
esta.qeBag.read_write module#
- class esta.qeBag.read_write.RWpwi(infile, outfile=None)#
Bases:
object
class to read the pw input file and create poscar file
- Returns
generate poscar file after reading the pw input file
- get_grouped_list(llist)#
get same string elements of list grouped together
- get_neach_type(inp)#
get number of list entries of each type
- Returns
list of integers for each type of atoms specifying their
- get_poscar()#
write cell_parameters and atomic postions, atom labels etc in poscar file
- get_unique_list(inp)#
get unique elements of list
- Returns
string for each type of atoms
- class esta.qeBag.read_write.RWpwo(infile, outfile=None)#
Bases:
object
Class to read and write data file for the atomic structures
read cell parmeters and/or atomic positions
write this data in xyz, poscar, and qe-str format
- get_atm_positions()#
find atom positions with labels …
- get_cell_parameters()#
- Returns
cell vectors in angstrom or bohr
what is does:
- for ‘rlx’ calculations:
- search:
“lattice parameter (alat)” “crystal axes: (cart. coord. in units of alat)”
- for ‘vc-relax’ calculations:
search: ‘CELL_PARAMETERS (angstrom)’
…
- get_element_label(input_atomic_number)#
using mendeleev for it : big database of elemental properties
In [22]: from mendeleev import element In [21]: for i in [5,6,7,8]: …: element(i) …: print (element(i).symbol) …: B C N O
- get_energies_and_kpt()#
get the band energies at k point by reading the scf calculation out file
NOTE: Need verbosity =’high’ in the scf input file to print the band energies
- get_grouped_list(llist)#
get same string elements of list grouped together
- get_natoms()#
- get_neach_type(inp)#
get number of list entries of each type
- Returns
list of integers for each type of atoms specifying their number
- get_poscar()#
write cell_parameters and atomic postions, atom labels etc in poscar file
- get_unique_list(inp)#
get unique elements of list
- Returns
string for each type of atoms
- get_xyz_file()#
- get xyz file by reading the atomic positions and atomic labels: use method
get_atm_positions(infile)
- Returns
write data in xyz file specified by name outfile
- Return type
outfile
- IMPORTANT: ordeing same elements together: not done yet .. to be done..
- get_xyz_grouped_file()#
- get xyz file by reading the atomic positions and atomic labels: use method
get_atm_positions(infile)
- Returns
write data in xyz file specified by name outfile
- Return type
outfile
NOTE: similar atoms are grouped together
- classmethod vector_prod(a, b)#
esta.qeBag.read_write0 module#
- class esta.qeBag.read_write0.RWpwi(infile, outfile=None)#
Bases:
object
class to read the pw input file and create poscar file
- Returns
generate poscar file after reading the pw input file
- get_grouped_list(llist)#
get same string elements of list grouped together
- get_neach_type(inp)#
get number of list entries of each type
- Returns
list of integers for each type of atoms specifying their
- get_poscar()#
write cell_parameters and atomic postions, atom labels etc in poscar file
- get_unique_list(inp)#
get unique elements of list
- Returns
string for each type of atoms
- class esta.qeBag.read_write0.RWpwo(infile, outfile=None)#
Bases:
object
Class to read and write data file for the atomic structures
read cell parmeters and/or atomic positions
write this data in xyz, poscar, and qe-str format
- get_atm_positions()#
find atom positions with labels …
- get_cell_parameters()#
- Returns
cell vectors in angstrom or bohr
- what is does:
- search:
“lattice parameter (alat)” “crystal axes: (cart. coord. in units of alat)”
…
- get_element_label(input_atomic_number)#
using mendeleev for it : big database of elemental properties
In [22]: from mendeleev import element In [21]: for i in [5,6,7,8]: …: element(i) …: print (element(i).symbol) …: B C N O
- get_energies_and_kpt()#
get the band energies at k point by reading the scf calculation out file
NOTE: Need verbosity =’high’ in the scf input file to print the band energies
- get_grouped_list(llist)#
get same string elements of list grouped together
- get_natoms()#
- get_neach_type(inp)#
get number of list entries of each type
- Returns
list of integers for each type of atoms specifying their number
- get_poscar()#
write cell_parameters and atomic postions, atom labels etc in poscar file
- get_unique_list(inp)#
get unique elements of list
- Returns
string for each type of atoms
- get_xyz_file()#
- get xyz file by reading the atomic positions and atomic labels: use method
get_atm_positions(infile)
- Returns
write data in xyz file specified by name outfile
- Return type
outfile
- IMPORTANT: ordeing same elements together: not done yet .. to be done..
- get_xyz_grouped_file()#
- get xyz file by reading the atomic positions and atomic labels: use method
get_atm_positions(infile)
- Returns
write data in xyz file specified by name outfile
- Return type
outfile
NOTE: similar atoms are grouped together
- classmethod vector_prod(a, b)#
esta.qeBag.sum_pdos_atom module#
- esta.qeBag.sum_pdos_atom.sum_pdos()#
I have s,p (also d, but not at the moment) PDOS calculated for several atoms. I want to have a sum for all atoms. Separately s and p.
for s we have
Energy, LDOS, PDOS columns
for p we have
Energy, LDOS, Pz-PDOS, Px-PDOS, Py-PDOS
- find sum for all atoms (= Energy, Sum of LDOS, Sum of Pz-PDOS,
Sum of Px-PDOS, Sum of Py-PDOS).
- **NOTE: in a single directory keep on one type of states of atoms (may be same or different
atoms); e.g. s, p, or d only for B atoms !!***
author: skumar date: 18, Feb, 2021
tested by Andrey Lyalin on Feb, 2021
esta.qeBag.xbands_kpts_band_gap module#
- esta.qeBag.xbands_kpts_band_gap.energies_kpts(filename)#
finding: -nbands, band-energies -nkpts, kpt-coordinate -band gap for spin up channel -band gap for spin down channel -band gap between valence band(of spin up/down) and cond. band (spin up/down) for unpolarised/polarised qe scf.out file
NOTE: use verbosity = ‘high’ to print the band energies
- input:
name of scf.out file with verbosity high to be used in qe pw.x calculation
esta.qeBag.xml_qe module#
- esta.qeBag.xml_qe.get_poscar(infile)#
write poscar file from xml file of qe
string: infile (data-file-schema.xml)
poscar file
- esta.qeBag.xml_qe.read_qe_xml(filename, index=- 1)#
Parse data-file-schema.xml or another *xml file of qe version 6.4.1/6.2
- string: ‘data-file-schema.xml’ or input xml file containing crystal str and electronic
str. information of calculations carrired out by qe code
array: unit cell in bohr, array: atomic positions in bohr, character: atomic symbols array: forces .. … many other parameters present in the xml file ..
# with scipy version 1.1.0 #bohr radius= 5.2917721067e-11 m ; less accurate #fac = cf.bohr2ang =0.529177210669 –< – less accuaret and # as a result atoms pos and cell param are wrong after 6 dec # places #In scipy version 1.4.1 #bohr radiun = 5.29177210903e-11 m; is same as given # in nist data ; https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0 #Numerical value 5.291 772 109 03 x 10-11 m #fac = 0.529177210903 # does not work #fac = np.array( 0.529177210903 , dtype=np.float128)
#qe 6.2 and .6.4.1 uses # REAL(DP), PARAMETER :: & # BOHR_RADIUS_SI = 0.52917720859E-10_DP ! m
author: ‘skumar’ email: ‘sonukumar.physics@gmail.com’
esta.qeBag.zpe module#
calculation of zero point energy in eV
- esta.qeBag.zpe.get_freq(filename)#
get vibration freq from qe phonon output file in cm-1
- input:
str, ph output file
- output:
tuple of array and string, vibration freqs in cm-1 #and eV