Fix acoustic_sum_rule computation in PhononBSDOSDoc#1447
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1447 +/- ##
===========================================
- Coverage 85.66% 85.56% -0.10%
===========================================
Files 239 239
Lines 19167 19183 +16
===========================================
- Hits 16419 16414 -5
- Misses 2748 2769 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
seems okay to me, but I don't have the domain knowledge (Aaron, thoughts?) |
|
@hrushikesh-s looking at ex this review, and using the notation that the ( So perhaps the easiest checks of the ASR are: np.abs(np.array(self.force_constants).sum(axis=1)).max() < threshwith np.all(np.abs(np.array(self.force_constants).sum(axis=1)) < thresh)Thoughts? |
|
Thanks @esoteric-ephemera. I have now switched to This new approach is also verified on mp-149, mp-189, mp-556120 --> all give ~1e-14, which is correct. Looks good? |
|
whichever method is decided on, it would be good if a citation/link (doi?) to the corresponding paper could be added that future develops can reference |
The previous einsum('iijk->jk', fcs) summed only the on-site (i==j) self-interaction blocks, which is unrelated to the acoustic sum rule. The ASR condition is sum_j Phi_ij = 0 for every atom i.
Compute per-atom row sums and return the one with the largest Frobenius norm, so the field reports the worst per-atom violation.
3db966f to
ed0cdff
Compare
|
Yep looks good to me, will add the citation now |
|
@hrushikesh-s: I tweaked this a bit to return the N x 3 x 3 matrix from the ASR, since the same check on @tsmathis removed the computed fields on a lot of these since I don't know that we need to save heavy arrays in memory. Thoughts? |
Yep that's reasonable. Merge whenever you're happy 👍 |
The previous einsum('iijk->jk', fcs) summed only the on-site (i==j) self-interaction blocks, which is unrelated to the acoustic sum rule. The ASR condition is sum_j Phi_ij = 0 for every atom i.
Compute per-atom row sums and return the one with the largest Frobenius norm, so the field reports the worst per-atom violation.
Contributor Checklist