Automator

Automator:

The automator module defines functions that create a tarball from a supercell dictionary.

Automator code

Functions to convert from a supercell dictionary (output from a Diffuser) into a tarball that contains all of the input files in an organized directory structure to run the atomic-scale transition state calculations. This includes:

  1. All positions in POSCAR format (POSCAR files for states to relax, POS as reference for transition endpoints that need to be relaxed)

  2. Transformation information from relaxed states to initial states.

  3. INCAR files for relaxation and NEB runs; KPOINTS for each.

  4. perl script to transform CONTCAR output from a state relaxation to NEB endpoints.

  5. perl script to linearly interpolate between NEB endpoints.*

  6. Makefile to run NEB construction.

Note: the NEB interpolator script (nebmake.pl) is part of the VTST scripts.

automator.map2string(tag, groupop, mapping)[source]

Takes in a map: tag, groupop, mapping and constructs a string representation to be dumped to a file. If we want to call using the tuple, map2string(*(map)) will suffice.

Parameters
  • tag – string of initial state to rotate

  • groupop – see crystal.GroupOp; we use the rot and trans. This is in the supercell coord.

  • mapping – in “chemorder” format; list by chemistry of lists of indices of position in initial cell to use.

Return string_rep

string representation (to be used by an external script)

automator.supercelltar(tar, superdict, filemode=436, directmode=509, timestamp=None, INCARrelax='SYSTEM = {system}\nPREC = High\nISIF = 2\nEDIFF = 1E-8\nEDIFFG = -10E-3\nIBRION = 2\nNSW = 50\nISMEAR = 1\nSIGMA = 0.1\n# ENCUT =\n# NGX =\n# NGY =\n# NGZ =\n# NGXF =\n# NGYF =\n# NGZF =\n# NPAR =\nLWAVE = .FALSE.\nLCHARG = .FALSE.\nLREAL = .FALSE.\nVOSKOWN = 1\n', INCARNEB='SYSTEM = {system}\nPREC = High\nISIF = 2\nEDIFF = 1E-8\nEDIFFG = -10E-3\nIBRION = 2\nNSW = 50\nISMEAR = 1\nSIGMA = 0.1\n# ENCUT =\n# NGX =\n# NGY =\n# NGZ =\n# NGXF =\n# NGYF =\n# NGZF =\n# NPAR =\nLWAVE = .FALSE.\nLCHARG = .FALSE.\nLREAL = .FALSE.\nVOSKOWN = 1\nIMAGES = 1\nSPRING = -5\nLCLIMB = .TRUE.\nNELMIN = 4\nNFREE = 10\n', KPOINTS='Gamma\n1\nReciprocal\n0. 0. 0. 1.\n', basedir='', statename='relax.', transitionname='neb.', IDformat='{:02d}', JSONdict='tags.json', YAMLdef='supercell.yaml')[source]

Takes in a tarfile (needs to be open for writing) and a supercelldict (from a diffuser) and creates the full directory structure inside the tarfile. Best used in a form like

with tarfile.open('supercells.tar.gz', mode='w:gz') as tar:
    automator.supercelltar(tar, supercelldict)
Parameters
  • tar – tarfile open for writing; may contain other files in advance.

  • superdict

    dictionary of states, transitions, transmapping, indices that correspond to dictionaries with tags; the final tag reference is the basesupercell for calculations without defects.

    • superdict[‘states’][i] = supercell of state;

    • superdict[‘transitions’][n] = (supercell initial, supercell final);

    • superdict[‘transmapping’][n] = ((site tag, groupop, mapping), (site tag, groupop, mapping))

    • superdict[‘indices’][tag] = (type, index) of tag, where tag is either a state or transition tag; or…

    • superdict[‘indices’][tag] = index of tag, where tag is either a state or transition tag.

    • superdict[‘reference’] = (optional) supercell reference, no defects

  • filemode – mode to use for files (default: 664)

  • directmode – mode to use for directories (default: 775)

  • timestamp – UNIX time for files; if None, use current time (default)

  • INCARrelax – contents of INCAR file to use for relaxation; must contain {system} to be replaced by tag value (default: automator.INCARrelax)

  • INCARNEB – contents of INCAR file to use for NEB; must contain {system} to be replaced by tag value (default: automator.INCARNEB)

  • KPOINTS – contents of KPOINTS file (default: gamma-point only calculation); if None or empty, no KPOINTS file at all

  • basedir – prepended to all files/directories (default: ‘’)

  • statename – prepended to all state names, before 2 digit number (default: relax.)

  • transitionname – prepended to all transition names, before 2 digit number (default: neb.)

  • IDformat – format for integer tags (default: {:02d})

  • JSONdict – name of JSON file storing the tags corresponding to each directory (default: tags.json)

  • YAMLdef – YAML file containing full definition of supercells, relationship, etc. (default: supercell.yaml); set to None to not output. may want to change this to None for the future