Skip to content

Commit

Permalink
initial attempt at Z-scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-o-marsh committed Apr 8, 2024
1 parent f33afe6 commit 892a3a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/rascaline/rascaline/systems/pyscf.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def species(self):
return self._species

def positions(self):
return pyscf.data.nist.BOHR * self._frame.atom_coords()
return self._frame.atom_coords('angstrom')

def cell(self):
if self.is_periodic:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ use super::{canonical_vector_for_single_triplet,ExpansionContribution,RawSpheric

use super::assert_feature_gate;

#[inline]
fn VECTOR_Z_REWORK(og_z: f64, bond_length: f64) -> f64 {
0.5* og_z / bond_length
}

/// Parameters for spherical expansion calculator for bond-centered neighbor densities.
///
/// (The spherical expansion is at the core of representations in the SOAP
Expand Down Expand Up @@ -186,7 +191,8 @@ impl SphericalExpansionForBonds {
let mut dmtx_cache = BTreeMap::new();

return Ok(pre_iter.into_iter().map(move |(triplet_i,triplet,invert)| {
let vector = canonical_vector_for_single_triplet(&triplet, invert, false, &mut mtx_cache, &mut dmtx_cache).unwrap();
let mut vector = canonical_vector_for_single_triplet(&triplet, invert, false, &mut mtx_cache, &mut dmtx_cache).unwrap();
(*vector.vect)[2] = VECTOR_Z_REWORK((*vector.vect)[2], triplet.bond_vector.norm());
let weight = if triplet.is_self_contrib {self.center_atoms_weight} else {1.0};
self.raw_expansion.compute_coefficients(&mut *contribution.borrow_mut(), vector.vect,weight,None);
(triplet_i, invert, contribution.clone())
Expand Down

0 comments on commit 892a3a9

Please sign in to comment.