Electron in two dimensional square lattice in the tight binding approximation-MatLab code

Tuesday, July 31, 2012

This is the MatLab coding for Electron in two dimensional square lattice in the tight binding approximation. Please give me your feedback Thanks



%Tight Binding for 2D lattice

clear all;
close all;
clc;
a=4;
E0=1;
d = (2*pi/a)/100;
cons=1/3.8;
Kx=[-pi/a:d:pi/a];
Ky=[-pi/a:d:pi/a];
n=1;
m=1;

%Part 1: 3D picture for energy surface====================================
for i=1:1:length(Kx)
 
    for j=1:1:length(Ky)
        E1(j,i)= E0*(2-cos(a*Kx(i))-cos(a*Ky(j)));
    end

end

figure('Name','energy Surface for 2D Lattice','NumberTitle','on')
subplot(1,2,1)
surfc(Kx,Ky,E1);
xlabel('kx');
ylabel('ky');
zlabel('E');
text(0,0,texlabel('Gamma'),'FontSize',18)
text(pi/a,pi/a,texlabel('W'),'FontSize',18)
text(pi/a,0,texlabel('X'),'FontSize',18)
text(pi/8,pi/8,2,texlabel('E=2'),'FontSize',18)
view([70 20]);
title('Energy Surface for 2D Lattice');


% Plot constant energy lines
%figure('Name','Contour plot for Energy','NumberTitle','on')
subplot(1,2,2)
[c,h]=contour(Kx,Ky,E1);
clabel(c,h)

xlabel('kx');
ylabel('ky');
text(0,0,texlabel('Gamma'),'FontSize',15)
text(pi/a,pi/a,texlabel('W'),'FontSize',15)
text(pi/a,0,texlabel('X'),'FontSize',15)
title('Contour diagram for Energy surface')

% end of part 1===========================================================

%Part 3+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ky2=[pi/a:-d:0];
for j=1:1:length(Ky2)
    E2(j)= E0*(2-cos(pi)-cos(a*Ky2(j)));
 
end
figure('Name','E(k) along W-X','NumberTitle','on')
plot(Ky2,E2,'.-');
set(gca,'XDir','reverse')
xlabel('kx');
ylabel('E(k)');
ylim([0 4*E0+.5]);
title('E(k) along W-X')
text(pi/a,-.25,texlabel('W'),'FontSize',12)
text(0,-0.25,texlabel('X'),'FontSize',12)
%end of part 3++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


%part 4*******************************************************************
%Fermi surface for one electron per site. 3D diagram
figure('Name','Fermi surface for one electron per site.','NumberTitle','on')
subplot(1,2,1)
Ef1=ones(length(Kx),length(Ky))*2*E0;
surfc(Kx,Ky,E1)
hold on
surfc(Kx,Ky,Ef1);
xlabel('kx');
ylabel('ky');
zlabel('E');
title('Fermi surface for one electron per site-3D diagram');


%Fermi energy for two electron per site. 2D  plot

subplot(1,2,2)
Ef1=2*E0

for i=1:1:length(Kx)
    ky(i,1)=(acos(2-cos(a*Kx(i))-Ef1/E0))/a;
    ky(i,2)=-(acos(2-cos(a*Kx(i))-Ef1/E0))/a;
end
plot(Kx,ky,'b')
xlim([-pi/a pi/a]);
ylim([-pi/a pi/a]);
xlabel('kx');
ylabel('ky');
title('Fermi surface for one electron per site-2D diagram');
%end of part4*************************************************************



%part 5-------------------------------------------------------------------
%Fermi surface for two electron per site. 3D diagram
figure('Name','Fermi surface for two electron per site.','NumberTitle','on')
subplot(1,2,1)
Ef2=ones(length(Kx),length(Ky))*4*E0;
surfc(Kx,Ky,E1)
hold on
surfc(Kx,Ky,Ef2);
xlabel('kx');
ylabel('ky');
zlabel('E');
title('Fermi surface for two electron per site-3D diagram');

%Fermi energy for two electron per site. 2D  plot

subplot(1,2,2)
E=3.99*E0

for i=1:1:length(Kx)
    ky(i,1)=(acos(2-cos(a*Kx(i))-E/E0))/a;
    ky(i,2)=-(acos(2-cos(a*Kx(i))-E/E0))/a;
end
plot(Kx,ky,'b')
xlim([-pi/a pi/a]);
ylim([-pi/a pi/a]);
xlabel('kx');
ylabel('ky');
title('Fermi surface for one electron per site-2D diagram');
%end of part5-------------------------------------------------------------