Closed PROA200 closed 10 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
f2d8ed9
) 98.59% compared to head (5a65027
) 98.59%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @PROA200, Thanks for reporting this, I had a look at the lattice matrix of the testing LiFePO4, which is [[0.000000 0.000000 -4.744800], [-0.053123 -6.065537 0.000383], [10.410370 0.000000 0.000035]]. The definition of lattice matrix is uncommon and therefore results in a negative determinant (volume). Taking an absolute value would be safe for all cases.
Currently,
gives
, which is incorrect (stress should be positive for a positive strain). This seems to be because, when calculating the stresses, volume is calculated as
volume = torch.det(lattice)
, but for the structure above, this value is negative. After correcting this error, the negation of the above matrix is obtained, while the results for other structures are unchanged.(Right now, the structure retrieved from PymatgenTest is rather cruel, and in reality, this works fine using structures retrieved from the MP API.)