deepmodeling / deepmodeling/tbplas

[Code scan] Accumulate existing TMDC SOC hoppings instead of overwriting them

Open
#17 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

The TMDC SOC builder retrieves an existing `(0, 0, 0)` hopping, adds `soc_intensity` into a local `energy` variable, and then discards that accumulated value. The final `add_hopping()` call writes only `soc_intensity`, so any existing hopping term is overwritten instead of updated.

Code reference:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/materials/xs2.py#L514-L519

Suggested fix: pass the accumulated `energy` value to `add_hopping()`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.