KAIST

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ KAIST ] in KIDS
글 쓴 이(By): guest (guest) <pm475-00.dialip.> 
날 짜 (Date): 2000년 12월 24일 일요일 오후 05시 35분 54초
제 목(Title): Re:Wigner distribution function



%  
%  ===========================================
%  Wigner distribution (prepared for MATLAB V)        
%  ===========================================
%
%  Change xmin,xmax,dx,pmin,pmax,dp and function psi
%  and make your own wigner plot !
%
% Simple estimation of time :
%  calculation time is roughly proportional to
%      ((xmin-xmax)/dx)*(xmin-xmax)/dx)*(pmax-pmin)/dp)
%  and  600*600*200 points = 30 seconds.
%
xmin=-30;   %=== Change here
xmax=30;   %=== Change here
%dx=0.1;   %=== Change here
dx=0.2;   %=== Change here


pmax=2;   %=== Change here
pmin=-2;   %=== Change here
%dp=0.02;   %=== Change here
dp=0.1;   %=== Change here          

x=xmin:dx:xmax;
y=xmin:dx:xmax;
p=pmin:dp:pmax;

[X,Y]=meshgrid(x,y);

%
%  If your function is psi(x)
%       psi2(x,y)=complex conjugate psi(x+y)
%
%  So, for example, if
%       psi(x)=exp(-(x-posi)^2/width)+exp(-(x+posi)^2/width)
%  (double gaussian or double slit)
%       posi=7;width=3;
%  then
%       psi1=exp(-(X-Y-posi).^2/width)+exp(-(X-Y+posi).^2/width);
%       psi2=exp(-(X+Y-posi).^2/width)+exp(-(X+Y+posi).^2/width);
%

% =======  change your function from here   
posi=7;
width=2;
psi1=exp(-(X-Y-posi).^2/width^2)+exp(-(X-Y+posi).^2/width^2);
psi2=exp(-(X+Y-posi).^2/width^2)+exp(-(X+Y+posi).^2/width^2);
% ======  to here

[P,PY]=meshgrid(p,y);
PPY=P.*PY;
wig=(psi1'.*conj(psi2)')*exp((2*i*PPY));
subplot(2,1,1);
mesh(x,p,real(wig'));
subplot(2,1,2);
mesh(x,p,imag(wig'));
xlabel('x');
ylabel('p');

% ======= another good viewangle
%view(0,90)

%
%jwahn@umich.edu 10/20/98 
%
[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.