Skip to content

esta

esta

EStA (electronic structure analyzer) aka pytware for analyzing and calculating the electronic structure of molecules and materials.

.. note:: More to implement... such as TB models, transport related problems etc. Some keywords are: lattice thermal transport in with and without defects; electronic structure TB calculations; heterogeneous catalysis

.. image:: /home/sonu/ipython_exercises/setpy_creation/esta-2.6.1/logo/esta_logo2.6.0_cropped.png :width: 100 :height: 100 :alt: The EStA logo.

CrystalLattice

Crystal lattice class to define lattice parameters and basis; crystal = lattice + basis (atoms or molecules )

Author: Sonu Kumar Email: sonukumar.physics@gmail.com

Date: April, 2017 updates:2019, 2020, 2022

get_atm_symbol property

by reading POSCAR, find the atomic labels of the atoms

to_cartesian property

get atomic position in cartesin cooridnates

to_crystal property

get atomic position in crystal cooridnates

is_crystal property

check if atom positions in crytal coordinates

is_cartesian property

check if atom positions in cartesian coordinates

get_rVolume property

get real space lattice volume

get_volume property

get real space lattice volume

get_cell_vectors property

geta tuple of set of three cell/lattice vectors lv1, lv2, and lv3 in c-style format

get_cell_matrix property

get lattice matrix of three cell/lattice vectors lv1, lv2, and lv3 in c-style format or fortran stype format default is c style format.

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

is_selective_dynamics property

check whether selective dynamics True or False

