LAQA
Last updated: October 16, 2026
Info
First, see Tutorial > Random Search (RS) for basic usage of CrySPY.
Here, we assume CrySPY 1.1.0 or later.
The example files used here can be downloaded from CrySPY_utility/examples/qe_Si16_LAQA. In this tutorial, only 50 initial structures are generated, but originally, LAQA is designed to select candidates from many more structures.
Input
cryspy.in
Here is an example of cryspy.in.
nstagemust be 1 in LAQA- From v1.5.0,
backup_intervalin the [option] section sets the automatic backup interval in selections. The default is1;0disables automatic backups. See Features > Backup for details. - You have to write
nselect_laqain [LAQA] section.nselect_laqais the number of candidates you select at one time.
If you want to change the value of the weight for LAQA score, edit wf and ws as below.
If omitted, the default values are used (0.1 and 10.0, respectively).
See, Search algorithms > LAQA for the score.
calc_in/pwscf.in_1
nstepcontrols how many steps of structure optimization can proceed in one selection. (NSWfor VASP)
calc_in/job_cryspy
- The job file is the same as the usual way.
Run
Tip
An automatic script is also available. See the bottom of this page.
Just type cryspy for the 1st run.
Check log_cryspy.
50 random structures are generated.
In LAQA, jobs of structure optimization for all structures are submitted once at the beginning.
Note that only 10 steps are proceeded here since we set nstep = 10.
Repeat cryspy command until all of these (10 steps) are completed.
If necessary, you can also submit all jobs at once by increasing the value of njob.
After all the initial optimizations, LAQA is ready is displayed at the end of log_cryspy.
Next cryspy run will make the first selection.
Here, only the number set in nselect_laqa will be selected.
Type cryspy to submit the jobs (next 10 steps).
Then, by repeating this over and over again, the optimization of the structure selected according to the score advances by 10 steps each time. Proceed until several structures are completed, and finish (stop) when you like.
Status
If you want to check the LAQA score during the simulation, you can look at the status file:
- ./data/LAQA_status
Other files for LAQA will be output:
- ./data_LAQA_bias
- ./data_LAQA_energy
- ./data_LAQA_score
- ./data_LAQA_selected_id
- ./data_LAQA_step
Analysis and Visualization
It is assumed here that you analyze and visualize CrySPY data in your local PC.
If you use CrySPY in super computers or workstations, download the data in your local PC.
You can delete the work and backup directory if you do not need it because the file size could be very large.
You may gzip the pkl data to decrease the file size.
Jupyter Notebook
Move to the data/ directory in results you just downloaded.
Then copy cryspy_analyzer_LAQA.ipynb from CrySPY utility.
You can obtain the graph and animation with the notebook. In the gif below, all of the optimizations were completed. This is just for animation. (When all of the optimizations are completed, the computational cost is the same as random search.)
This graph shows the energy as a function of optimization step. The red lines indicate three structures with the lowest energy. The most stable one reached diamond structure. The structures that eventually become stable were selected at an early stage.
Info
If algo = LAQA, the followings are automatically set in the [option] section.
- force_step_flag = True
- stress_step_flag = True
Force and stress data are collected step by step. Energy and structure data are NOT. They are collected for each selection. In other words, in this case, energy and structure data are saved once every 10 steps. If you want to collect energy and structure data step by step, manually set up as follows:
Auto Script
You may find it tedious to run cryspy over and over again. The auto script could help you.
