deepmodeling / deepmodeling/tbplas

[Code scan] Use absolute onsite energies in the rescale estimate

Open Beginner friendly
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
19
Forks
6
PR merge metrics
No merged PRs in 30d

Description

This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b3dba8eb930e4869a6d41074f62d703692.

Severity: Medium

`get_rescale()` documents the estimate as `max(sum(abs(ham_dense), axis=1))`, but initializes each row sum with the raw onsite energy. Negative onsite energies therefore reduce the row sum instead of contributing their absolute value, which can underestimate the Hamiltonian scale and can even make the estimated rescale invalid for diagonal-dominated models.

Code reference:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/cython/sample.pyx#L80-L113

Suggested fix: initialize `ham_sum[io]` with `abs(orb_eng[io])` so the implementation matches the documented absolute row-sum estimate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read tbplas/cython/sample.pyx around get_rescale() at lines 80-113, starting with how the row sum is initialized and how the documented absolute row-sum estimate is computed. Update the initialization to use the onsite energy's absolute value, then verify that the implementation matches the estimate described in the issue.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.