This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b.
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:
|
try: |
|
energy = cell.get_hopping((0, 0, 0), i, j) |
|
except PCHopNotFoundError: |
|
energy = 0.0 |
|
energy += soc_intensity |
|
cell.add_hopping((0, 0, 0), i, j, soc_intensity) |
Suggested fix: pass the accumulated energy value to add_hopping().
This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b.
Severity: Medium
The TMDC SOC builder retrieves an existing
(0, 0, 0)hopping, addssoc_intensityinto a localenergyvariable, and then discards that accumulated value. The finaladd_hopping()call writes onlysoc_intensity, so any existing hopping term is overwritten instead of updated.Code reference:
tbplas/tbplas/materials/xs2.py
Lines 514 to 519 in 4d3652b
Suggested fix: pass the accumulated
energyvalue toadd_hopping().