pos2pkl.py
2023 July 23 update
Script to convert structre data into init_struc_data.pkl. The default input format is init_POSCARS. Single structure data such as POSCAR and cif files can be optionally converted. Output is init_struc_data.pkl. Structure data can be added to an already existing init_struc_data.pkl. The structure ID is not taken into account and is newly assigned. If the number of atoms is different, an error is generated.
init_struc_data.pkl can be loaded at the start of the simulation in CrySPY.
You can remove and sort species with -f option. Note that without this option, pymatgen will sort the species in electronegativity order!
Usage
Examples
init_POSCARS –> init_struc_data.pkl
It can be used to convert init_POSCARS generated by CrySPY to init_struc_data.pkl in another machine such as a supercomputer. Multiple input files can be converted.
If you put the pos2pkl.py in your PATH, you can omit python3.
Multiple inputs:
If init_struc_data.pkl already exists in the current directory and you want to append to it:
POSCAR or cif –> init_struc_data.pkl
Single structure data such as POSCAR and cif files can also be converted. -s/--single option is required.
init_POSCARS, POSCAR –> init_struc_data.pkl
Warning
The following is wrong. The init_POSCARS is also treated as a single structure.
Filter (Remove and Sort)
Here we consider a cif file with the composition of Sr8 Co8 O20 X4,
including 4 dummy atoms (X4).
-f/--filter option can be used to remove and sort species.
Specify the same as atype in cryspy.in.
With extract_struc.py you can see how it was registered in init_struc_data.pkl.
-f option can allow you to sort.