def get_element_type_subset_indices(self):
"""
It is currently required that the element of two matching atoms is the same.
This constructs indices to e.g. the carbon-carbon submatrix.
"""
# TODO: this is redundant if the elements does not have to match
unique_elements = np.unique(self.reactants_elements)
subset_indices = np.empty(unique_elements.size, dtype=object)
for i, element in enumerate(unique_elements):
rows = np.where(self.reactants_elements == element)[0]
cols = np.where(self.products_elements == element)[0]
subset_indices[i] = np.ix_(rows,cols)
return subset_indices
评论列表
文章目录