Skip to content

Poisson-dev and support for BTD and Overlap Matrix in NEGF #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 232 commits into
base: main
Choose a base branch
from

Conversation

AsymmetryChou
Copy link
Collaborator

try to merge poisson-dev to main

@QG-phy QG-phy requested a review from Copilot February 28, 2025 03:58
Copy link

@Copilot 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.

PR Overview

This PR merges the poisson‑dev branch into main and adds support for Bloch unfolding in NEGF, improvements in TBtrans input file generation, and updates to various NEGF‐related modules. Key changes include updates to convergence thresholds and energy shifts in Green’s function calculations, modifications in lead self‑energy handling, and additions to the TBtrans input processing pipeline.

Reviewed Changes

File Description
dptb/negf/surface_green.py Adjusts convergence criteria for recursive surface Green’s function computation.
dptb/negf/lead_property.py Updates the self‑energy to Gamma conversion sign and extends the self‑energy handling.
dptb/negf/recursive_green_cal.py Revises the energy shift (using +1j*eta) in matrix blocks and adds an extra gr_lc output.
dptb/nn/hr2hk.py Appends atom orbital counts to an internal list during Hamiltonian block construction.
dptb/postprocess/tbtrans_init.py Cleans up extraneous commented code and revises structure‐reading routines.

Copilot reviewed 50 out of 50 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (4)

dptb/negf/lead_property.py:235

  • The function 'sigmaLR2Gamma' now returns 1j*(se-se.conj().T) instead of the previous -1j*(se-se.conj().T). Confirm that the sign change is consistent with the theoretical formulation and downstream usage.
return 1j * (se - se.conj().T)

dptb/negf/recursive_green_cal.py:165

  • Changing the shift from (energy - 1jeta) to (energy + 1jeta) affects all matrix blocks; ensure that this modification is consistent with the retarded Green's function formalism used elsewhere in the code.
mat_d_list[jj] = mat_d_list[jj] + (energy + 1j * eta) * sd[jj]

dptb/nn/hr2hk.py:132

  • [nitpick] Ensure that 'atom_norbs' is consistently maintained as it is critical for mapping orbital indices; consider adding documentation or assertions to verify its expected length relative to the input data.
self.atom_norbs.append(masked_oblock.shape[0])

dptb/postprocess/tbtrans_init.py:239

  • [nitpick] Residual commented-out code (e.g., supercell settings) remains in the file; it is advisable to remove or relocate unused code to improve clarity and maintainability.
##redefine the Lattice vector of Lead L/R

@@ -59,7 +60,7 @@ def forward(ctx, H, h01, S, s01, ee, method='Lopez-Sancho'):

test = ee * S - H - torch.mm(ee * s01 - h01, gs.mm(ee * s10 - h10))
myConvTest = torch.max((test.mm(gs) - torch.eye(H.shape[0], dtype=h01.dtype)).abs())
if myConvTest < 1.0e-6:
if myConvTest < 3.0e-5:
Copy link
Preview

Copilot AI Feb 28, 2025

Choose a reason for hiding this comment

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

The convergence threshold was increased from 1.0e-6 to 3.0e-5. Verify that this change does not compromise the accuracy of the surface Green's function and is aligned with the intended numerical tolerances.

Suggested change
if myConvTest < 3.0e-5:
if myConvTest < 1.0e-6:

Copilot uses AI. Check for mistakes.

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.

2 participants