read_poscar(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

read_poscar_adv(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove, self.atomFixDir else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

get_poscar()

XXXXXXXXXXXXXXXXXXXXXXXXXX---DEPRECATED-------DEPRECATED ------------------XXXXXXXXXXXXXXXXXXXXXX ** get_poscar is deprecated; use read_poscar instead!! ** read poscar file present in the current dir or in the location specified.

get_reciprocal_lattice()

return the reciprocal lattice vectors
input: real space lattice vectors: LV1, LV2, LV3 output: reciprocal space lattice vectors: b1, b2, b3 - note: a factor of 2pi is included in b1, b2, and b3

reciprocal_lattice()

deprecated: method to calculate the reciprocal lattice vectors

get_all_atoms_labels()

by reading POSCAR, find the atomic labels of the atoms and total no of atoms

Parameters:
string: POSCAR file in current dir.
Return:
list : strings of atomic lebels of all atoms according to the numbering of atoms in POSCAR file
scalar: total number of atoms in the POSCAR file
list:  integer numbers starting from 1 to ntotal for all atoms(e.g. 1 1 1 2 3 4 4 ..)

author: sk email: sonukumar.physics@gmail.com

get_unique_list(inp)

get unique elements of list

return: string for each type of atoms

get_grouped_list(llist)

get same string elements of list grouped together

get_neach_type(inp)

get number of list entries of each type

return:

  list of integers for each type of atoms specifying their number

get_selectivePOSCAR(ldisp=True, disp_atoms_num=None, outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings; e.g: ["1-2", '3']

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_selectivePOSCAR_adv(ldisp=True, disp_atoms_num=None, fix_direction=None, coord='cartesian', outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings to be fixed during DFT relaxation; e.g: ["1-2", '3']

  • fix_direction

    x, y, or z direciton; by default atoms are fixed in all directions

  • coord

    cartesian or direct coordinates; default: cartesian

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_dispPOSCAR(ldisp=None, disp_atoms_num=None)

deprecated: use get_selectivePOSCAR

Xlat

Crystal lattice class to define lattice parameters and basis; crystal = lattice + basis (atoms or molecules )

Author: Sonu Kumar Email: sonukumar.physics@gmail.com

Date: April, 2017 updates:2019, 2020, 2022

get_atm_symbol property

by reading POSCAR, find the atomic labels of the atoms

to_cartesian property

get atomic position in cartesin cooridnates

to_crystal property

get atomic position in crystal cooridnates

is_crystal property

check if atom positions in crytal coordinates

is_cartesian property

check if atom positions in cartesian coordinates

get_rVolume property

get real space lattice volume

get_volume property

get real space lattice volume

get_cell_vectors property

geta tuple of set of three cell/lattice vectors lv1, lv2, and lv3 in c-style format

get_cell_matrix property

get lattice matrix of three cell/lattice vectors lv1, lv2, and lv3 in c-style format or fortran stype format default is c style format.

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

is_selective_dynamics property

check whether selective dynamics True or False

read_poscar(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

read_poscar_adv(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove, self.atomFixDir else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

get_poscar()

XXXXXXXXXXXXXXXXXXXXXXXXXX---DEPRECATED-------DEPRECATED ------------------XXXXXXXXXXXXXXXXXXXXXX ** get_poscar is deprecated; use read_poscar instead!! ** read poscar file present in the current dir or in the location specified.

get_reciprocal_lattice()

return the reciprocal lattice vectors
input: real space lattice vectors: LV1, LV2, LV3 output: reciprocal space lattice vectors: b1, b2, b3 - note: a factor of 2pi is included in b1, b2, and b3

reciprocal_lattice()

deprecated: method to calculate the reciprocal lattice vectors

get_all_atoms_labels()

by reading POSCAR, find the atomic labels of the atoms and total no of atoms

Parameters:
string: POSCAR file in current dir.
Return:
list : strings of atomic lebels of all atoms according to the numbering of atoms in POSCAR file
scalar: total number of atoms in the POSCAR file
list:  integer numbers starting from 1 to ntotal for all atoms(e.g. 1 1 1 2 3 4 4 ..)

author: sk email: sonukumar.physics@gmail.com

get_unique_list(inp)

get unique elements of list

return: string for each type of atoms

get_grouped_list(llist)

get same string elements of list grouped together

get_neach_type(inp)

get number of list entries of each type

return:

  list of integers for each type of atoms specifying their number

get_selectivePOSCAR(ldisp=True, disp_atoms_num=None, outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings; e.g: ["1-2", '3']

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_selectivePOSCAR_adv(ldisp=True, disp_atoms_num=None, fix_direction=None, coord='cartesian', outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings to be fixed during DFT relaxation; e.g: ["1-2", '3']

  • fix_direction

    x, y, or z direciton; by default atoms are fixed in all directions

  • coord

    cartesian or direct coordinates; default: cartesian

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_dispPOSCAR(ldisp=None, disp_atoms_num=None)

deprecated: use get_selectivePOSCAR

Aadhaar

aadhaar class for atomic structure related information handling.

natom property

get no. of atoms

atm_position property

get atom positions

atm_symbol property

get atom symbols

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

__init__()

initialize the class

read_xyz(xyzfile)

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

get_fix_atom(fix=None)

return the fix atoms with starting from 0; on input fix contains numbering starting from 1

xyz_as_pdf()

get xyz data in the panda data frame with first line for tags for atoms, and coordinates

xyz_as_csv(csvfile=None, savefile=None)

get xyz data in the csv data format

..not this ...with first line as comment (atom symbTag, and x, y,z)

read_xyz_tagged(xyzfile)

read xyz file with some positions tagged as Fixed by placing F in the 4th column of the xyz file

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

read_xyz_all(xyzfile)

read xyz data in get all xyz file by reading the atomic positions and atomic labels.

Parameters

string: str name of xyz file containgin many xyz data structures

Returns:

  • array ( array of rank 3 with shape (nstrs, natoms, 3) ) –

    atomic positions

  • list ( a list of strings ) –

    strings/symbols for the atomic labels

write_xyz_all_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_poscar(cell_parameter, pos, label, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, and atom labels. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_poscar_selective(cell_parameter, pos, label, fix_tag=None, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, atom labels, and fix_tag. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • fix_tag

    list of list containgin tag for atom fixing, e.g [['F','F','F'], ['T','T','T'], .... to natoms]

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_xyz_file(atomic_position, atomic_label, fix_index=None, fix_dir=None, name_outfile=None)

create XYZ file from the atomic positions and atomic labels.

Parameters

atomic_position: array of rank 2 or shape of (natoms, 3) atomic positions with shape (natoms, 3) atomic_label: str list list of atomic labels fix_index: list (optional) list of atoms to be fixed with numbering from 1; e.g. ['1','2','10'] (The resulting xyz file contains F or T for after the x y z coordinates in the same line) fix_dir : list (optional) [TODO .... this is not working properly if it not None ... testing needed .... see ] direction of fix, e.g. xyz (all directions if used for the time being) name_outfile: str, optional prefix for the output file

get_xyz_o(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file given the atomic positions and atomic labels and energies.

Note

xyz_o with o means single file

energy and comment are independent of each other NOW!

get_xyz_grouped(atomic_position, atomic_label, name_outfile=None)

create XYZ file from the atomic positions and atomic labels. name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are grouped together.

get_all_xyz_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_all_xyz_in_a_file(atomic_position, atomic_label, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels.

name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are NOT grouped together.

get_all_xyz_in_a_file_(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies. comment True then energy is printed in comment section. .. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024

get_all_xyz_in_a_file__(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None, **extra)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies.

If comment is True then energy must be present!! **kwargs are added so as to pass addition arguments!!

.. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024 The dictionary extra keyword must be "no.", otherwise error message is emitted

get_axsf(position, symbol, lv, eigen_disp=None, factor=None, name_outfile=None)

get axsf file given xyz data (or xyz file or POSCAR file) and displacements of displaced-atoms/moving atoms

Parameters:

xyzobject

lv: array lattice vectors matrix lv[3,3] with rows as lattice vectors (c-style, opposite to Fortran-style)

eigen_disp: array eigen displacements vectors of shape (3*natom, natom,3) (note sometimes all atoms are displaced and sometimes only few are displace)

Returns:

axsf file for viewing with xcryden

.. format of axsf file

ANIMSTEPS 2 CRYSTAL PRIMVEC 20.1192283600 0.0000000000 0.0000000000 0.0000000000 27.0000000000 0.0000000000 0.0000000000 0.0000000000 17.0000000000 PRIMCOORD 1 5 1 H 11.2498769970 13.8121424280 4.3686516620 -0.0000942577 -0.0000152115 0.0005174206 H 12.5137322430 15.0793556060 1.8688610990 0.0003968067 -0.0001103587 -0.0009433925 H 13.2963873660 13.8030528830 2.8291899960 0.0000467070 0.0000647718 -0.0006208035 H 14.1576884440 15.3238761340 2.5101912960 0.0001419676 -0.0000543467 -0.0006737093 H 13.6497403220 14.1378762940 5.3369092520 -0.0004499922 -0.0000278449 0.0006083637 PRIMCOORD 2 5 1 H 11.2355725044 13.5305891253 4.3477591403 0.0001368359 -0.0000037193 0.0015032442 H 12.3273729886 14.6920409122 1.7133173515 0.0002135816 0.0000056774 -0.0003496343 H 13.2074926046 13.5157335368 2.7144034122 0.0002043936 -0.0001109390 -0.0004939726 H 13.9830728189 15.0490029986 2.2619945638 0.0001662968 -0.0000176645 -0.0002263822 H 13.6135087175 14.0164433539 5.2070257688 -0.0003970061 0.0001379729 0.0006418720

get_all_xyz_in_eqlist_format(atomic_position, atomic_label, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: energy, spin, zpe, and normal mode eigenvalues are made zero in utput in *eq_list.log file; need to check if grrm code accepts this or not?

get_all_xyz_in_eqlist_format_adv(atomic_position, atomic_label, energy, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: spin, zpe, and normal mode eigenvalues are made zero in outout *eq_list.log file; need to check if grrm code accepts this or not?

get_xyz_frozen(frozen_tuple, not_frozan_tuple, name_outfile=None)

get xyz data with frozan and not frozen atoms in the output file.

Parameters:

  • frozen_tuple (tuple) –

    tuple containg fixed atomic_positins, atomic_symbols, and atom index

  • not_frozen_tuple (tuple) –

    tuple containg not fixed atomic_positins, atomic_symbols, and atom index

  • name_outfile

    name of the output file

Returns:

  • name of xyz_frozen_file : str

    create 'xyz_FROZEN' type file containing information of frozen and not frozen atoms etc

get_xyz_oniom_file(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None)

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3 more to do later!!

get_com_oniom(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile, kwargss, l_oniom_gaussian=None)

input oniom file generation

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

Note

move these methods to grrmBag for clarity

Note

update 2024: now gaussian:ONIOM+PM6 type file for GRRM can be genereated/ but remove the lines afer option part and add one line space in end of *com file

get_com_oniom_min(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

input oniom file for MIN calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_restruct(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_infile=None, name_outfile=None, **kwargs)

input oniom for ReStruct calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_frozen(frozen_tuple, not_frozan_tuple, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

create oniom input file with frozen atoms for MIN calculations (default)

The high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_fix_indices(ref_atm_id=None, direction=None, distance=None, exclude_type=None)

return atom indices with are to be fixed

ref_atm_id MUST be included in the fix indices.

Parametes

ref_atm_id: int reference atom wrt to which atoms are to be selected direction: str direction alogn which atoms are to be selected distance: float distance range along the direction. For example, if it is yz, then some distance along y and z direction is selected (all vals of x allowed) to select the atoms exclude_type: list of str atom symbols to be excluded from the selection

Returns:

  • close_atoms_ ( list of atoms indices ) –

    list of all atoms close to ref atom along a direction

Note
ref_atm_id = 54
direction = 'y'
distance= 1 # ang (+1 and -1 Ang along y direction)
exclude_type = None # type of atoms to exclude; eg. ['B', 'H'] 2 types of atoms

Xyz

aadhaar class for atomic structure related information handling.

natom property

get no. of atoms

atm_position property

get atom positions

atm_symbol property

get atom symbols

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

__init__()

initialize the class

read_xyz(xyzfile)

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

get_fix_atom(fix=None)

return the fix atoms with starting from 0; on input fix contains numbering starting from 1

xyz_as_pdf()

get xyz data in the panda data frame with first line for tags for atoms, and coordinates

xyz_as_csv(csvfile=None, savefile=None)

get xyz data in the csv data format

..not this ...with first line as comment (atom symbTag, and x, y,z)

read_xyz_tagged(xyzfile)

read xyz file with some positions tagged as Fixed by placing F in the 4th column of the xyz file

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

read_xyz_all(xyzfile)

read xyz data in get all xyz file by reading the atomic positions and atomic labels.

Parameters

string: str name of xyz file containgin many xyz data structures

Returns:

  • array ( array of rank 3 with shape (nstrs, natoms, 3) ) –

    atomic positions

  • list ( a list of strings ) –

    strings/symbols for the atomic labels

write_xyz_all_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_poscar(cell_parameter, pos, label, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, and atom labels. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_poscar_selective(cell_parameter, pos, label, fix_tag=None, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, atom labels, and fix_tag. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • fix_tag

    list of list containgin tag for atom fixing, e.g [['F','F','F'], ['T','T','T'], .... to natoms]

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_xyz_file(atomic_position, atomic_label, fix_index=None, fix_dir=None, name_outfile=None)

create XYZ file from the atomic positions and atomic labels.

Parameters

atomic_position: array of rank 2 or shape of (natoms, 3) atomic positions with shape (natoms, 3) atomic_label: str list list of atomic labels fix_index: list (optional) list of atoms to be fixed with numbering from 1; e.g. ['1','2','10'] (The resulting xyz file contains F or T for after the x y z coordinates in the same line) fix_dir : list (optional) [TODO .... this is not working properly if it not None ... testing needed .... see ] direction of fix, e.g. xyz (all directions if used for the time being) name_outfile: str, optional prefix for the output file

get_xyz_o(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file given the atomic positions and atomic labels and energies.

Note

xyz_o with o means single file

energy and comment are independent of each other NOW!

get_xyz_grouped(atomic_position, atomic_label, name_outfile=None)

create XYZ file from the atomic positions and atomic labels. name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are grouped together.

get_all_xyz_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_all_xyz_in_a_file(atomic_position, atomic_label, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels.

name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are NOT grouped together.

get_all_xyz_in_a_file_(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies. comment True then energy is printed in comment section. .. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024

get_all_xyz_in_a_file__(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None, **extra)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies.

If comment is True then energy must be present!! **kwargs are added so as to pass addition arguments!!

.. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024 The dictionary extra keyword must be "no.", otherwise error message is emitted

get_axsf(position, symbol, lv, eigen_disp=None, factor=None, name_outfile=None)

get axsf file given xyz data (or xyz file or POSCAR file) and displacements of displaced-atoms/moving atoms

Parameters:

xyzobject

lv: array lattice vectors matrix lv[3,3] with rows as lattice vectors (c-style, opposite to Fortran-style)

eigen_disp: array eigen displacements vectors of shape (3*natom, natom,3) (note sometimes all atoms are displaced and sometimes only few are displace)

Returns:

axsf file for viewing with xcryden

.. format of axsf file

ANIMSTEPS 2 CRYSTAL PRIMVEC 20.1192283600 0.0000000000 0.0000000000 0.0000000000 27.0000000000 0.0000000000 0.0000000000 0.0000000000 17.0000000000 PRIMCOORD 1 5 1 H 11.2498769970 13.8121424280 4.3686516620 -0.0000942577 -0.0000152115 0.0005174206 H 12.5137322430 15.0793556060 1.8688610990 0.0003968067 -0.0001103587 -0.0009433925 H 13.2963873660 13.8030528830 2.8291899960 0.0000467070 0.0000647718 -0.0006208035 H 14.1576884440 15.3238761340 2.5101912960 0.0001419676 -0.0000543467 -0.0006737093 H 13.6497403220 14.1378762940 5.3369092520 -0.0004499922 -0.0000278449 0.0006083637 PRIMCOORD 2 5 1 H 11.2355725044 13.5305891253 4.3477591403 0.0001368359 -0.0000037193 0.0015032442 H 12.3273729886 14.6920409122 1.7133173515 0.0002135816 0.0000056774 -0.0003496343 H 13.2074926046 13.5157335368 2.7144034122 0.0002043936 -0.0001109390 -0.0004939726 H 13.9830728189 15.0490029986 2.2619945638 0.0001662968 -0.0000176645 -0.0002263822 H 13.6135087175 14.0164433539 5.2070257688 -0.0003970061 0.0001379729 0.0006418720

get_all_xyz_in_eqlist_format(atomic_position, atomic_label, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: energy, spin, zpe, and normal mode eigenvalues are made zero in utput in *eq_list.log file; need to check if grrm code accepts this or not?

get_all_xyz_in_eqlist_format_adv(atomic_position, atomic_label, energy, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: spin, zpe, and normal mode eigenvalues are made zero in outout *eq_list.log file; need to check if grrm code accepts this or not?

get_xyz_frozen(frozen_tuple, not_frozan_tuple, name_outfile=None)

get xyz data with frozan and not frozen atoms in the output file.

Parameters:

  • frozen_tuple (tuple) –

    tuple containg fixed atomic_positins, atomic_symbols, and atom index

  • not_frozen_tuple (tuple) –

    tuple containg not fixed atomic_positins, atomic_symbols, and atom index

  • name_outfile

    name of the output file

Returns:

  • name of xyz_frozen_file : str

    create 'xyz_FROZEN' type file containing information of frozen and not frozen atoms etc

get_xyz_oniom_file(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None)

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3 more to do later!!

get_com_oniom(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile, kwargss, l_oniom_gaussian=None)

input oniom file generation

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

Note

move these methods to grrmBag for clarity

Note

update 2024: now gaussian:ONIOM+PM6 type file for GRRM can be genereated/ but remove the lines afer option part and add one line space in end of *com file

get_com_oniom_min(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

input oniom file for MIN calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_restruct(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_infile=None, name_outfile=None, **kwargs)

input oniom for ReStruct calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_frozen(frozen_tuple, not_frozan_tuple, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

create oniom input file with frozen atoms for MIN calculations (default)

The high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_fix_indices(ref_atm_id=None, direction=None, distance=None, exclude_type=None)

return atom indices with are to be fixed

ref_atm_id MUST be included in the fix indices.

Parametes

ref_atm_id: int reference atom wrt to which atoms are to be selected direction: str direction alogn which atoms are to be selected distance: float distance range along the direction. For example, if it is yz, then some distance along y and z direction is selected (all vals of x allowed) to select the atoms exclude_type: list of str atom symbols to be excluded from the selection

Returns:

  • close_atoms_ ( list of atoms indices ) –

    list of all atoms close to ref atom along a direction

Note
ref_atm_id = 54
direction = 'y'
distance= 1 # ang (+1 and -1 Ang along y direction)
exclude_type = None # type of atoms to exclude; eg. ['B', 'H'] 2 types of atoms

Xat

aadhaar class for atomic structure related information handling.

natom property

get no. of atoms

atm_position property

get atom positions

atm_symbol property

get atom symbols

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

__init__()

initialize the class

read_xyz(xyzfile)

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

get_fix_atom(fix=None)

return the fix atoms with starting from 0; on input fix contains numbering starting from 1

xyz_as_pdf()

get xyz data in the panda data frame with first line for tags for atoms, and coordinates

xyz_as_csv(csvfile=None, savefile=None)

get xyz data in the csv data format

..not this ...with first line as comment (atom symbTag, and x, y,z)

read_xyz_tagged(xyzfile)

read xyz file with some positions tagged as Fixed by placing F in the 4th column of the xyz file

Parameters

xyzfile: str name of xyz file, xyzfile

Returns:

  • pos ( array ) –

    atomic positions (rank 2 with shape (natoms, 3))

  • label ( list ) –

    list of atomic labels, rank 1 array of atomic labels

  • natoms ( scalar ) –
  • comment ( str ) –

    atom coords are in ang

read_xyz_all(xyzfile)

read xyz data in get all xyz file by reading the atomic positions and atomic labels.

Parameters

string: str name of xyz file containgin many xyz data structures

Returns:

  • array ( array of rank 3 with shape (nstrs, natoms, 3) ) –

    atomic positions

  • list ( a list of strings ) –

    strings/symbols for the atomic labels

write_xyz_all_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_poscar(cell_parameter, pos, label, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, and atom labels. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_poscar_selective(cell_parameter, pos, label, fix_tag=None, name_outfile=None)

create POSCAR file given the cell_parameters, atomic postions, atom labels, and fix_tag. Optionally the name of output POSCAR can be provided. When dealing with mutliple POSCAR file, better to provide the name of the output POSCAR file.

Parameters:

  • cell_parameter

    lattice vectors in the form np.array([lv1, lv2, lv3])

  • pos

    atomic positions

  • label

    strings of atomic symbols

  • fix_tag

    list of list containgin tag for atom fixing, e.g [['F','F','F'], ['T','T','T'], .... to natoms]

  • name_outfile

    name of the output POSCAR file

Returns:

  • generates POSCAR file with name = name_outfile

get_xyz_file(atomic_position, atomic_label, fix_index=None, fix_dir=None, name_outfile=None)

create XYZ file from the atomic positions and atomic labels.

Parameters

atomic_position: array of rank 2 or shape of (natoms, 3) atomic positions with shape (natoms, 3) atomic_label: str list list of atomic labels fix_index: list (optional) list of atoms to be fixed with numbering from 1; e.g. ['1','2','10'] (The resulting xyz file contains F or T for after the x y z coordinates in the same line) fix_dir : list (optional) [TODO .... this is not working properly if it not None ... testing needed .... see ] direction of fix, e.g. xyz (all directions if used for the time being) name_outfile: str, optional prefix for the output file

get_xyz_o(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file given the atomic positions and atomic labels and energies.

Note

xyz_o with o means single file

energy and comment are independent of each other NOW!

get_xyz_grouped(atomic_position, atomic_label, name_outfile=None)

create XYZ file from the atomic positions and atomic labels. name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are grouped together.

get_all_xyz_separate(xyzfile, comment=None)

write xyz_all data into separate xyz files

get_all_xyz_in_a_file(atomic_position, atomic_label, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels.

name_outfile is the prefix for the output file Note that the similar atoms (identical symbols) are NOT grouped together.

get_all_xyz_in_a_file_(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies. comment True then energy is printed in comment section. .. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024

get_all_xyz_in_a_file__(atomic_position, atomic_label, energy=None, name_outfile=None, comment=None, **extra)

create single XYZ file for all xyz strcutures given the atomic positions and atomic labels and energies.

If comment is True then energy must be present!! **kwargs are added so as to pass addition arguments!!

.. note:: The similar atoms (identical symbols) are grouped together. ?confirm THIS..TODO 19-04-2024 The dictionary extra keyword must be "no.", otherwise error message is emitted

get_axsf(position, symbol, lv, eigen_disp=None, factor=None, name_outfile=None)

get axsf file given xyz data (or xyz file or POSCAR file) and displacements of displaced-atoms/moving atoms

Parameters:

xyzobject

lv: array lattice vectors matrix lv[3,3] with rows as lattice vectors (c-style, opposite to Fortran-style)

eigen_disp: array eigen displacements vectors of shape (3*natom, natom,3) (note sometimes all atoms are displaced and sometimes only few are displace)

Returns:

axsf file for viewing with xcryden

.. format of axsf file

ANIMSTEPS 2 CRYSTAL PRIMVEC 20.1192283600 0.0000000000 0.0000000000 0.0000000000 27.0000000000 0.0000000000 0.0000000000 0.0000000000 17.0000000000 PRIMCOORD 1 5 1 H 11.2498769970 13.8121424280 4.3686516620 -0.0000942577 -0.0000152115 0.0005174206 H 12.5137322430 15.0793556060 1.8688610990 0.0003968067 -0.0001103587 -0.0009433925 H 13.2963873660 13.8030528830 2.8291899960 0.0000467070 0.0000647718 -0.0006208035 H 14.1576884440 15.3238761340 2.5101912960 0.0001419676 -0.0000543467 -0.0006737093 H 13.6497403220 14.1378762940 5.3369092520 -0.0004499922 -0.0000278449 0.0006083637 PRIMCOORD 2 5 1 H 11.2355725044 13.5305891253 4.3477591403 0.0001368359 -0.0000037193 0.0015032442 H 12.3273729886 14.6920409122 1.7133173515 0.0002135816 0.0000056774 -0.0003496343 H 13.2074926046 13.5157335368 2.7144034122 0.0002043936 -0.0001109390 -0.0004939726 H 13.9830728189 15.0490029986 2.2619945638 0.0001662968 -0.0000176645 -0.0002263822 H 13.6135087175 14.0164433539 5.2070257688 -0.0003970061 0.0001379729 0.0006418720

get_all_xyz_in_eqlist_format(atomic_position, atomic_label, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: energy, spin, zpe, and normal mode eigenvalues are made zero in utput in *eq_list.log file; need to check if grrm code accepts this or not?

get_all_xyz_in_eqlist_format_adv(atomic_position, atomic_label, energy, name_outfile=None, comment=None)

create single *EQ_list.log file from all xyz strcutures given the atomic positions and atomic labels. Note that the similar atoms (identical symbols) are grouped together.

.. note:: spin, zpe, and normal mode eigenvalues are made zero in outout *eq_list.log file; need to check if grrm code accepts this or not?

get_xyz_frozen(frozen_tuple, not_frozan_tuple, name_outfile=None)

get xyz data with frozan and not frozen atoms in the output file.

Parameters:

  • frozen_tuple (tuple) –

    tuple containg fixed atomic_positins, atomic_symbols, and atom index

  • not_frozen_tuple (tuple) –

    tuple containg not fixed atomic_positins, atomic_symbols, and atom index

  • name_outfile

    name of the output file

Returns:

  • name of xyz_frozen_file : str

    create 'xyz_FROZEN' type file containing information of frozen and not frozen atoms etc

get_xyz_oniom_file(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None)

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3 more to do later!!

get_com_oniom(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile, kwargss, l_oniom_gaussian=None)

input oniom file generation

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

Note

move these methods to grrmBag for clarity

Note

update 2024: now gaussian:ONIOM+PM6 type file for GRRM can be genereated/ but remove the lines afer option part and add one line space in end of *com file

get_com_oniom_min(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

input oniom file for MIN calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_restruct(atomic_position, atomic_label, iatm_high_level, link_lowhigh_level_atoms, name_infile=None, name_outfile=None, **kwargs)

input oniom for ReStruct calculations

create XYZ file from the atomic positions, atomic labels, and integers representing atoms in the high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_com_oniom_frozen(frozen_tuple, not_frozan_tuple, iatm_high_level, link_lowhigh_level_atoms, name_outfile=None, **kwargs)

create oniom input file with frozen atoms for MIN calculations (default)

The high level layer (iatm_high_level) for Oniom software. Atoms in high level layer are indexed with integers starting from 1, not from 0.

.. note:: link_lowhigh_level_atoms is optionalm but it should have entries like this [[4,3],[15,3],[20,3] ] → meaning that low levels atoms are 4,15,20 → link to high level atom 3

other input files (6 in number; total of 7 files needed to execute the oniom calculations) needed should be → MoH.inp, MoL.inp, ReL.inp, OniomGRRM, Ownoniom.tcsh, Ownoniom.out (check the names again sk!!)

.. note:: move these methods to grrmBag for clarity

get_fix_indices(ref_atm_id=None, direction=None, distance=None, exclude_type=None)

return atom indices with are to be fixed

ref_atm_id MUST be included in the fix indices.

Parametes

ref_atm_id: int reference atom wrt to which atoms are to be selected direction: str direction alogn which atoms are to be selected distance: float distance range along the direction. For example, if it is yz, then some distance along y and z direction is selected (all vals of x allowed) to select the atoms exclude_type: list of str atom symbols to be excluded from the selection

Returns:

  • close_atoms_ ( list of atoms indices ) –

    list of all atoms close to ref atom along a direction

Note
ref_atm_id = 54
direction = 'y'
distance= 1 # ang (+1 and -1 Ang along y direction)
exclude_type = None # type of atoms to exclude; eg. ['B', 'H'] 2 types of atoms

XTB

Bases: GenericFileIOCalculator

xTB calculator

__init__(profile: XTBProfile | None = None, directory: Path | str = '.', method: Literal['gfn0-xtb', 'gfn1-xtb', 'gfn2-xTB', 'gfn-ff'] = 'gfn2-xtb', charge: int = 0, uhf: int = 0, spinpol: bool | None = None, **kwargs) -> None

Initialize the xTB calculator.

Parameters:

  • profile (XTBProfile | None, default: None ) –

    An instantiated [xtb_ase.calculator.XTBProfile][] object to use.

  • directory (Path | str, default: '.' ) –

    The path to the directory to run the xTB calculation in.

  • method (Literal['gfn0-xtb', 'gfn1-xtb', 'gfn2-xTB', 'gfn-ff'], default: 'gfn2-xtb' ) –

    The xTB method to use. Case-insensitive.

  • charge (int, default: 0 ) –

    The net charge of the system.

  • uhf (int, default: 0 ) –

    The number of unpaired electrons in the system.

  • spinpol (bool | None, default: None ) –

    Whether to use spin-polarized xTB. If None, spinpol will be automatically set to True if uhf > 0.

  • **kwargs

    Any additional xTB parameters to be written out to a detailed input file, e.g. in the format of scc={"temp": 500}. See https://github.com/grimme-lab/xtb/blob/main/man/xcontrol.7.adoc.

Returns:

  • None

XTBProfile

xTB profile

__init__(argv: list[str] | None = None) -> None

Initialize the xTB profile.

Parameters:

  • argv (list[str] | None, default: None ) –

    The command line arguments to the xTB executable, e.g. ["xtb", "--tblite"]. Do not specify an input file, i.e. --input (-I), or the geometry file, as these will be automatically added.

Returns:

  • None

run(directory: Path | str, input_filename: str, geom_filename: str, output_filename: str) -> None

Run the xTB calculation.

Parameters:

  • directory (Path | str) –

    The directory where the calculation will be run.

  • input_filename (str) –

    The name of the input file present in the directory.

  • geom_filename (str) –

    The name of the coordinates file present in the directory.

  • output_filename (str) –

    The name of the log file to write to in the directory.

Returns:

  • None