pyxtal.io module

This module handles reading and write crystal files.

pyxtal.io.in_merged_coords(wp, pt, pts, cell)[source]

Whether or not the pt in within the pts

pyxtal.io.read_cif(filename)[source]

read the cif, mainly for pyxtal cif output Be cautious in using it to read other cif files

Parameters:

filename – path of the structure file

Returns:

pyxtal structure

pyxtal.io.search_molecules_in_crystal(struc, tol=0.2, once=False, ignore_HH=True)[source]

Function to perform to find the molecule in a Pymatgen structure

Parameters:
  • struc – Pymatgen Structure

  • tol – tolerance value to check the connectivity

  • once – search only one molecule or all molecules

  • ignore_HH – whether or not ignore the short H-H in checking molecule

Returns:

list of pymatgen molecules positions: list of center positions

Return type:

molecules

class pyxtal.io.structure_from_ext(struc, ref_mols, tol=0.2, ignore_HH=False, add_H=False, hn=None)[source]

Bases: object

add_Hydrogens(smile, xyz)[source]

add hydrogen for pymtagen molecule

align()[source]

compute the orientation wrt the reference molecule

make_mol_sites()[source]

generate the molecular wyckoff sites

resort(molecules)[source]
show(overlay=True)[source]
pyxtal.io.write_cif(struc, filename=None, header='', permission='w', sym_num=None, style='mp')[source]

Export the structure in cif format The default setting for _atom_site follows the materials project cif

Parameters:
  • struc – pyxtal structure object

  • filename – path of the structure file

  • header – additional information

  • permission – write(w) or append(a+) to the given file

  • sym_num – the number of symmetry operations, None means writing all symops

  • styleicsd or mp (used in pymatgen)