Skip to content

Commit

Permalink
Correct setting numerical zero for b_tensors.
Browse files Browse the repository at this point in the history
  • Loading branch information
dymkowsk committed Feb 23, 2017
1 parent 30fc8a9 commit 6bd4aae
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneLargerOrderAbins.nxs.md5
@@ -1 +1 @@
c00f071587df0eb690c0626c7d50c6b7
36df84d9a0bcecc9d43350a474027f20
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneScratchAbins.nxs.md5
@@ -1 +1 @@
4b6c42f07033ded1f17f2d42008d3c64
91f709686e985858b7e6334e6356fefb
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneSmallerOrderAbins.nxs.md5
@@ -1 +1 @@
4139453fd1081e415a364973e3779cca
1c5de7f7bd927680b4869112ae62dc03
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneTAbins.nxs.md5
@@ -1 +1 @@
5970791a49af584310af004fb26d055c
036359f44df9beb793e5d7e267e96f15
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/Crystalb3lypScratchAbins.nxs.md5
@@ -1 +1 @@
30f46fc38d280d27f944d8a078699ec2
b9299d7d95aee7a583bfa5939a2247d7
@@ -1 +1 @@
c907ea22a74082b61c6f81192503ea15
3ecf242b5538fa3df2f6b443548120db
2 changes: 1 addition & 1 deletion Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5
@@ -1 +1 @@
d7b15926be182560527f3266e625b379
c89208aab5f05dec2b1dc301acedc098
@@ -1 +1 @@
891f2c88d600bbdd69a2b7d5a1b5c872
769f015c42985496ee5218621b206602
@@ -1 +1 @@
c853db9391459be5161a4e57f318b900
94f9d94cc7344dd85a375de868086780
1 change: 1 addition & 0 deletions scripts/AbinsModules/AbinsConstants.py
Expand Up @@ -132,6 +132,7 @@
# values of S below that are considered to be zero
S_THRESHOLD = 10e-8
THRESHOLD = 10e-15
NUM_ZERO = 10e-15

MAX_ORDER = 4 # max quantum order event

Expand Down
5 changes: 3 additions & 2 deletions scripts/AbinsModules/CalculatePowder.py
Expand Up @@ -89,8 +89,9 @@ def _calculate_powder(self):
# b_tensors[num_atoms, num_freq, dim, dim]
b_tensors = np.einsum('ijkl,ij->ijkl', np.einsum('lki, lkj->lkij', disp, disp).real, factor)

indices = b_tensors < AbinsModules.AbinsConstants.THRESHOLD
b_tensors[indices] = AbinsModules.AbinsConstants.THRESHOLD
temp = np.fabs(b_tensors)
indices = temp < AbinsModules.AbinsConstants.NUM_ZERO
b_tensors[indices] = AbinsModules.AbinsConstants.NUM_ZERO

# a_tensors[num_atoms, dim, dim]
a_tensors = np.sum(a=b_tensors, axis=1)
Expand Down

0 comments on commit 6bd4aae

Please sign in to comment.