Issue with normalization in calculating deformation potential

Hi Alex,

I’ve raised a question regarding the differences in the deformation potential values with and without soc. I tried to modify the code to write out the deformation potential values for each strain component for every band. I have observed that, for spin polarized calculations, values in the normalization matrix are double as the same strain repeats for spin up and spin down bands. This issue can be resolved by separately determining normalization matrix for different spin channels.

I’m attaching all the results below. Please have a look at it and correct me if I’m wrong.

Strains for without soc calculation:
Screenshot from 2024-09-02 19-11-07

Strains for SOC calculation
Screenshot from 2024-09-02 19-14-29

Energy differences at VBM for spin-up and spin-down bands for each strain (without soc)
Screenshot from 2024-09-02 19-16-12

Energy differences at VBM for soc calculation (as degeneracy breaks, only one spin channel exists)
Screenshot from 2024-09-02 19-15-44

As the energy differences for positive and negative strains should be normalized, strain_loc parameter is used to record occurrences to eventually build a normalization matrix. I’ve extracted both strain_loc and norm.

strain_loc and norm for without soc case:

Here strain_loc repeats for each spin channel and therefore counted twice its actual occurrence.
Actual norm should be
[[2 1 1]
[1 2 1]
[1 1 2]]

Now in soc case its counted correctly:

The deformation potential obtained for without soc case:

using corrected normalization matrix, the deformation potential values obtained would be double and that would be comparable to soc case.

Deformation potential values with soc case:
Screenshot from 2024-09-02 19-15-12

I guess this would be the case not just with and without soc case, but also, spin-polarized and non-spin polarized calculations as well.

So, I request you to go through this once and resolve this issue.

Thank you.

Hi @Shiva_Lingam,

Thank you very much for this very detailed bug report. I believe the issue can be fixed by unindenting this single line: amset/amset/deformation/potentials.py at 2f53ea74eec4589488879339fd04a3773f29619b · hackingmaterials/amset · GitHub

Are you able to try making that change to see if that fixes the problem for you?

Best,
Alex

1 Like

Hi @Alex,

Thank you for the suggestion. I made the change you recommended, and it worked perfectly! The issue is now resolved.

Thanks again for your help.

Best regards,
Shiva.

Thank you very much for confirming. I’ve just pushed a fix - a new version should be released within 30 mins.

1 Like

Sounds great! Thanks for the quick turnaround. I’ll keep an eye out for the new version.

Best regards,
Shiva.