?Hi,
I am running a check in MPB to make sure that I understand what the eigenvectors, I have output, are. I figured the easiest check was to compare the h-fields generated by MPB to the h-fields that I recreated using the eigenvectors that I output from the same simulation. I have attached the matlab code (quick2.m) that I wrote to calculate the fields using the eigenvectors where "eigenvecs.dat" is generated by using "h5totxt" on the eigenvector output. I have also attached the .ctl file (firstbs.ctl) However, the fields I generate are completely different to the fields output by MPB. Is there something I am misunderstanding in what the eigenvectors are, how to make the G vectors or is there a trick you do that I have missed? Thank you Ross
firstbs.ctl
Description: firstbs.ctl
clear all; load('eigenvecs.dat'); a = [1 0; 0 1]; b = [2*pi 0; 0 2*pi]; for i=1:size(eigenvecs,1)/2 temp(i,:) = complex(eigenvecs(2*i-1,:), eigenvecs(2*i,:)); EV(ceil(i/2),abs(mod(i,2)-2),:) = temp(i,:); end res=floor(sqrt(size(EV,1))); count = 0; for i=1:res for j=1:res count = count + 1; r(count,1) = i/res; r(count,2) = j/res; end end for i=1:size(r,1) G(i,:) = b(1,:)*r(i,1) + b(2,:)*r(i,2); end for i=1:size(r,1) E(i) = 0; for j=1:size(G, 1) E(i) = E(i) + EV(j,1,2)*exp(1i*dot(G(j,:), r(i,:))); end end count = 1; for i=1:res for j=1:res results(i,j) = E(count); count = count + 1; end end figure; surf(real(results), 'EdgeColor','None'); view(2);
_______________________________________________ mpb-discuss mailing list mpb-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss