Skip to content

Fixing skipped transvibrational entropy.#328

Merged
skfegan merged 1 commit intomainfrom
327-ua-transvibrational-entropy
May 1, 2026
Merged

Fixing skipped transvibrational entropy.#328
skfegan merged 1 commit intomainfrom
327-ua-transvibrational-entropy

Conversation

@skfegan
Copy link
Copy Markdown
Member

@skfegan skfegan commented May 1, 2026

Summary

This pull requests fixes a small error in calculating vibrational entropy. It was giving 0 for both translational and rotational vibrational entropy if either force or torque matrices were 0 so in a few cases was missing translational entropy when the torques were zero and the forces were not zero.

Changes

Fix missing entropy

  • Changed 2 instances of "or" to "and" in entropy/nodes/vibrational.py : _compute_force_torqe_entropy()

Tests

  • Corrected one test

Impact

  • Molecules with beads that do not have torques will now have the transvibrational entropy calculated and not missed.

@skfegan skfegan linked an issue May 1, 2026 that may be closed by this pull request
@skfegan skfegan requested a review from harryswift01 May 1, 2026 08:44
Copy link
Copy Markdown
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.

Approved. This looks like a clean fix for the boolean logic issue: using or was incorrectly zeroing both transnational and rotational vibrational entropy whenever either the force or torque matrix was zero. Switching to and makes sense, since entropy should only be skipped when both relevant inputs are zero. Thanks for also updating the test to cover the corrected behavior.

@skfegan skfegan merged commit e47563a into main May 1, 2026
23 checks passed
@skfegan skfegan deleted the 327-ua-transvibrational-entropy branch May 1, 2026 09:06
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.

[Bug]: Disappearing Transvibrational Entropy

2 participants