function Declare(buuu) %************************************************************* % Part of the Dirac package % Declare(' |a> |b> |c> |d> |psi> [O1] [O2] (c1) (c2) (c3)') % Defines Dirac Vectors |a> |b> Operators O1 O2 % and constants c1 c2 c3 %************************************************************* global GLOBALIZE; global DECLARED; blanc=setstr(32); NONE=''; teststr=buuu; %remove all double blanks while findstr(teststr,[blanc blanc])~=[] teststr=strrep(teststr,[blanc blanc],blanc); end %remove blanc at beginning and end if teststr(length(teststr))==blanc teststr=teststr(1:length(teststr)-1) ; end if teststr(1)==blanc teststr=teststr(2:length(teststr)) ; end teststr=strrep(strrep(teststr,'[',' global '),']',';'); teststr=strrep(strrep(teststr,'(',' global '),')',';'); teststr=strrep(strrep(teststr,'|',' global '),'>',';'); GLOBALIZE=[GLOBALIZE teststr]; DECLARED=[DECLARED buuu ' ' ] eval(GLOBALIZE);