Skip to content

BUG/ENH: Fix gradient test failure with UnitCellFilter and enhance it

The current implementation of UnitCellFilter does not pass a finite-difference gradient test. This is because the atomic and cell degrees of freedom are not dealt with consistently. This MR resolves this issue following the approach described in E. B. Tadmor, G. S. Smith, N. Bernstein, and E. Kaxiras, Phys. Rev. B 59, 235 (1999). The degrees of freedom used for the objective function are the positions in the original undeformed cell, plus the deformation tensor - note this requires an additional 3 atoms, rather than the 2 used in the previous implementation, but the external interface is compatible.

The MR also enhances the UnitCellFilter by adding hydrostatic_strain and constant_volume arguments. A new test is included which demonstrates the gradient test failure and shows it is fixed with the new implementation.

Merge request reports