Commit 95759b73 authored by Nick R. Papior's avatar Nick R. Papior
Browse files

enh: changed the sparse matrices stored from electrodes

Now we store the H(-R) for positive directions
adn H(R) for negative directions and use the reverse
phases.

This means we get faster indexing when creating the
matrices for SE calculations. I have checked that
the results are the same.
parent 57897def
......@@ -1543,7 +1543,7 @@ contains
! and therefore we *must* setup the Hamiltonian in the
! correct order (not relying on symmetries)
do is = 0 , n_s - 1
ph(is) = exp(cmplx(0._dp, dot_product(kq,sc_off(:,is))))
ph(is) = exp(cmplx(0._dp, -dot_product(kq,sc_off(:,is))))
end do
! Initialize arrays
......@@ -1563,8 +1563,8 @@ contains
jo = ucorb(l_col00(ind),no)
is = (l_col00(ind)-1) / no
Hk(io,jo) = Hk(io,jo) + (H00(ind,ispin) - Ef * S00(ind)) * ph(is)
Sk(io,jo) = Sk(io,jo) + S00(ind) * ph(is)
Hk(jo,io) = Hk(jo,io) + (H00(ind,ispin) - Ef * S00(ind)) * ph(is)
Sk(jo,io) = Sk(jo,io) + S00(ind) * ph(is)
end do
! Create 01
......@@ -1572,8 +1572,8 @@ contains
jo = ucorb(l_col01(ind),no)
is = (l_col01(ind)-1) / no
Hk_T(io,jo) = Hk_T(io,jo) + (H01(ind,ispin) - Ef * S01(ind)) * ph(is)
Sk_T(io,jo) = Sk_T(io,jo) + S01(ind) * ph(is)
Hk_T(jo,io) = Hk_T(jo,io) + (H01(ind,ispin) - Ef * S01(ind)) * ph(is)
Sk_T(jo,io) = Sk_T(jo,io) + S01(ind) * ph(is)
end do
......
......@@ -152,7 +152,7 @@ module m_ts_electype
! --- --- completed the content of the TSHS file
! Below we create the content for the self-energy creation
! Notice that we can save some elements simply by extracting the 0-1 connections
! for large systems this is a non-negligeble part of the memory...
! for large systems this is a non-negligeable part of the memory...
type(Sparsity) :: sp00, sp01
type(dSpData2D) :: H00, H01
type(dSpData1D) :: S00, S01
......@@ -1783,10 +1783,11 @@ contains
! Notice that we create the correct electrode transfer hamiltonian...
if ( has_01 ) then
! We use the *opposite* direction because of the order of io->jo
if ( this%inf_dir == INF_NEGATIVE ) then
tm(this%t_dir) = -1
else if ( this%inf_dir == INF_POSITIVE ) then
tm(this%t_dir) = 1
else if ( this%inf_dir == INF_POSITIVE ) then
tm(this%t_dir) = -1
else
call die('Electrode direction not recognized')
end if
......@@ -1965,10 +1966,11 @@ contains
S => val(this%S)
tm(:) = TM_ALL
! We use the *opposite* direction because of the order of io->jo
if ( this%inf_dir == INF_POSITIVE ) then
tm(this%t_dir) = 2
else
tm(this%t_dir) = -2
else
tm(this%t_dir) = 2
end if
call crtSparsity_SC(this%sp,sp02, TM=tm, &
ucell=this%cell, isc_off=this%isc_off)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment