8000 Fill *lower* triangle in FCICSFpspace_h0tril by MatthewRHermes · Pull Request #229 · pyscf/pyscf-forge · GitHub
[go: up one dir, main page]

Skip to content

Fill *lower* triangle in FCICSFpspace_h0tril - #229

Merged
MatthewRHermes merged 1 commit into
pyscf:masterfrom
MatthewRHermes:csf_pspace_tril
Nov 11, 2026
Merged

MatthewRHermes merged 1 commit into
pyscf:masterfrom
MatthewRHermes:csf_pspace_tril

Conversation

@MatthewRHermes
Copy link
Copy Markdown
Collaborator

In #225, even though the matrix elements computed by FCICSFpspace_h0tril were correctly the lower-triangular (bra<ket) elements, they were placed in the upper-triangular slots (ket<bra). This is irrelevant to real Hamiltonians, but fixing it now will save heartache later. Also add a "docstring" commentary to FCICSFpspace_h0tril for readability.

I discovered this when reviewing MatthewRHermes/mrh#249, where the current setup (lower-triangular elements but in the upper triangle of the array) causes the antihermitian imaginary part of a pspace Hamiltonian matrix to come out with a factor of -1 that makes no sense. Claude Code helped analyze the problem and proofread the code, which I otherwise wrote (along with this PR description) entirely manually.

Previously, even though the matrix elements computed by
FCICSFpspace_h0tril were correctly the lower-triangular (bra<ket)
elements, they were placed in the upper-triangular slots (ket<bra).
This is irrelevant to real Hamiltonians, but fixing it now will
save heartache later. Also add a "docstring" commentary to
FCICSFpspace_h0tril for readability.
@MatthewRHermes
MatthewRHermes requested a review from sunqm November 2, 2026 21:35
@MatthewRHermes MatthewRHermes added documentation Improvements or additions to documentation housekeeping Enforcement of code rules, technical maintenance, and similar tedium labels Nov 2, 2026
@MatthewRHermes MatthewRHermes added refactor Improve performance for an existing feature and removed housekeeping Enforcement of code rules, technical maintenance, and similar tedium labels Nov 10, 2026
@MatthewRHermes
MatthewRHermes merged commit 8680915 into pyscf:master Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor Improve performance for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0