-
Notifications
You must be signed in to change notification settings - Fork 19
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
AsymmetryChou
wants to merge
232
commits into
deepmodeling:main
Choose a base branch
from
AsymmetryChou:poisson-dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
232 commits
Select commit
Hold shift + click to select a range
b76735f
create poisson_grid_init.py
AsymmetryChou 1f05ecf
add init to grid
AsymmetryChou 5eaad71
add find_atom_index
AsymmetryChou e8a78a0
add interface3D class
AsymmetryChou a505c4a
add gate potential and boundary_potential
AsymmetryChou 4ec3d0f
add contents to interface3D
AsymmetryChou 66b7c3b
rename poisson_gird_init to poisson_init
AsymmetryChou a4891ba
add region definition to gate and medium
AsymmetryChou d4a7000
add grid-point surface along x-axis
AsymmetryChou 2b19aa1
add surface_grid
AsymmetryChou 10b28d8
add flux terms
AsymmetryChou 7800d51
add func construction_poisson
AsymmetryChou 9ee0d25
add poisson_scf.py
AsymmetryChou 223ec7e
add vbias term to device_preperty.py
AsymmetryChou 2d12aaa
rename Dielectric
AsymmetryChou 1c7643f
add poisson_negf_scf to NEGF.py
AsymmetryChou b29e137
find potential on each atom gird through atom_index_dict
AsymmetryChou 4734746
add update electron density for solving Poisson equation in poisson_…
AsymmetryChou 69f48d7
add scf break operation in poisson_negf_scf
AsymmetryChou 79ddcc2
add negf_compute in the final part of poisson_negf_scf
AsymmetryChou 0cd5be3
add poisson related json and read operation in NEGF
AsymmetryChou 5d0c2e6
add eps0 in unit of F/Angstrom
AsymmetryChou a61c0ae
delete poisson_scf.py, which has been added to NEGF.py
AsymmetryChou 161e396
clean import
AsymmetryChou c4b1e77
fix import issue and str2float in gate and dieelctric definition
AsymmetryChou 4d18843
add argcheck for gate and dielectric
AsymmetryChou 800264b
add grid
AsymmetryChou 06779b9
update for run
AsymmetryChou 281a217
fix pyamg_solver.solve bug
AsymmetryChou a5ed3ec
add tolerance et. to argcheck.py
AsymmetryChou 10dbc2b
add some comments in NEGF.py and poisson_init
AsymmetryChou 4574667
update poisson_negf_scf
AsymmetryChou 565af97
update negf_compute
AsymmetryChou f326a0e
update NEGF.py and poisson_init.py
AsymmetryChou eb7b492
update density.py
AsymmetryChou 6ed2bb9
update device_property.py
AsymmetryChou 3ba5b13
find the bug calculating different kpoints but get same result
AsymmetryChou 0f156ce
add newK_flag and newV_flag
AsymmetryChou 616a200
add comments
AsymmetryChou 3603b7b
make Hartree2eV unit constant the same as that for dptb-negf
AsymmetryChou ef21a12
fix self energy transpose in lead_property.py
AsymmetryChou 947eb57
update NEGF.py
AsymmetryChou 2aa9081
update density.py
AsymmetryChou 8f4790c
update device_property.py
AsymmetryChou 363d8d2
update lead_property.py
AsymmetryChou 27e1ebb
add notes in lead_property.py
AsymmetryChou 567a57a
update negf_hamiltonian_init.py
AsymmetryChou 3cd8a8b
update a series of py files in negf, including poisson_init.py
AsymmetryChou 98197fd
update recursive_green_cal.py
AsymmetryChou aab802e
update surface_green.py
AsymmetryChou fc9090d
update argcheck.py
AsymmetryChou 67da37b
add abs to formula powerlaw
AsymmetryChou 921d116
simplify real-space gird setting
AsymmetryChou a74f3a2
simplify boundary_points_get in poisson_init.py
AsymmetryChou a85e9d0
update interface class initialization
AsymmetryChou d22f36e
change gate to dielectric
AsymmetryChou eeb552a
add some notes
AsymmetryChou f852edd
seperate scipy and pyamg clearer
AsymmetryChou f1363a8
transform csr to lil when attribtue values
AsymmetryChou 1508c58
combine construct_Jac and construct_B to a func
AsymmetryChou ce734a0
simplify the code for boundary conditions
AsymmetryChou c1699d1
change sign from hLL+v*sLL to hLL-v*sLL
AsymmetryChou cb77077
remove unnecessary codes in poisson_init.py
AsymmetryChou 7a5c0e4
simplify solve_poisson_NRcycle in poisson_init.py
AsymmetryChou 0c2f7ab
add proffiler in NEGF.py
AsymmetryChou 5a91788
replace print by log.info
AsymmetryChou f3e81f9
get_hs_lead only when voltage changes
AsymmetryChou 469a94b
move print to log
AsymmetryChou c1dd88a
log info update
AsymmetryChou a669274
simplify NEGF.py
AsymmetryChou cee3dd6
move Fiori cal to density.py and simplify negf_compute
AsymmetryChou d6449f9
add gauss integrate to Fiori method
AsymmetryChou 7c76568
merge Fiori_gauss and Fiori_direct together
AsymmetryChou 13c4cf0
test
AsymmetryChou febcfa8
update density.py device_property.py lead_property.py for ksum
AsymmetryChou 3d3386a
update negf_hamiltonian_init.py for ksum
AsymmetryChou 72bfd7e
update unit tests for ksum and poisson-dev
AsymmetryChou 9ae78d4
update for ksum in poisson_dev
AsymmetryChou 8595628
add atom_cor and gird_cor consistency check
AsymmetryChou 892e345
add loginfo for k-point in NEGF.py
AsymmetryChou 6916c69
Merge branch 'main' into poisson-dev
AsymmetryChou c3a5fdc
add structure for tbtrans
AsymmetryChou e57453e
copy some test files from v1
AsymmetryChou a599a67
update NEGF.py init
AsymmetryChou 0566f15
move AtomicData creator to negf_hamiltonian_init.py
AsymmetryChou 3880128
modify init of negf_hamiltonian_init.py
AsymmetryChou 519285f
add self.e3H in negf_hamiltonian_init.py
AsymmetryChou 73ac9be
add notes
AsymmetryChou 7b36d50
add atom_norb in hr2hk
AsymmetryChou 0e9595b
update NEGFHamiltonianInit initialize part for new api
AsymmetryChou 006c097
add pbc_negf in NEGFHamiltonianInit init
AsymmetryChou b56b6f6
modify pbc setting in device/lead
AsymmetryChou 491ecb0
add dptb/data/try_test.ipynb to gitignore
AsymmetryChou a38a658
Merge branch 'main' into poisson-dev
AsymmetryChou 8d4a33d
add test data for negf
AsymmetryChou 00848ec
fix api for device_property and density_Ozaki
AsymmetryChou c6d4533
fix hamilotonian_init temporarily
AsymmetryChou c37c533
Merge branch 'main' into poisson-dev
AsymmetryChou 5a5acfa
add pyamg() and scipy() in argcheck
AsymmetryChou 516e527
add soc in test_negf input
AsymmetryChou 81a1b84
add new model update to test_tbtrans_init.py temporarily
AsymmetryChou d98b591
comment import from tbtrans_init temporarily
AsymmetryChou 560031f
modify test_tbtrans files for v2
AsymmetryChou 78eb02a
update test_negf_hamiltonian_init.py
AsymmetryChou 5fd133a
modify test_negf_device_property
AsymmetryChou b3c7da9
add h_device compare
AsymmetryChou b7b2659
update negf_hamiltonian_init
AsymmetryChou dcd6054
add print ldos in test_negf_device_property
AsymmetryChou 5546799
add eta_lead option in density_integrate_Fiori
AsymmetryChou 0466ba0
modify pbc and add dtype float 64 in negf_hamiltonian_init.py
AsymmetryChou 2458130
add TODO comment in negf_hamitonian_init
AsymmetryChou 732453a
add some comments
AsymmetryChou e0ad0d1
rename path
AsymmetryChou 03e3750
force test for negf in float64
AsymmetryChou b83a1bd
add test files for negf
AsymmetryChou de8f9b9
Merge branch 'main' into poisson-dev
AsymmetryChou e0afd0c
add task negf option in run.py
AsymmetryChou 34e7812
set torch default float32 after extract H and S
AsymmetryChou c4a9f6b
update test_negf_run.py for v2
AsymmetryChou 5d71a83
add sort_btd.py and split_btd.py
AsymmetryChou 826cb98
add tbtrans_init in run.py
AsymmetryChou 654ac7c
Merge branch 'main' into poisson-dev
AsymmetryChou b0eff44
add tbtrans_init in run.py and modify tbtrans_init.py
AsymmetryChou 5067295
add unit test for tbtrans
AsymmetryChou db076ee
add btd term in test_negf*
AsymmetryChou dc737c8
fix pyamg import error
AsymmetryChou 6d2ef8f
update docstring in tbtrans_init
AsymmetryChou e48fa82
rename some variables
AsymmetryChou 5490bed
add BTD
AsymmetryChou abff5e5
fix gitignore
AsymmetryChou 07186d6
Merge branch 'main' into poisson-dev
AsymmetryChou 9bbe6d7
fix pyinstrument import probelm in pytest
AsymmetryChou 031c441
fix pyinstrument import in pytest
AsymmetryChou cdfbba0
write code in negf_hamiltonian_init in compact form
AsymmetryChou 7854c93
fix overlap Bool input probelm
AsymmetryChou dd52834
fix ldos and dos bug for BTD form
AsymmetryChou 4fff7e4
add list for pbc setting in AtomicData_options
AsymmetryChou bb89909
fix ldos and dos when length of up and down blocklist equals 0
AsymmetryChou 2659506
remove unnecessary n_proj_atom_pre variables
AsymmetryChou 2049d18
fix energy setting problem in selfenergy calculation
AsymmetryChou e205662
add test files for negf with overlap
AsymmetryChou c1e09a4
add test_negf_hamiltonian_init file
AsymmetryChou 1268160
remove unnecssary band.json
AsymmetryChou a5a7998
add .gitkeep in directory
AsymmetryChou f45a112
Merge branch 'main' into poisson-dev
AsymmetryChou 8664b19
add poisson options in argcheck
AsymmetryChou 533df92
small fix
AsymmetryChou 232b7dd
fix Vbias setting caused in sorting when using BTD
AsymmetryChou d0bc15e
update uni_test
AsymmetryChou fb39b19
fix bugs and keep dptb-Poisson SCF same as that in NanoTCAD restrictly.
AsymmetryChou 1f4f4f5
update density calculation with BTD and non-BTD consistent with NanoTCAD
AsymmetryChou 829903e
Merge branch 'main' into poisson-dev
AsymmetryChou b81c6c0
update test files
AsymmetryChou 476c91e
Merge branch 'main' into poisson-dev
AsymmetryChou f02fd27
add show_blocks in BTD mode
AsymmetryChou e7a9350
Merge branch 'main' into poisson-dev
AsymmetryChou 156968b
fix complex warning
AsymmetryChou b25ff1f
Merge branch 'main' into poisson-dev
AsymmetryChou b8d3745
add DFTB+ band plot tool
AsymmetryChou 062b1f1
fix Fiori import error when integrate way is direct
AsymmetryChou 2232c19
fix kpoints as nested_tensor form
AsymmetryChou 2488d9f
Merge branch 'main' into poisson-dev
AsymmetryChou 954debb
fix Fiori n_gauss import bug
AsymmetryChou d909a4e
recover NEGF related files
AsymmetryChou 46a43fc
Merge branch 'main' into poisson-dev
AsymmetryChou 87a2929
Merge branch 'poisson-dev' of https://github.com/AsymmetryChou/DeePTB…
AsymmetryChou f902f18
update try_bloch.ipynb
AsymmetryChou 3d221db
Merge branch 'main' into poisson-dev
AsymmetryChou 3d5bbcb
Merge branch 'main' into poisson-dev
AsymmetryChou ae7d878
add Bloch theorem in NEGF module to accelarate self-energy calculation
AsymmetryChou aab1706
fix bloch-fold self energy calculation bug and run successfully
AsymmetryChou 4212602
set dtype as float64 for unittest
AsymmetryChou 9795811
update try_bloch.ipynb
AsymmetryChou 3157cbd
support useBloch and bloch_factor in json format
AsymmetryChou 4395019
add onsite_shift in loss.py HamilLossAnalysis
AsymmetryChou b124a93
fix useBloch bug in NEGF.py
AsymmetryChou 174f0a2
fix sort_indices bug in get_lead_structure
AsymmetryChou d9c707b
Merge branch 'main' into poisson-dev
AsymmetryChou ac3f2ef
update files for bloch-self-energy in unittest
AsymmetryChou 3ecc157
update unittest files for hamiltonian.initialize's update
AsymmetryChou dd4acfb
use rmse as check standard in comparing HK_lead
AsymmetryChou 482e7e1
remove self energy saver temporarily
AsymmetryChou 06d5443
fix pbc bug to accomdate the removing of pbc in AtomicData_options
AsymmetryChou 8748b24
remove pbc output
AsymmetryChou 1dbdbec
add overlap output in feature_to_block
AsymmetryChou 633d540
set rmse_l_HK/SK as 0 when using Block
AsymmetryChou 566d02f
Merge branch 'main' into poisson-dev
AsymmetryChou cdc7fd5
add block_tridiagonal in compute_density_Ozaki
AsymmetryChou 6cf54c2
add block_tri in deviceprop.cal_green_function
AsymmetryChou c55db1b
Merge branch 'main' into poisson-dev
AsymmetryChou 24b6f87
update NEGF.py for poisson-NEGF SCF
AsymmetryChou c89f2fb
add dope region in poisson-NEGF SCF
AsymmetryChou 0766934
add dope region and I-V curve calculation
AsymmetryChou 305baab
set r_max oer_max and er_max default value as float type
AsymmetryChou 8842350
change remove_bonds_nonpbc as staticmethod and add h_lead_threshold t…
AsymmetryChou d0e9344
enlarge myConvTest in surface_green to ensure the stablization of sel…
AsymmetryChou 3f2e641
Merge branch 'main' into poisson-dev
AsymmetryChou 6599f8b
make correction for electro-boundary condition at Gate
AsymmetryChou 98fc782
output free charge with Fiori method and seperate negf_compute from p…
AsymmetryChou c7343b2
Merge branch 'main' into poisson-dev
AsymmetryChou 43d7d0b
add doc to bloch
AsymmetryChou 4d10aa6
update docstring in bloch
AsymmetryChou d89d5c3
add correct sign to Gate.Ef in unit of eV
AsymmetryChou f449cff
add poisson_dtype to assign data type when solving Poisson
AsymmetryChou 22b477c
add self energy saver
AsymmetryChou 4c7d70f
add correction to self energy saver
AsymmetryChou 6339b1a
self.alldata to alldata for less memory use
AsymmetryChou 83f5730
add se_info_display and self energy saver to all non-SCF cases
AsymmetryChou 9b34d37
seperate initialize into structure and H parts
AsymmetryChou 3c641b7
add function Hamiltonian_initialized
AsymmetryChou ece3ec3
set subblocks as property of NEGFHamiltonianInit
AsymmetryChou 51359a8
enable HS read directly from saved files
AsymmetryChou 4173d41
add HS_inmem in cal_green_function
AsymmetryChou 277c40e
shut down AD when using surfaceGreen.apply
AsymmetryChou 17ede8b
add HS_inmem in self_energy
AsymmetryChou 26abdcf
calculate self energy in reduced form to save memory
AsymmetryChou 2f0c1ec
fix logic bug when get_hs_device
AsymmetryChou 7cd8a69
add only_subblocks term in get_hs_device
AsymmetryChou 3969d34
add some docstring
AsymmetryChou de780d5
reset V as one-dimensal vector for memory saving
AsymmetryChou 5af93f5
Merge branch 'main' into poisson-dev
AsymmetryChou 8a2a6b3
add self energy shape check for block-tri format
AsymmetryChou 491a24a
use HDL_reduced to cal self energy in blcok-tri format
AsymmetryChou 5b139c2
rename variables for clearity
AsymmetryChou 29fb773
enable HS_device and HS_lead saved in hdf5 files
AsymmetryChou e8e13f5
add natsorted
AsymmetryChou 2adef6c
enable h5py format
AsymmetryChou 93df255
fix: Fix self_energy dimension check comparing with the first and las…
AsymmetryChou da7cc02
Merge branch 'main' into poisson-dev
AsymmetryChou 668d421
fix: 修改默认数据类型设置为模型的数据类型
AsymmetryChou b72a502
fix: 移除未使用的Density2Potential和getImg导入
AsymmetryChou cbe2e4f
fix: 修正NEGF类中连接原子掩码的布尔值转换,确保正确处理数据类型
AsymmetryChou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import numpy as np | ||
|
||
|
||
# The Bloch class in Python defines a method to unfold k points based on a given Bloch factor. | ||
class Bloch(object): | ||
|
||
def __init__(self,bloch_factor) -> None: | ||
'''This Python function initializes an object with a Bloch factor represented as a 3D vector. | ||
|
||
Parameters | ||
---------- | ||
bloch_factor | ||
It is expected to be a list or numpy array representing a 3D vector to expand the provided | ||
k points. | ||
|
||
''' | ||
|
||
if isinstance(bloch_factor,list): | ||
bloch_factor = np.array(bloch_factor) | ||
|
||
assert bloch_factor.shape[0] == 3, "kpoint should be a 3D vector" | ||
self.bloch_factor = bloch_factor | ||
|
||
|
||
def unfold_points(self,k:list) -> np.ndarray: | ||
'''The `unfold_points` function generates expansion k points based on Bloch theorem and reshapes the | ||
output into a specific format. | ||
|
||
Parameters | ||
---------- | ||
k | ||
The `k` parameter in the `unfold_points` method represents the original k-point in the Brillouin zone. | ||
|
||
Returns | ||
------- | ||
The `unfold_points` method returns a reshaped array of expansion points calculated based on the | ||
input parameter `k` and the bloch factor `B`. | ||
|
||
''' | ||
|
||
# check k is a 3D vector | ||
if isinstance(k,list): | ||
assert len(k) == 3, "kpoint should be a 3D vector" | ||
elif isinstance(k,np.ndarray): | ||
assert k.shape[0] == 3, "kpoint should be a 3D vector" | ||
else: | ||
raise ValueError("k should be a list or numpy array") | ||
|
||
# Create expansion points | ||
B = self.bloch_factor | ||
unfold = np.empty([B[2], B[1], B[0], 3]) | ||
# Use B-casting rules (much simpler) | ||
unfold[:, :, :, 0] = (np.arange(B[0]).reshape(1, 1, -1) + k[0]) / B[0] | ||
unfold[:, :, :, 1] = (np.arange(B[1]).reshape(1, -1, 1) + k[1]) / B[1] | ||
unfold[:, :, :, 2] = (np.arange(B[2]).reshape(-1, 1, 1) + k[2]) / B[2] | ||
# Back-transform shape | ||
return unfold.reshape(-1, 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.