Skip to content

Fix RDM basis set rotation#1325

Open
arettig wants to merge 1 commit into
quantumlib:mainfrom
arettig:interaction_rdm_fix
Open

Fix RDM basis set rotation#1325
arettig wants to merge 1 commit into
quantumlib:mainfrom
arettig:interaction_rdm_fix

Conversation

@arettig
Copy link
Copy Markdown
Contributor

@arettig arettig commented Jun 2, 2026

This fixes #603, where RDM basis set rotations incorrectly used the same rotation matrices as operators instead of the conjugate.

The rotate_basis() method is now overridden in interaction_rdm.py.

Added new tests that check the rotate_basis() method and will fail if old convention is used.

RDM basis set rotations now use the conjugate of the rotation matrices.

Added new tests that will fail if the old convention is used.
@arettig arettig requested a review from mhucka June 2, 2026 23:00
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the rotate_basis method for the InteractionRDM class, which rotates its orbital basis using the conjugate of the provided rotation matrix. Additionally, it introduces unit tests to verify the basis rotation functionality and to confirm the invariance of expectation values under basis rotations. No review comments were provided, so there is no feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mhucka mhucka self-assigned this Jun 2, 2026
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.

InteractionRDM.rotate_basis rotates incorrectly?

2 participants