Loading Initial Structures
Last updated: October 16, 2026
This tutorial creates init_struc_data.pkl from three CIF files and loads the structures as initial structures.
The example is an RS search for eight Cu atoms: three structures are loaded and two more are generated randomly, giving five initial structures in total.
See Features > Loading Initial Structures for details of the loading checks.
Preparation
Prepare cryspy.in and calc_in/ in a new working directory as in Tutorial > Random Search (RS) > ASE on Your Local PC.
Use the same ase_in.py and job_cryspy files in calc_in/. Do not run cryspy yet.
Conversion uses CrySPY Utility’s pos2pkl.py. The commands below assume that pos2pkl.py is on your PATH. See Installation > CrySPY Utility for setup.
Download the following example CIF files into the working directory. Each contains eight Cu atoms.
Converting Structure Data
Run the following command in the working directory. Use -s for files containing one structure each, such as CIF files.
The command creates init_struc_data.pkl in the current directory. IDs are assigned in input order: Cu8_1.cif, Cu8_2.cif, and Cu8_3.cif receive IDs 0, 1, and 2, respectively.
See CrySPY Utility > pos2pkl.py for conversion details.
cryspy.in
Configure cryspy.in as follows.
atype = Cuandnat = 8match the atom type and atom count in all three input structures.tot_struc = 5combines the three loaded structures with two randomly generated structures.load_struc_flag = Trueenables loading initial structures.- Adjust
jobcmdfor your computing environment.
Placing the Data and Running CrySPY
Before the first cryspy run, place the converted data as follows.
CrySPY loads three structures and generates two more randomly, then exits after preparing the initial structures.
Continue as in a normal RS run by executing cryspy again to start structure optimization.
Checking the Loaded Structures
./data/init_POSCARS contains all five structures: the three loaded structures and the two randomly generated structures.
| Structure ID | Initial structure |
|---|---|
0 | Loaded from Cu8_1.cif |
1 | Loaded from Cu8_2.cif |
2 | Loaded from Cu8_3.cif |
3, 4 | Generated randomly |
./data/pkl_data/init_struc_data.pkl is also updated to contain these five structures.
Invalid structure counts, atom types, or compositions raise an error. See Features > Loading Initial Structures > Checks During Loading for details.