Loading Initial Structures
Last updated: October 16, 2026
Prepared structures can be used as the initial structures for a search.
Setting load_struc_flag = True in the [option] section of cryspy.in loads ./data/pkl_data/init_struc_data.pkl on the first run. The default is False.
If fewer structures are loaded than required, the remaining structures are generated randomly.
Usage
See Tutorial > Loading Initial Structures for an example that converts three CIF files and loads the resulting data.
CrySPY Utility’s pos2pkl.py can convert structure files to init_struc_data.pkl.
Checks During Loading
The following conditions are checked when loading. If a condition is not satisfied, an error is raised and initialization stops.
- The data in
init_struc_data.pklmust be a dictionary. - Structure IDs must be consecutive integers starting from
0: for example,0,1, and2for three structures. - Each structure must be a pymatgen
Structureobject. - The number of structures must not exceed the limit below.
| Algorithm | Maximum number of structures |
|---|---|
| EA, EA-vc | n_pop |
| RS, BO, LAQA | tot_struc |
See Data Format > Initial and Optimized Structure Data for format details.
Atom Types, Atom Counts, and Composition Checks
In RS, BO, LAQA, and EA, the atom types and the number of atoms of each type must match atype and nat. Structures with different atom counts cannot be used, even if their composition ratios are the same.
In EA-vc, the following conditions are checked.
| Item | Condition |
|---|---|
| Atom types | Only atom types listed in atype are present. |
| Atom counts | Each atom count is within the bounds specified by ll_nat and ul_nat, and the structure contains at least one atom in total. |
| Composition constraints | Any composition range specified by min_comp or max_comp is satisfied. |
| Charge neutrality | If charge is specified, neutrality can be achieved with a combination of the specified oxidation states. |
See Composition Constraints and Charge Neutrality Condition for details.
The loading checks do not enforce mindist, space-group constraints, or cell-volume constraints.
Filling Missing Structures
If fewer structures are loaded than tot_struc or n_pop, the remaining structures are generated randomly.
Additional structures receive consecutive IDs following the last loaded ID.
The loaded and additional structures are saved together to ./data/pkl_data/init_struc_data.pkl and ./data/init_POSCARS.