Skip to content

Use of np.flip() (__init__.py line 37) #1

@BarrierFly

Description

@BarrierFly

np.flip() by default flips over all axes. In the calculate_bond_vector_combinations() funtion, topo has three axes corresponding to which bond pair, which bond in a bond pair, and which particle on the bond; [idx[0], idx[1]] filters out a group of bonds; and topo[idx[0], idx[1]] has two axes corresponding to which bond in the group of bonds, and which particle on the bond. Therefore, np.flip(topo[idx[0], idx[1]]) flips both the filtered bonds and the particles on each bond. The latter is expected, but the former breaks the correspondence between the bonds in the bond pairs. So np.flip() should be used include the parameter axis=1, so that only the particles on each bond are flipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions