Skip to content

Feature&Refactor: support SCF restarts from given density matrices and several minor fixes#11

Merged
AsymmetryChou merged 6 commits into
deepmodeling:mainfrom
kirk0830:VLSI2026
Apr 19, 2026
Merged

Feature&Refactor: support SCF restarts from given density matrices and several minor fixes#11
AsymmetryChou merged 6 commits into
deepmodeling:mainfrom
kirk0830:VLSI2026

Conversation

@kirk0830
Copy link
Copy Markdown
Collaborator

What's changed

  1. disable the warnings in lead_property.py
  2. connect the ele_T (electronic temperature) user settings with smearing
  3. support the externally given pcond as the initial guess of the Poisson-NEGF SCF
  4. extend the upper limit on the number of regions by 1

不再检查并记录HDF5文件中数据集是否已存在的警告日志,直接覆盖写入
允许compute方法接收外部Poisson接口对象作为参数,避免重复创建
当scf为true时,可选择使用传入的Poisson接口或新建接口
计算完成后返回Poisson接口对象供后续使用
添加缺失的文档说明,包括类参数和属性的详细描述
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the NEGF workflow to better support SCF restarts from an externally prepared Poisson interface, while also aligning electronic-temperature settings with Fermi-level smearing and applying a few minor configuration/doc fixes.

Changes:

  • Wire ele_T (electronic temperature) into Fermi-level smearing temperature during lead Fermi-level calculation.
  • Add optional pcond: Interface3D input to NEGF.compute() to allow starting Poisson-NEGF SCF from an externally provided Poisson state (and return it for reuse).
  • Extend Poisson dielectric-region input support to allow one additional dielectric region; silence some HDF5 “already exists” warnings.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
dpnegf/utils/argcheck.py Extends accepted dielectric region keys (supports one more region).
dpnegf/runner/NEGF.py Uses ele_T for smearing temperature; adds compute(pcond=...) restart path and return value.
dpnegf/negf/poisson_init.py Minor docstring whitespace/formatting adjustments.
dpnegf/negf/lead_property.py Comments out warnings during HDF5 write/merge for self-energy caching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dpnegf/runner/NEGF.py
Comment thread dpnegf/runner/NEGF.py
Comment thread dpnegf/runner/NEGF.py
Comment on lines +708 to +709
# if dset_name in grp:
# log.warning(f"Dataset {dset_name} already exists in group {group_name}. Skipping it.")
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write_to_hdf5 no longer guards against an existing dataset name. With h5py.File(..., "a"), reruns/resumes can hit the same (E,k) and grp.create_dataset(...) will raise (dataset already exists), aborting the self-energy workflow. If the goal is to silence warnings, keep the existence check but skip (or explicitly overwrite via del grp[dset_name] / use require_dataset).

Suggested change
# if dset_name in grp:
# log.warning(f"Dataset {dset_name} already exists in group {group_name}. Skipping it.")
if dset_name in grp:
log.warning(f"Dataset {dset_name} already exists in group {group_name}. Skipping it.")
return

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@AsymmetryChou AsymmetryChou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks.

@AsymmetryChou AsymmetryChou merged commit 74284d9 into deepmodeling:main Apr 19, 2026
1 check passed
@kirk0830 kirk0830 deleted the VLSI2026 branch April 19, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants