sisl.io.siesta.stdoutSileSiesta
- class sisl.io.siesta.stdoutSileSiesta(filename, *args, **kwargs)
Bases:
SileSiesta
Output file from Siesta
This enables reading the output quantities from the Siesta output.
Methods
base_directory
([relative_to])Retrieve the base directory of the file, relative to the path relative_to
close
()True if the full file has been read and "Job completed" was found.
dir_file
([filename, filename_base])File of the current Sile
read
(*args, **kwargs)Generic read method which should be overloaded in child-classes
Reads the basis as found in the output file
read_charge
(name[, iscf, imd, key_scf, ...])Read charges calculated in SCF loop or MD loop (or both)
read_data
(*args, **kwargs)Read specific content in the Siesta out file
Reads the final energy distribution
write
(*args, **kwargs)Generic write method which should be overloaded in child-classes
File of the current Sile
File of the current Sile
Handles all plotting possibilities for a class
- __init__(filename, mode='r', *args, **kwargs)
Just to pass away the args and kwargs
- base_directory(relative_to='.')
Retrieve the base directory of the file, relative to the path relative_to
- property base_file
File of the current Sile
- close()
- dir_file(filename=None, filename_base='')
File of the current Sile
- property file
File of the current Sile
- plot
Handles all plotting possibilities for a class
- read(*args, **kwargs)
Generic read method which should be overloaded in child-classes
- Parameters:
kwargs – keyword arguments will try and search for the attribute
read_<>
and call it with the remaining**kwargs
as arguments.
- read_basis() Atoms [source]
Reads the basis as found in the output file
This parses 3 things:
At the start of the file there are some initatom output specifying which species in the calculation.
Reading the <basis_specs> entries for the masses
Reading the PAO.Basis block output for orbital information
- Return type:
- read_charge(name, iscf=<Opt.ANY: 2>, imd=<Opt.ANY: 2>, key_scf='scf', as_dataframe=False)[source]
Read charges calculated in SCF loop or MD loop (or both)
Siesta enables many different modes of writing out charges.
NOTE: currently Mulliken charges are not implemented.
The below table shows a list of different cases that may be encountered, the letters are referred to in the return section to indicate what is returned.
Case
A
B
C
D
E
Charge
MD
SCF
MD+SCF
Final
Orbital resolved
Voronoi
Hirshfeld
Mulliken
Notes
Errors will be raised if one requests information not present. I.e. passing an integer or Opt.ALL for iscf will raise an error if the SCF charges are not present. For Opt.ANY it will return the most information, effectively SCF will be returned if present.
Currently Mulliken is not implemented, any help in reading this would be very welcome.
- Parameters:
name ({"voronoi", "hirshfeld"}) – the name of the charges that you want to read
iscf (int or Opt, optional) – index (0-based) of the scf iteration you want the charges for. If the enum specifier Opt.ANY or Opt.ALL are used, then the returned quantities depend on what is present. If
None/Opt.NONE
it will not return any SCF charges. If both imd and iscf areNone
then only the final charges will be returned.imd (int or Opt, optional) – index (0-based) of the md step you want the charges for. If the enum specifier Opt.ANY or Opt.ALL are used, then the returned quantities depend on what is present. If
None/Opt.NONE
it will not return any MD charges. If both imd and iscf areNone
then only the final charges will be returned.key_scf (str, optional) – the key lookup for the scf iterations (a “:” will automatically be appended)
as_dataframe (boolean, optional) – whether charges should be returned as a pandas dataframe.
- Returns:
numpy.ndarray – if a specific MD+SCF index is requested (or special cases where output is not complete)
list of numpy.ndarray – if one both iscf or imd is different from
None/Opt.NONE
.pandas.DataFrame – if as_dataframe is requested. The dataframe will have multi-indices if multiple SCF or MD steps are requested.
- read_data(*args, **kwargs)[source]
Read specific content in the Siesta out file
The currently implemented things are denoted in the parameters list. Note that the returned quantities are in the order of keywords, so:
>>> read_data(geometry=True, force=True) <geometry>, <force> >>> read_data(force=True, geometry=True) <force>, <geometry>
- Parameters:
geometry (bool, optional) – read geometry, args are passed to
read_geometry
force (bool, optional) – read force, args are passed to
read_force
stress (bool, optional) – read stress, args are passed to
read_stress
moment (bool, optional) – read moment, args are passed to
read_moment
(only for spin-orbit calculations)energy (bool, optional) – read final energies, args are passed to
read_energy
- read_energy() PropertyDict [source]
Reads the final energy distribution
Currently the energies translated are:
band
band structure energy
kinetic
electronic kinetic energy
hartree
electronic electrostatic Hartree energy
dftu
DFT+U energy
spin_orbit
spin-orbit energy
extE
external field energy
xc
exchange-correlation energy
exchange
exchange energy
correlation
correlation energy
bulkV
bulk-bias correction energy
total
total energy
negf
NEGF energy
fermi
Fermi energy
ion.electron
ion-electron interaction energy
ion.ion
ion-ion interaction energy
ion.kinetic
kinetic ion energy
basis.enthalpy
enthalpy of basis sets, Free + p_basis*V_orbitals
Any unrecognized key gets added as is.
Examples
>>> energies = sisl.get_sile("RUN.out").read_energy() >>> ion_energies = energies.ion >>> ion_energies.ion # ion-ion interaction energy >>> ion_energies.kinetic # ion kinetic energy >>> energies.fermi # fermi energy
- Returns:
PropertyDict
- Return type:
dictionary like lookup table ionic energies are stored in a nested PropertyDict at the key
ion
(all energies in eV)
- write(*args, **kwargs)
Generic write method which should be overloaded in child-classes
- Parameters:
**kwargs – keyword arguments will try and search for the attribute write_ and call it with the remaining
**kwargs
as arguments.