Skip to content

Commit

Permalink
Add lower bound and upper bound to bond distortion.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgt16-LANL committed Sep 15, 2023
1 parent 018f2f7 commit 8a7dee4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions architector/io_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def printenergy(a=relaxed_atoms): # store a reference to atoms in the definitio
return []


def bond_length_sampler(relaxed_mol, n=10, seed=42, max_dev=0.4, smallest_dist_cutoff=0.55,
def bond_length_sampler(relaxed_mol, n=10, seed=42, max_dev_low=0.1, max_dev_hi=0.4, smallest_dist_cutoff=0.55,
min_dist_cutoff=3,
final_relax=False, final_relax_steps=50, debug=False,
return_energies=False,
Expand All @@ -96,8 +96,10 @@ def bond_length_sampler(relaxed_mol, n=10, seed=42, max_dev=0.4, smallest_dist_c
number of conformers to generate, by default 10
seed : int, optional
random seed, by default 42
max_dev : float, optional
maximum deviation around bonds, by default 0.3
max_dev_low : float, optional
maximum compression of bonds, by default 0.1
max_dev_hi : float, optional
maximum stretch of bonds, by default 0.4
smallest_dist_cutoff : float
distance cutoff-make sure sum of cov radii larger than dist*smallest_dist_cutoff, default 0.55.
min_dist_cutoff : int/float
Expand Down Expand Up @@ -126,8 +128,8 @@ def bond_length_sampler(relaxed_mol, n=10, seed=42, max_dev=0.4, smallest_dist_c
while total_out < n:
fail = False
OBMol = convert_mol2_obmol(mol2)
distortion = np.random.uniform(low=1-max_dev,
high=1+max_dev,
distortion = np.random.uniform(low=1-max_dev_low,
high=1+max_dev_hi,
size=(bond_dists.shape[0]))
new_bond_dists = bond_dists*distortion
ase_dist_constrs = []
Expand Down

0 comments on commit 8a7dee4

Please sign in to comment.