You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue where the space group was not maintained during lattice optimization despite setting "KEEP_SPACE_GROUP" to true. This issue was observed while optimizing the lattice structures of iodine (No.64,Cmce) and silicon (No.227,Fd-3m) in their primitive cell forms, where the non-zero elements of three upper-triangular elements in lattice were left unchanged during the whole process of optimization.
ALLOCATE (x0(3*nparticle + 6))
CALL pack_subsys_particles(subsys=subsys, r=x0)
idg = 3*nparticle
DO i = 1, 3
DO j = 1, i
idg = idg + 1
x0(idg) = cell%hmat(j, i)
END DO
END DO
The three upper-triangular elements were not read into x0 during the initialization of x0 which is later updated by dr for geoopt_bfgs function in bfgs_optimizer.F.
I didn't go through all the later functions to reassure whether there were other symmetry operations implemented for x0, but the output file results would show that the three upper-triangular elements were left unchanged so that the space group can't be maintained if any of the three upper-triangular elements are non-zero (which are common for primitive cell of C-centered orthorhombic lattice, FCC, etc.).
Potential Impacts
Thus, maybe cp2k in its current version (cp2k-2024.1) is malfunctioned for some primitive cell optimization. Additionally, users (like me) using primitive cell for band structure calculation might suffer from the cell relaxation, especially recently RI-HFX techniques were employed which are especially suitable for small crystal's band calculations with a great number of K points. (Certainly, this could be evaded by using a conventional cell for cell optimization and then use primitive cell for other properties calculation.)
Steps to Reproduce
Two test cases from ./QS/regtest-spgr/quartz.inp with minimal modifications are attached as postscripts. I2_N01.inp.txt Si_N01.inp.txt
version: cp2k-2024.1, spglib-v1.16.2 (latest as today)
Questions
Are there any known workarounds for this issue?
Notes
Note that the identify_space_group function (calling spgr_create) in space_groups.F uses the full hmat (all 3-by-3 elements) so that it could correctly identify the space group of a conventional unit cell (or primitive cell) by spglib (v1.16.2) in both example cases.
Line 228 of space_groups.F: spgr%space_group_number = spg_get_international(spgr%international_symbol, TRANSPOSE(cell%hmat), tmp_coor, tmp_types, & spgr%n_atom_sym, eps_symmetry)
By the way, are there any other better ways than modifying the src code to WRITE outputs and recompiling for cp2k debug?
I found that:
a) the stacks of function being called are not fully written out into the output file so it would be very hard to see the layer structure and order of all the executing functions even if the TRACE tag in input file was set to T;
b) I followed "debug build" instructions in https://manual.cp2k.org/trunk/CP2K_INPUT/DEBUG.html, but still couldn't let gdb TUI find source code;
c) So using WRITE sentences and recompiling is my final choice to read the values of x0 to finally locate the problem, which took me quite a lot of time.
Dear developers of cp2k, Greetings
Description
I encountered an issue where the space group was not maintained during lattice optimization despite setting "KEEP_SPACE_GROUP" to true. This issue was observed while optimizing the lattice structures of iodine (No.64,Cmce) and silicon (No.227,Fd-3m) in their primitive cell forms, where the non-zero elements of three upper-triangular elements in lattice were left unchanged during the whole process of optimization.
Relevant code
Line 129~137 of gopt_f_methods.f:
The three upper-triangular elements were not read into x0 during the initialization of x0 which is later updated by dr for geoopt_bfgs function in bfgs_optimizer.F.
I didn't go through all the later functions to reassure whether there were other symmetry operations implemented for x0, but the output file results would show that the three upper-triangular elements were left unchanged so that the space group can't be maintained if any of the three upper-triangular elements are non-zero (which are common for primitive cell of C-centered orthorhombic lattice, FCC, etc.).
Potential Impacts
Thus, maybe cp2k in its current version (cp2k-2024.1) is malfunctioned for some primitive cell optimization. Additionally, users (like me) using primitive cell for band structure calculation might suffer from the cell relaxation, especially recently RI-HFX techniques were employed which are especially suitable for small crystal's band calculations with a great number of K points. (Certainly, this could be evaded by using a conventional cell for cell optimization and then use primitive cell for other properties calculation.)
Steps to Reproduce
Two test cases from ./QS/regtest-spgr/quartz.inp with minimal modifications are attached as postscripts.
I2_N01.inp.txt
Si_N01.inp.txt
version: cp2k-2024.1, spglib-v1.16.2 (latest as today)
Questions
Are there any known workarounds for this issue?
Notes
Note that the identify_space_group function (calling spgr_create) in space_groups.F uses the full hmat (all 3-by-3 elements) so that it could correctly identify the space group of a conventional unit cell (or primitive cell) by spglib (v1.16.2) in both example cases.
Line 228 of space_groups.F:
spgr%space_group_number = spg_get_international(spgr%international_symbol, TRANSPOSE(cell%hmat), tmp_coor, tmp_types, & spgr%n_atom_sym, eps_symmetry)
By the way, are there any other better ways than modifying the src code to WRITE outputs and recompiling for cp2k debug?
I found that:
a) the stacks of function being called are not fully written out into the output file so it would be very hard to see the layer structure and order of all the executing functions even if the TRACE tag in input file was set to T;
b) I followed "debug build" instructions in https://manual.cp2k.org/trunk/CP2K_INPUT/DEBUG.html, but still couldn't let gdb TUI find source code;
c) So using WRITE sentences and recompiling is my final choice to read the values of x0 to finally locate the problem, which took me quite a lot of time.
Earlier discussions are at https://groups.google.com/g/cp2k/c/Xwna6hLwWzk Thanks a lot for Prof. Hutter's discussions and instructions for me.
The text was updated successfully, but these errors were encountered: