Skip to content

Commit

Permalink
Add inelastic transport
Browse files Browse the repository at this point in the history
  • Loading branch information
pecchia committed May 31, 2022
1 parent bc70bde commit 23c99a2
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 173 deletions.
2 changes: 1 addition & 1 deletion external/libnegf/origin
Submodule origin updated 178 files
1 change: 1 addition & 0 deletions src/dftbp/dftbplus/inputdata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ module dftbp_dftbplus_inputdata
logical :: tSpinOrbit = .false.
logical :: tDualSpinOrbit = .false.
logical :: t2Component = .false.
logical :: tReduceByKInversion = .true.

!> initial spin pattern
real(dp), allocatable :: initialSpins(:,:)
Expand Down
2 changes: 1 addition & 1 deletion src/dftbp/dftbplus/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ subroutine processGeometry(this, env, iGeoStep, iLatGeoStep, tWriteRestart, tSto
#:if WITH_TRANSPORT
if (this%tNegf) then
call this%negfInt%setup_structure(this%denseDesc, this%transpar, this%ginfo%greendens, &
& this%ginfo%tundos, this%coord, this%neighbourList, this%nNeighbourSK, &
& this%ginfo%tundos, this%coord, this%latVec, this%neighbourList, this%nNeighbourSK, &
& this%img2CentCell, this%orb)
end if
#:endif
Expand Down
242 changes: 149 additions & 93 deletions src/dftbp/dftbplus/parser.F90

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/dftbp/extlibs/negf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ module dftbp_extlibs_negf
& z_CSR, z_DNS, READ_SGF, COMP_SGF, COMPSAVE_SGF, DELTA_SQ, DELTA_W, DELTA_MINGO,&
& associate_lead_currents, associate_ldos, associate_transmission, associate_current,&
& compute_current, compute_density_dft, compute_ldos, create, create_scratch, destroy,&
& set_readoldDMsgf, destroy_matrices, destroy_negf, get_params, init_contacts, init_ldos,&
& set_readoldDMsgf, destroy_negf, get_params, init_contacts, init_ldos,&
& init_negf, init_structure, pass_hs, set_bp_dephasing, set_drop, set_elph_block_dephasing,&
& set_elph_dephasing, set_elph_s_dephasing, set_ldos_indexes, set_params, set_scratch,&
& set_tun_indexes, writememinfo, writepeakinfo, dns2csr, csr2dns, nzdrop, printcsr,&
& compute_phonon_current, thermal_conductance, convertHeatCurrent, convertHeatConductance, &
& interaction_models, set_elph_inelastic, set_kpoints, init_basis, compute_layer_current, &
& create_hs
& interaction_models, set_elph_polaroptical, set_elph_nonpolaroptical, set_kpoints, &
& init_basis, compute_layer_current, compute_meir_wingreen, set_scba_tolerances, create_hs, &
& destroy_hs
#:if WITH_MPI
use libnegf, only : negf_mpi_init, negf_cart_init
#:endif
Expand Down
39 changes: 21 additions & 18 deletions src/dftbp/transport/matconv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,16 @@ subroutine unfoldFromCSR_real(sparse, csr, iAtomStart, iPair, iNeighbor, nNeighb
! Put the rows belonging to a certain atom into the appropriate column
! of the block column. (Matrix is assumed to be symmetric!)
tmpCol(:,:) = 0.0_dp
nOrb1 = orb%nOrbAtom(iAt1)
iCol = iAtomStart(iAt1)
do iOrb1 = 1, nOrb1
ii = iCol + iOrb1 - 1
do ind = csr%rowpnt(ii), csr%rowpnt(ii+1) - 1
tmpCol(csr%colind(ind), iOrb1) = real(csr%nzval(ind))
end do
end do
if (allocated(csr%nzval)) then
nOrb1 = orb%nOrbAtom(iAt1)
iCol = iAtomStart(iAt1)
do iOrb1 = 1, nOrb1
ii = iCol + iOrb1 - 1
do ind = csr%rowpnt(ii), csr%rowpnt(ii+1) - 1
tmpCol(csr%colind(ind), iOrb1) = real(csr%nzval(ind))
end do
end do
end if

! Unfold the block column into the internal sparse format
do iNeigh = 0, nNeighbor(iAt1)
Expand Down Expand Up @@ -684,16 +686,17 @@ subroutine unfoldFromCSR_cplx(sparse, csr, kPoint, kWeight, iAtomStart, iPair, i
! Put the rows belonging to a certain atom into the appropriate column
! of the block column. (Matrix is assumed to be hermitian!)
tmpCol(:,:) = (0.0_dp, 0.0_dp)
nOrb1 = orb%nOrbAtom(iAt1)
iCol = iAtomStart(iAt1)
do iOrb1 = 1, nOrb1
ii = iCol + iOrb1 - 1
do ind = csr%rowpnt(ii), csr%rowpnt(ii+1) - 1
tmpCol(csr%colind(ind), iOrb1) = conjg(csr%nzval(ind))
! NOTE: why conjg ??
end do
end do

if (allocated(csr%nzval)) then
nOrb1 = orb%nOrbAtom(iAt1)
iCol = iAtomStart(iAt1)
do iOrb1 = 1, nOrb1
ii = iCol + iOrb1 - 1
do ind = csr%rowpnt(ii), csr%rowpnt(ii+1) - 1
tmpCol(csr%colind(ind), iOrb1) = conjg(csr%nzval(ind))
! NOTE: why conjg ??
end do
end do
end if
! Unfold the block column into the internal sparse format
do iNeigh = 0, nNeighbor(iAt1)
ind = iPair(iNeigh,iAt1) + 1
Expand Down
Loading

0 comments on commit 23c99a2

Please sign in to comment.