deepmodeling / deepmodeling/DeePTB

[Code scan] Julia Pardiso backend crashes for orthogonal exports without overlap file

Open
#364 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
122
Forks
36
PR merge metrics
No merged PRs in 30d

Description

This issue is part of a Codex global repository scan.

Problem:
`to_pardiso_json()` writes `predicted_overlaps.h5` only when `sr is not None`, which is expected for orthogonal models. The Julia loader returns an empty overlap dict when the file is absent, but `HR2HK()` unconditionally indexes `S_R[R]` for every Hamiltonian lattice shift.

Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/unified/system.py#L832-L839
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/pardiso/io/io.jl#L172-L176
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/postprocess/pardiso/utils/hamiltonian.jl#L66-L70

Impact:
Orthogonal Pardiso runs can fail with a missing-key error instead of using an identity overlap matrix.

Suggested fix:
Teach the Julia backend to synthesize identity overlap blocks when no overlap file is present, or have the Python exporter always write an explicit identity overlap for orthogonal models.

Contributor guide

Open the contributing guide

Research direction

Start with to_pardiso_json() in dptb/postprocess/unified/system.py, then read the Julia loader in dptb/postprocess/pardiso/io/io.jl and HR2HK() in dptb/postprocess/pardiso/utils/hamiltonian.jl. Reproduce an orthogonal Pardiso export without predicted_overlaps.h5 and verify the run uses identity overlap blocks instead of raising a missing-key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.