-
Notifications
You must be signed in to change notification settings - Fork 17
/
disorder.f90
110 lines (86 loc) · 3.03 KB
/
disorder.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
!+---------+---------+---------+---------+---------+---------+--------+!
! This subroutine is used for providing disorder H00 and H01
! Disorder type : 1. Simple 2. magnetic 3. Vacuum 4. only on surface
! Simple type : only change onsite energy randomly with spin equally
! Magnetic type : change onsite energy randomly with spin unequally
! Vacuum type : delete some atoms randomly
! Constructed by Quan Sheng Wu on Jau/8/2011
!+---------+---------+---------+---------+---------+---------+--------+!
subroutine disorder(dh00)
use para
implicit none
! loop index
integer :: i
integer :: i1
integer :: n1
real(Dp) :: dh, dh1
! Hamiltonian in principle layer
complex(Dp),intent(inout) :: dh00(Ndim,Ndim)
dh00=zzero
IF (disorder_type .eq. 'simple')THEN
! Simple type
do n1=1, Ny ! y direction
do i1=1, Nx ! x direction
do i= 1, Nband
! disorder rate
if(ran(Seed).le.rate)then
! spin up
dh=(-0.5d0+ran(Seed))*disorder_strength
dh00((i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i,&
(i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i)=dh
! spin down
dh=(-0.5d0+ran(Seed))*disorder_strength
dh00((i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i+Nband,&
(i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i+Nband)=dh
endif
enddo
enddo!i1
enddo!n1
ELSEIF (disorder_type .eq. 'surface')THEN
! only on surface
do n1=1,Ny ! y direction
do i1=1,Nx ! x direction
! diagnoal
! on the surface
dh=(-0.5d0+ran(Seed))*disorder_strength
if (i1.eq.1 .or. i1 .eq. Ny)then
do i=1,Nband
! disorder rate
if (ran(Seed).le.rate)then
! print*, 'there are some random impurites'
! spin up
dh00((i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i,&
(i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i)=dh
! spin down
dh00((i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i+Nband,&
(i1-1)*Ny*Nband*2+(n1-1)*Nband*2+i+Nband)=dh
endif
enddo
endif
enddo!i1
enddo!n1
ELSEIF (disorder_type .eq. 'bulk_magnetic')THEN
! bulk magnetic impurity type
do i1=1,Ny ! y direction
do n1=1,Nx ! x direction
do i=1, Nband
! disorder rate
if(ran(Seed).le.rate)then
! print*, 'there are some random impurites'
dh =(-0.5d0+ran(Seed))*disorder_strength
dh1=(-0.5d0+ran(Seed))*disorder_strength
! spin up
dh00((i1-1)*Np*Nband*2+(n1-1)*Nband*2+i,&
(i1-1)*Np*Nband*2+(n1-1)*Nband*2+i)=dh
! spin down
dh00((i1-1)*Np*Nband*2+(n1-1)*Nband*2+i+Nband,&
(i1-1)*Np*Nband*2+(n1-1)*Nband*2+i+Nband)=dh1
endif
enddo
enddo!i1
enddo!n1
ELSE
Write(*,*)' no disorder type input'
ENDIF
return
end subroutine disorder