📄 schrtrack2d.m
字号:
function [E,psi]=schrtrack2D(pot,x,y,massx,massy,ev,evec)
%SCHRTRACK2D refine eigenvalues in 2D
%
%[E,psi]=schrsolv2D(pot,x,y,massx,massy,ev,evec)
%
%Refines old solutions of Schroedingers Equation in 2D using inverse vectoriteration
%
%pot : potential
%x,y : indices of node positions in global node positions aquila_structure.xpos/.ypos
%massx,massy: mass
%ev : vector of old eigenenergies
%evec : matrix of corresponding wavefunctions
%Copyright 1999 Martin Rother
%
%This file is part of AQUILA.
%
%AQUILA is free software; you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation; either version 2 of the License, or
%(at your option) any later version.
%
%AQUILA is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with AQUILA; if not, write to the Free Software
%Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
global aquila_structure
nx=length(x)-2;
ny=length(y)-2;
%get the area covered by each node for later normalization
bv=sqrt(aquila_structure.boxvol(y(2:end-1),x(2:end-1)));
%generate the corresponding Schroedinger matrix
H=genmatrix2D(pot,x,y,massx,massy);
%reshape the eigenvectors from AQUILA format into columns of a matrix
psi=[];
for i_count=0:length(ev)-1
psix=evec(:,i_count*(nx+2)+1:(i_count+1)*(nx+2));
psix=psix(2:ny+1,2:nx+1)';
psi=[psi psix(:)];
end
%call inverse vectoriteration
[E,psi2]=inviter2(H,nx,ev,psi);
%normalize the results and reshape them into AQUILA format
%AQUILA stores all eigenfunctions of one carrier type of a QBOX in one matrix
%containing the matrices of the eigenfunctions stacked from left to right:
% #####|#####|#####
% #EV1#|#EV2#|#EV3#
% #####|#####|#####
psi2=reshape(psi2,nx,ny*length(E));
psi=[];
for i_count=0:length(E)-1
psix=psi2(:,i_count*ny+1:(i_count+1)*ny)'./bv;
psix=psix./sqrt(sum(sum(psix.*psix.*bv.*bv)));
%the wavefunction has value zero as boundary condition
psi=[psi [zeros(1,nx+2);zeros(ny,1) psix zeros(ny,1);zeros(1,nx+2)]];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -