Skip to content

Commit

Permalink
Adding Non-equilibrium Green's Function module into postprocessing of…
Browse files Browse the repository at this point in the history
… DeePTB (#32)

* update negf

* update NEGF

* update negf

* update negf examples

* update examples negf and run with json

* update negf

* debug negf

* debug structure testing

* update negf output and example

* update negf properties cal

* s

* update NEGF

* update lead hamiltonian warning

* update negf

* enlarge the integration range and delete hello lol

* debug density

* delete the test surface green function

* update dependency list

* update negf utils to remove deprecated tools

* deprecate tqdm's reference

* deprecate tqdm in NEGF postprocess interface

* update unit_test

* update test workflow config

* Fix  seinL/seinR formula's mistakes in negf/Device.py (#7)

Co-authored-by: Season Zou <[email protected]>

* add test_negf files (#5)

* add test_negf files in test_merge_negf

* " back to original version: run_config,best_nnsk "

* "remove best_nnsk"

* "back to original version: test_config best_nnsk"

* "remove overlap set in test_config.json"

* back to original version: test_config.json

* rename run_config.json as run_input.json

* "improve the accuracy of test_negf_CFR.py"

---------

Co-authored-by: Season Zou <[email protected]>

* fix result path and gnd&gin_left in test_negf_Device.py

* add modele docstring and func initialize docstring

* add get_hs_device docstring

* add get_hs_lead docstring

* finish docstring in hamiltonian.py

* add Hamiltonian Class docstring

* change variable name: e to energy in Device.py

* add docstring for functions/methods in Device.py

* add spin multiplicity in _cal_ldos_

* add spin multiplicity in test_negf_Device.py

* add docstring for Device class

* add docstring for get_index

* add docstring to Lead.py

* change var name: e to energy in self_energy

* change var name e to energy in self_energy in density.py

* change var name e to energy in test_negf_Device.py

* add docstring to density.py

* add docstring to utils

* add docstring to surface_green.py

* fix rename var mistakes with test files

* add explanation into docstring of Device class

* rename Device.py as device_property.py

* rename class name Device as device_property

* rename CFR as ozaki_res_cal, Class ozaki_residues as Ozaki_residues

* fix rename Classname mistake about device_property

* rename Modulename Lead as lead_property, Classname Lead as Lead_property

* rename Areshkin as areshkin_pole_sum

* rename Modulename utils as negf_utils

* rename Classname surface_green as Surface_green

* add soem more docstring to density.py

* rename Mod_Name hamiltonian as hamiltonian_init, ClassName Hamiltonian as Hamiltonian_init

* rename Mod_Name RGF as recursive_green_cal

* rename ClassName recursive_gf as Recursive_gf

* rename Mod_Name SCF as scf_method

* rename Classname _recursive_gf as recursive_gf_cal

* add some more docstring to recursive_green_cal

* rename ClassName density2Potential as Density2Potential

* rename ClassName _SCF as SCFMethod

* rename ClassName Surface_green as SurfaceGreen

* rename fun_name Ozaki_residues as ozaki_residues

* fix warning by declaring RegEx pattern \r in line 44 45

* rename func_name and ClassName in negf_utils.py

* rename ClassName Hamiltonian_init as HamiltonianInit

* rename ClassName for Device_property and Lead_property

* rename fun_name Recursive_gf as recursive_gf

* rename k as Boltzmann, ev as ev2J

* fix unit constant problem

* add pi to poisson

* delete redundant  ‘main’

* update NN2HRK.py and lead.py

rename the class structure.lead.Lead to LeadStruct

* update density.py, NN2HRK.py and device.py:

rename class structure/Device to DeviceStruct

* 🌈 style(negf): rename hamiltonian_init

1. rename the file negf/hamiltonian_init to negf_hamiltonian_init
2. rename the class negf/negf/hamiltonian_init/HamiltonianInit to NEGFHamiltonianInit
3. the corresponding changes in other files that used the hamiltonian_init

* rename device_id in negf_hamiltonian_init to proj_device_id
remove the import * in NEGF.py

* update negf_hamiltonian_init.py :

rename lead_id to proj_lead_id

* update device_property.py

1. rename the Property: green to greenfuncs in class DeviceProperty
2. rename the methodn green_function to cal_green_function

* update density.py:
1. rename the input para in claass Density.integrate and slice funcion: device -> deviceprop
2. rename the input para in claass Ozaki.integrate funcion: device -> deviceprop,
3. make  corresponding change since the property and method funtion name has changed in DensityProperty.
green > greenfuncs
green_function->cal_green_function

* update NEGF.py :

1. make change since the DensityProperty change the property and method
2. make change since the input para name of class Density and Ozaki.

* test: update test_negf_density_Ozaki.py and test_negf_device_property.py

* add explaination for HL HLL etc. in LeadProperty

* update surface_green.py

add docstring for calcg0

* fix (negf): the bug when set V = mu-efermi.

* update NEGF.py:

1. add todo for add common class to set all the dtype and precision.

2. rename self.hamiltonian to self.negf_hamiltonian

---------

Co-authored-by: Jijie Zou <[email protected]>
Co-authored-by: Season Zou <[email protected]>
Co-authored-by: AsymmetryChou <[email protected]>
Co-authored-by: qqgu <[email protected]>
  • Loading branch information
5 people authored Nov 2, 2023
1 parent ff5d488 commit 54d9778
Show file tree
Hide file tree
Showing 40 changed files with 5,959 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
id: s1
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Install DeePTB & Run Test
id: s2
Expand Down
8 changes: 7 additions & 1 deletion dptb/entrypoints/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from dptb.postprocess.bandstructure.fermisurface import fs2dcalc, fs3dcalc
from dptb.postprocess.bandstructure.ifermi_api import ifermiapi, ifermi_installed, pymatgen_installed
from dptb.postprocess.write_skparam import WriteNNSKParam
from dptb.postprocess.NEGF import NEGF

__all__ = ["run"]

Expand Down Expand Up @@ -142,7 +143,7 @@ def run(
if jdata.get("common_options", None):
# in this case jdata must have common options
str_dtype = jdata["common_options"]["dtype"]
jdata["common_options"]["dtype"] = dtype_dict[jdata["common_options"]["dtype"]]
# jdata["common_options"]["dtype"] = dtype_dict[jdata["common_options"]["dtype"]]

if run_sk:
apihost = NNSKHost(checkpoint=model_ckpt, config=jdata)
Expand Down Expand Up @@ -206,6 +207,11 @@ def run(
write_sk.write()
log.info(msg='write_sk calculation successfully completed.')

if task == 'negf':
negf = NEGF(apiHrk, run_opt, task_options)
negf.compute()
log.info(msg='NEGF calculation successfully completed.')


if output:
with open(os.path.join(output, "run_config.json"), "w") as fp:
Expand Down
1 change: 1 addition & 0 deletions dptb/negf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from dptb.negf import *
Loading

0 comments on commit 54d9778

Please sign in to comment.