Skip to content

Conversation

@yihengwuKP
Copy link
Collaborator

Hi I've implemented two new cvs: 1. angle between two vectors 2. native contact fraction Q. Please let me know if anything needs to be modified! I've added another python script under colvars contacts.py for Q, but the vector angles are added in angles.py. I've implemented testing for Q and its derivatives in example/openmm/cv_Q.

@trunk-io
Copy link

trunk-io bot commented Jul 9, 2024

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@yihengwuKP yihengwuKP requested a review from p-zubieta July 15, 2024 17:02
update the examples, this is simply a better choice of
the contacts. Otherwise it contains bonded pairs which
will always be there.
Comment on lines 15 to 25
def remap_indices(contacts, sorted_unique_indices):
# create the mapping from old indices to new indices
old_indices = np.array(sorted_unique_indices)
new_indices = np.arange(len(sorted_unique_indices))
index_mapping = np.zeros(old_indices.max() + 1, dtype=new_indices.dtype)
index_mapping = index_mapping.at[old_indices].set(new_indices)

contacts = np.array(contacts)
remapped_contacts = index_mapping[contacts]

return remapped_contacts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to check, but this looks like something that could be accomplished, by using argsort

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and I've just implemented this in commits below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants