2
! Copyright (C) 1996-2016 The SIESTA group
3
! This file is distributed under the terms of the
4
! GNU General Public License: see COPYING in the top directory
5
! or http://www.gnu.org/copyleft/gpl.txt .
6
! See Docs/Contributors.txt for a list of contributors.
10
! This code has been fully implemented by:
13
! Please attribute the original author in case of dublication
15
! Enable the feature of manipulating with the
16
! Hamiltonian from outside.
18
! This is easily done by letting the user
19
! create a NetCDF file which contain dSE elements
20
! which will enter the NEGF equations through:
22
! We note that the user can input several different
24
! corresponding to different situations.
25
! If dSE is complex, one can use dSE as an onsite
26
! self-energy change, thus introducing spurious
29
! The dSE is effectively a change in the self-energies and
30
! will thus NOT enter in the equations for the bond-currents.
31
! If one has a dSE term that should contribute to the bond-currents
32
! please look at m_tbt_dH.F90.
34
! There are 4 levels of usage:
36
! This will enter in a common equation
38
! This will only enter for the corresponding
40
! H_k = H_k + dSE_k' with dSE_k' = 0 for k/=k'
42
! This will as 2. only enter for specific
44
! H(E) = H(E) + dSE(E') with dSE(E') = 0 for E/=E'
45
! 4. k and E dependent dSE
46
! H_k(E) = H_k(E) + dSE_k'(E') with dSE_k'(E') = 0 for E/=E' and k/=k'
48
! Note that the highest level has precedence above the others,
49
! so specifying both 1. and 4. will only be the equivalent of
52
! This is particularly handy for TB calculations
53
! but can prove just as useful for regular DFT
54
! calculations as one can use an already existing
55
! SIESTA.nc file, and then do several "case" studies
56
! on such a file, thus actually having FULL control
61
use m_tbt_delta, only: tDelta
67
! The dSE global variable
68
type(tDelta), save :: dSE
70
! Whether this is used or not
71
logical :: use_dSE = .false.
73
public :: dSE, use_dSE
75
public :: init_dSE_options, print_dSE_options
79
subroutine init_dSE_options( )
80
use m_tbt_delta, only: init_delta_options, delta_has_level
85
call init_delta_options('dSE', dSE)
88
use_dSE = use_dSE .or. delta_has_level(dSE, i)
91
end subroutine init_dSE_options
93
subroutine print_dSE_options( )
95
use parallel, only : IONode
97
character(len=*), parameter :: f10='(''tbt: '',a,t53,''='',tr4,a)'
98
character(len=*), parameter :: f11='(''tbt: '',a)'
99
character(len=*), parameter :: f1 ='(''tbt: '',a,t53,''='',tr4,l1)'
101
if ( .not. IONode ) return
104
if ( len_trim(dSE%fname) == 0 ) then
105
write(*,f11)'No delta self-energy'
109
write(*,f10)'User selected dSE file', trim(dSE%fname)
111
write(*,f11)'delta self-energy cannot be used (requires NetCDF4)'
114
end subroutine print_dSE_options