Skip to content

Commit

Permalink
Fixed issue with rthres masks in I(Q) calc.
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikLizakJohansen committed Oct 16, 2023
1 parent 2f47a99 commit 1ef8c07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions debyecalculator/debye_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def iq(
occ_product = self.struc_occupancy[i][idx[0]] * self.struc_occupancy[i][idx[1]]
sinc = torch.sinc(d[mask] * self.q / torch.pi)
ffp = self.struc_unique_form_factors[i][inv_idx[0]] * self.struc_unique_form_factors[i][inv_idx[1]]
iq += torch.sum(occ_product.unsqueeze(-1) * ffp * sinc.permute(1,0), dim=0)
iq += torch.sum(occ_product.unsqueeze(-1)[mask] * ffp[mask] * sinc.permute(1,0), dim=0)

# Apply Debye-Weller Isotropic Atomic Displacement
if self.biso != 0.0:
Expand Down Expand Up @@ -542,7 +542,7 @@ def _get_all(
occ_product = self.struc_occupancy[i][idx[0]] * self.struc_occupancy[i][idx[1]]
sinc = torch.sinc(d[mask] * self.q / torch.pi)
ffp = self.struc_unique_form_factors[i][inv_idx[0]] * self.struc_unique_form_factors[i][inv_idx[1]]
iq += torch.sum(occ_product.unsqueeze(-1) * ffp * sinc.permute(1,0), dim=0)
iq += torch.sum(occ_product.unsqueeze(-1)[mask] * ffp[mask] * sinc.permute(1,0), dim=0)

# Apply Debye-Weller Isotropic Atomic Displacement
if self.biso != 0.0:
Expand Down

0 comments on commit 1ef8c07

Please sign in to comment.