aiida_crystal17.parsers.geometry module¶
This module deals with reading/creating .gui files for use with the EXTERNAL keyword
File Format
dimesionality origin_setting crystal_type energy(optional)
a_x a_y a_z
b_x b_y b_z
c_x c_y c_z
num_symm_ops (in cartesian coordinates)
op1_rot_00 op1_rot_01 op1_rot_02
op1_rot_10 op1_rot_11 op1_rot_12
op1_rot_20 op1_rot_21 op1_rot_22
op1_trans_0 op1_trans_1 op1_trans_2
...
num_atoms (if cryversion<17 irreducible atoms only)
atomic_number x y z (in cartesian coordinates)
...
space_group_int_num num_symm_ops
-
aiida_crystal17.parsers.geometry.
ase_to_structdict
(atoms)[source]¶ convert ase.Atoms to struct dict
Return structdict: dict containing ‘lattice’, ‘atomic_numbers’, ‘pbc’, ‘ccoords’, ‘equivalent’
-
aiida_crystal17.parsers.geometry.
cart2frac
(lattice, ccoords)[source]¶ a function that takes the cell parameters, in angstrom, and a list of Cartesian coordinates and returns the structure in fractional coordinates
-
aiida_crystal17.parsers.geometry.
compute_symmetry_3d
(structdata, standardize, primitive, idealize, symprec, angletol)[source]¶ create 3d geometry input for CRYSTAL17
Parameters: - structdata – “lattice”, “atomic_numbers”, “ccoords”, “pbc” and (optionally) “equivalent”
- standardize – whether to standardize the structure
- primitive – whether to create a primitive structure
- idealize – whether to idealize the structure
- symprec – symmetry precision to parse to spglib
- angletol – angletol to parse to spglib
Returns: (structdata, symmdata)
-
aiida_crystal17.parsers.geometry.
crystal17_gui_string
(structdata, symmdata, fractional_ops=True)[source]¶ create string of gui file content (for CRYSTAL17)
Parameters: - structdata – dictionary of structure data with keys: ‘pbc’, ‘atomic_numbers’, ‘ccoords’, ‘lattice’
- symmdata – dictionary of symmetry data with keys: ‘crystal_type’, ‘centring_code’, ‘space_group’, ‘operations’
- fractional_ops – whether the symmetry operations are in fractional coordinates
Returns:
-
aiida_crystal17.parsers.geometry.
dict_to_structure
(structdict, logger=None)[source]¶ create a dictionary of structure properties per atom
Param: dictionary containing; ‘lattice’, ‘atomic_numbers’ (or ‘symbols’), ‘ccoords’, ‘pbc’, ‘kinds’, ‘equivalent’ Parameters: logger – a logger with a warning method Return structure: the input structure Rtype structure: aiida.orm.data.structure.StructureData
-
aiida_crystal17.parsers.geometry.
frac2cart
(lattice, fcoords)[source]¶ a function that takes the cell parameters, in angstrom, and a list of fractional coordinates and returns the structure in cartesian coordinates
-
aiida_crystal17.parsers.geometry.
get_centering_code
(sg_number, sg_symbol)[source]¶ get crystal centering codes, to convert from primitive to conventional
Parameters: - sg_number – the space group number
- sg_symbol – the space group symbol
Returns: CRYSTAL centering code
-
aiida_crystal17.parsers.geometry.
get_crystal_system
(sg_number, as_number=False)[source]¶ Get the crystal system for the structure, e.g., (triclinic, orthorhombic, cubic, etc.) from the space group number
Parameters: - sg_number – the spacegroup number
- as_number – return the system as a number (recognized by CRYSTAL) or a str
Returns: Crystal system for structure or None if system cannot be detected.
-
aiida_crystal17.parsers.geometry.
get_lattice_type
(sg_number)[source]¶ Get the lattice for the structure, e.g., (triclinic, orthorhombic, cubic, etc.).This is the same than the crystal system with the exception of the hexagonal/rhombohedral lattice
Parameters: sg_number – space group number Returns: Lattice type for structure or None if type cannot be detected.
-
aiida_crystal17.parsers.geometry.
ops_cart_to_frac
(ops_flat, lattice)[source]¶ convert a list of flattened cartesian symmetry operations to fractional
-
aiida_crystal17.parsers.geometry.
ops_frac_to_cart
(ops_flat, lattice)[source]¶ convert a list of flattened fractional symmetry operations to cartesian
-
aiida_crystal17.parsers.geometry.
read_gui_file
(fpath, cryversion=17)[source]¶ read CRYSTAL geometry (.gui) file
Parameters: - fpath (str or pathlib.Path) – path to file
- cryversion (int) – version of CRYSTAL
Returns:
-
aiida_crystal17.parsers.geometry.
structdict_to_ase
(structdict)[source]¶ convert struct dict to ase.Atoms
Parameters: structdict – dict containing ‘lattice’, ‘atomic_numbers’, ‘pbc’, ‘ccoords’, ‘equivalent’ Return type: ase.Atoms
-
aiida_crystal17.parsers.geometry.
structure_to_dict
(structure)[source]¶ create a dictionary of structure properties per atom
Parameters: structure (aiida.orm.data.structure.StructureData) – the input structure Returns: dictionary containing; lattice, atomic_numbers, ccoords, pbc, kinds, equivalent Return type: dict