codexpast-exam-of-the-condensed-matter-physics-major-option-course-of-the-university-of-oxford2015-rectangular-tight-binding-band-and-fermi-lines.py
past-exam-of-the-condensed-matter-physics-major-option-course-of-the-university-of-oxford/2015-rectangular-tight-binding-band-and-fermi-lines.py
from pathlib import Path
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Circle, Polygon
plt.rcParams.update({"font.size":11,"font.family":"DejaVu Sans","figure.facecolor":"white","axes.facecolor":"white","savefig.facecolor":"white"})
fig,axs=plt.subplots(1,3,figsize=(13.5,4.6),layout='constrained')
ax=axs[0];ax.add_patch(Rectangle((-1,-1),2,2,fill=False,lw=2,ec='#174c75'))
for x,y,label in [(0,0,r'$\Gamma$'),(1,0,'X'),(0,1,'Y'),(1,1,'M')]:ax.scatter(x,y,color='#b35b15');ax.text(x+.05,y+.08,label,fontsize=12)
ax.set(xlim=(-1.2,1.35),ylim=(-1.2,1.35),xlabel=r'$k_x/(\pi/a)$',ylabel=r'$k_y/(\pi/b)$',title='Physical zone: wider in kx');ax.set_box_aspect(.7);ax.set_xticks([-1,0,1]);ax.set_yticks([-1,0,1])
ax=axs[1];vertices=np.pi*np.array([[0,0],[1,1],[1,0],[0,0],[0,1],[1,1],[0,0]])
for j,(p,q) in enumerate(zip(vertices[:-1],vertices[1:])):
z=np.linspace(0,1,160);xy=p[:,None]+(q-p)[:,None]*z;E=-4*np.cos(xy[0])-2*np.cos(xy[1]);ax.plot(j+z,E,color='#174c75',lw=2)
ax.axhline(0,color='gray',ls=':');ax.set_xticks(range(7),[r'$\Gamma$','M','X',r'$\Gamma$','Y','M',r'$\Gamma$']);ax.set(ylabel=r'$(E-E_0)/t_y$',xlabel='Linear interpolation on each path segment',title=r'$t_x=2t_y$ band path');ax.grid(alpha=.15)
ax=axs[2];y=np.linspace(-np.pi,np.pi,500);x=np.arccos(-.5*np.cos(y));ax.plot(x/np.pi,y/np.pi,color='#174c75',lw=2);ax.plot(-x/np.pi,y/np.pi,color='#174c75',lw=2);ax.set(xlim=(-1,1),ylim=(-1,1),xlabel=r'$k_xa/\pi$',ylabel=r'$k_yb/\pi$',title=r'Half filling: $E_F=E_0$');ax.grid(alpha=.2)
fig.suptitle('Rectangular tight-binding band: symmetry points, dispersion and open Fermi sheets',fontsize=15)
fig.savefig(Path.cwd()/Path(__file__).with_suffix('.png').name,dpi=140,transparent=False)