使用核多项式态密度方法,计算二维方格子安德森模型的态密度
首先生成系数矩阵形式的哈密顿量
function H=Hamiltonian_sparse_2D_lattice(Nx,Ny,W)
N = Nx * Ny; % number of atoms
% The following data will be used to construct the sparse matrix H
% 每个原子有4个相邻原子,共4N个hooping项
row = zeros(N * 4, 1);
col = zeros(N * 4, 1);
Hij = -ones(N * 4, 1);
count = 0;
for nx = 0 : Nx - 1
for ny = 0 : Ny - 1
% 找到nx,ny编号对应的一维的原子编号
index_center = find_index(nx, ny, Ny);
% 找到对应左边原子的编号
index_left = find_index(mod(nx - 1, Nx), ny, Ny);
% 生成左边原子hooping
count = count + 1;
row(count) = index_center;
col(count) = index_left;
% 找到对应原子右边原子的编号
index_right = find_index(mod(nx + 1, Nx), ny, Ny);
% 生成与右边原子的hooping
count = count + 1;
row(count) = index_center;
col(count) = index_right;
% 找到原子下面原子的编