In [1]:

```
from __future__ import division
import math
# Python Code Ex11.2 Determining ratio between K.E. of
# an electron in 2D square lattice: Page-370 (2010)
#Variable declaration
h = 6.626e-034; # Planck's constant, Js
m = 9.1e-031; # Mass of an electron, kg
a = 1; # For simplicity assuming lattice parameter to be unity, m
#Calculation
# Case-I when k_x = k_y = %math.pi/a
k_x = math.pi/a
k_y = math.pi/a; # Wave numbers in X- and Y- directions, rad per metre
# Energy of the electron inside a Brilliouin Zone, J
E1 = h**2/(8*math.pi**2*m)*(k_x**2 + k_y**2);
# Case-II when k_x = %math.pi/a and k_y = 0
k_x = math.pi/a
k_y = 0; # Wave numbers in X- and Y- directions, rad per metre
# Energy of the electron inside a Brilliouin Zone, J
E2 = h**2/(8*math.pi**2*m)*(k_x**2 + k_y**2);
# Ratio between K.E. of an electron in 2D square lattice
E_ratio = E1/E2;
#Result
print"\nThe ratio between K.E. of an electron in 2D square lattice =", E_ratio
```