libAtoms / testing-framework

11 stars 6 forks source link

actual fix k-point mesh when calculating elastic constants in lattice.py #17

Closed bernstei closed 2 years ago

bernstei commented 2 years ago

Make sure that atoms.calc = model.calculator is done after model.fix_cell_dependence(), otherwise the redefinition of the model.calculator symbol that this function does is ignored.

This was already OK for existing invocations of relax_config(), because fix_cell_dependence() was explicitly called before calling relax_config(), and relax_config does its own atoms.calc = model.calculator. It was definitely not being done correctly before calling the matscipy.elasticity routines, and probably would have also been wrong if fix_cell_dependence=True had been passed to relax_config (a possibility which is apparently not actually used anywhere).

jameskermode commented 2 years ago

Looks good to me, good catch!