pychemia.code.abinit package¶
Set of classes and functions to manipulate
ABINIT ‘.in’ input files ABINIT ‘.files’ files ABINIT ‘_OUT.nc’ output files
Subpackages¶
Submodules¶
pychemia.code.abinit.abifiles module¶
-
class
pychemia.code.abinit.abifiles.
AbiFiles
(*args, **kwargs)[source]¶ Bases:
object
Read an ‘abinit.files’ file and extract the names of input, output filenames and put them into dictionary called ‘files’.
-
basedir
= '.'¶
-
execute
(abinit_binary)[source]¶ Utility that copy a given script and execute the given command inside the directory
-
filename
= 'abinit.files'¶
-
files
= {'in': 'abinit.in', 'out': 'abinit.out', 'tmpin': 'abinit-i', 'tmpout': 'abinit-o', 'tmp': 'abinit', 'psps': ''}¶
-
pychemia.code.abinit.abinit module¶
-
class
pychemia.code.abinit.abinit.
AbinitJob
[source]¶ Bases:
pychemia.code.codes.Codes
-
initialize
(workdir, structure=None, input_file='abinit.in', binary='abinit', psp_kind='FHI', psp_exchange='LDA')[source]¶ Initialize the mandatory variables for a AbinitJob
Parameters: - psp_kind – (str) Source of Pseudopotentials
- psp_exchange – (str) ‘LDA’ or ‘GGA’
- workdir – (str) The directory where the input files will be
- structure – (pychemia.Structure) A pychemia structure for the input
- input_file – (str) Input file for ABINIT
- binary – (str) The name or path for the ABINIT binary file
Returns:
-
pychemia.code.abinit.htmlparser module¶
pychemia.code.abinit.input module¶
-
class
pychemia.code.abinit.input.
InputVariables
(*args, **kwargs)[source]¶ Bases:
collections.abc.MutableMapping
An input object contains:
- data:
- variables = Dictionary whose keys are ABINIT variable names
- methods:
- write = Write the input into as a text file that ABINIT
- can use as an input file
get_value = Get the value of a particular variable set_value = Set the value of a particular variable
get_atomic_structure =
-
atom_name
(iatom, idtset='')[source]¶ Return the name of the atom and the position in the list of atoms such as H3, N4, etc
-
from_structure
(structure)[source]¶ Set input variables for a given structure
Parameters: structure – (pychemia.Structure) Structure to set ABINIT input variables Returns:
-
get_dtsets_keys
()[source]¶ Get the list of dtset suffix acording to the values given by ndtset, jdtset and udtset
-
get_structure
(idtset=None, units='bohr')[source]¶ Return the atomic structure from the input object for a given dataset (no dataset by default)
-
get_value
(varname, idtset=None, return_iterable=False)[source]¶ Get the value of the input variable ‘varname’ associated with the dataset ‘idtset’ If ‘idtset’ is not given will asume that the value is not dataset dependent
-
set_value
(varname, value, idtset='')[source]¶ Set the value ‘value’ into the dictionary input with key ‘varname’+str(idtset) The value could be an integer, real, list or numpy array, the internal representation is always serializable.
-
pychemia.code.abinit.input.
merge
(abi_into, abi_from, filename=None)[source]¶ From the variables present in the file ‘abi_into’ will try to recover the value from ‘abi_from’ if the value has changed, the value will be updated.
The new variables will be save in the given filename If filename==None the new values will overwrite abi_into
Example:
merge(‘abinit.in’,’abinit_xo_OUT.nc’)It will update the abinit input with the values of the output
Parameters: - abi_into – (str) Merge abinit variables using this destination
- abi_from – (str) and this source
- filename – (str) Storing the final input variables on file
pychemia.code.abinit.output module¶
pychemia.code.abinit.parser module¶
-
pychemia.code.abinit.parser.
parser
(filename)[source]¶ Take a filename and returns a dictionary of ABINIT input variables
The values on each key are lists of numbers The values are converted to atomic units always that it found other variables (eV, angstrom, etc) Repetitions are expanded (3*1.5 => [1.5 1.5 1.5])
- Args:
- filename:
- Path for an ABINIT input file
- Returns:
- inputvars:
- Dictionary, the keys are names of variables and the values are list of numbers.
pychemia.code.abinit.utils module¶
-
pychemia.code.abinit.utils.
netcdf2dict
(filename)[source]¶ Read a NetCDF file and create a python dictionary with numpy arrays for variables
- Args:
- filename:
- NetCDF filename
-
pychemia.code.abinit.utils.
psp_name
(atomicnumber, exchange, kind)[source]¶ Return the filename of a certain PSP given the atomic number, exchange (‘LDA’ or ‘GGA’) and kind (‘FHI’,’TM’)
Parameters: - atomicnumber – (int) Atomic number
- exchange – (str) ‘LDA’ or ‘GGA’
- kind – (str) Source of Pseudopotentials
Returns: