In [62]:
%pylab inline
a=1; L=1/a #Define initial parameters
x = linspace(0,L,100)
def dist(x,y): return (x**2+y**2)/L**2; #Energy of a point
def points(x,y): #Gets all the energys of one point in band theory
y1=y ; E=[]
for i in range(-2,3):
for j in range(-2,3):
E.append(dist(x+2*i*L,y+2*j*L))
return E
#Plot the results
for i in range(25):
plot(2*x,points(x,x)[i],'b')
l = list(points(L,x)[i]); l.reverse(); plot(2*x+2*L,l,'b')
l2 = list(points(x,0)[i]); l2.reverse(); plot(2*x+4*L,l2,'b')
ylim([0,18]); xlim([0,6*L])
axhline(y=16, color='g', linestyle='-',lw=2); xposition = [2*L, 4*L]
for xc in xposition:
axvline(x=xc, color='r', linestyle='--',lw=2)
#Axis.set_label_coords(x, y, transform=None)
xticks( arange(7), ('$\Gamma$', '$\Sigma$', '$M$', '$Z$', '$X$','$\Delta$','$\Gamma$') )
yticks( [0,4,8,16], ('$0$','$4$','$8$','$16$') )
rcParams.update({'font.size': 22})
rc("text", usetex = True)
rc("font", family = "serif")
ylabel("$E/\pi_1$")
In [79]:
from pylab import rcParams
plot()
#set_size_inches(18.5, 10.5)
nums = []
txt = []
suma = 0
for m in range(1,7):
a = -2*cos(m*pi/7)
suma = suma+ 2*a
print a
axhline(y=a, color='b', linestyle='-',lw=2);
nums.append(a)
txt.append('%.2f' % a )
print suma , m
ylim([-2,2]); xlim([0,1])
xticks( [], () )
yticks(nums, txt )
rcParams['figure.figsize'] = 1.5, 4
rc("text", usetex = True)
rc("font", family = "serif")
rcParams.update({'font.size': 20})
ylabel("$E/\epsilon_1$")
ylabel(r'$(E-\alpha)/(-\beta$)')
Out[79]:
In [34]:
str(5.9)
Out[34]:
In [37]:
'%.2f' % 5.1
Out[37]:
In [ ]: