Skip to content

Commit

Permalink
removed excessive normalization from projection in perp_function
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusaarsten committed Mar 14, 2024
1 parent 9876d54 commit 6477726
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyMBE.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,6 @@ def create_residue(self, name, espresso_system, number_of_residues, central_bead
bead_position=self.generate_trial_perpendicular_vector(vector=backbone_vector,
center=central_bead_position,
radius=l0)

side_bead_id = self.create_particle(name=side_chain_element,
espresso_system=espresso_system,
position=[bead_position],
Expand Down Expand Up @@ -1561,11 +1560,12 @@ def generate_trial_perpendicular_vector(self,vector,center,radius):
on_surface=True)[0]

# Project the random vector onto the input vector and subtract the projection
projection = self.np.dot(random_vector, np_vec) / self.np.dot(np_vec, np_vec) * np_vec
projection = self.np.dot(random_vector, np_vec) * np_vec
perpendicular_vector = random_vector - projection
# Normalize the perpendicular vector to have the same magnitude as the input vector
perpendicular_vector /= self.np.linalg.norm(perpendicular_vector)
return center+perpendicular_vector*radius


def generate_trialvectors(self, center, radius, n_samples, seed=None, on_surface=False):
"""
Expand Down

0 comments on commit 6477726

Please sign in to comment.