Skip to content

Comments

Use MDAnalysis principal_axes() for single-UA molecules to prevent complex axes#274

Merged
jkalayan merged 2 commits intomainfrom
273-bug-complex-number-forces-produced
Feb 12, 2026
Merged

Use MDAnalysis principal_axes() for single-UA molecules to prevent complex axes#274
jkalayan merged 2 commits intomainfrom
273-bug-complex-number-forces-produced

Conversation

@jkalayan
Copy link
Collaborator

Summary

Principal axes for molecules that were a single UA sometimes produced complex numbers when using the custom_principal_axes() function as the translational axes for forces added to the covariance matrices.

Changes

Change PA used for single UA molecules :

  • Use the MDA principal_axes() function instead of the custom_principal_axes()

Update tests :

  • Update tests to include the make_whole patch and remove redundant mocks

Impact

  • Will fix bug that prevented forces to be translated for single UA molecules because some of these translational axes returned complex numbers when using the MOI tensor to get the PA.

@jkalayan jkalayan linked an issue Feb 12, 2026 that may be closed by this pull request
Copy link
Member

@harryswift01 harryswift01 left a comment

Choose a reason for hiding this comment

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

This looks like a very clean fix. Using MDAnalysis’ principal_axes() for the single-UA case should prevent the complex axis issue from the custom MOI-based implementation, and it looks like the relevant tests have been updated accordingly. I’m happy to approve this, thank you!

@harryswift01 harryswift01 added the bug Something isn't working label Feb 12, 2026
@harryswift01 harryswift01 added this to the v1.1.0 milestone Feb 12, 2026
@harryswift01 harryswift01 changed the title 273 bug complex number forces produced Use MDAnalysis principal_axes() for single-UA molecules to prevent complex axes Feb 12, 2026
@jkalayan jkalayan merged commit 12880e8 into main Feb 12, 2026
27 checks passed
@jkalayan jkalayan deleted the 273-bug-complex-number-forces-produced branch February 12, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: complex number forces produced

2 participants