Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'why it is different ?' topicStudent Support Forum > General > Archives > "why it is different ?"

Help | Reply To Topic
Author Comment/Response
TING
06/11/99 5:11pm

I am running MATHEMATICA 3 on UNIX for the following program


$DefaultFont={''Courier'',13}
p1={{0,1},{1,0}};
p2={{0,-I},{I,0}};
p3={{1,0},{0,-1}};
A1=Sqrt[x] IdentityMatrix[2];
trcA1=A1;
A2=Sqrt[(1-x)/3] p1;
trcA2=A2;
A3=Sqrt[(1-x)/3] p3;
trcA3=A3;
A4=-I Sqrt[(1-x)/3] p2;
trcA4=Transpose[A4];
r=1/2 {{1+a3, a1 - a2 I},{a1 + a2 I, 1-a3}};
nrho=A1.r.trcA1+A2.r.trcA2+A3.r.trcA3+A4.r.trcA4;
eig=Eigenvalues[nrho];
H=Simplify[-eig[[1]] Log[eig[[1]],2]-eig[[2]] Log[eig[[2]],2]];
w11=A1.r.trcA1;
w12=A1.r.trcA2;
w13=A1.r.trcA3;
w14=A1.r.trcA4;
w21=A2.r.trcA1;
w22=A2.r.trcA2;
w23=A2.r.trcA3;
w24=A2.r.trcA4;
w31=A3.r.trcA1;
w32=A3.r.trcA2;
w33=A3.r.trcA3;
w34=A3.r.trcA4;
w41=A4.r.trcA1;
w42=A4.r.trcA2;
w43=A4.r.trcA3;
w44=A4.r.trcA4;
w={{w11[[1]][[1]]+w11[[2]][[2]], w12[[1]][[1]]+w12[[2]][[2]],
w13[[1]][[1]]+w13[[2]][[2]], w14[[1]][[1]]+w14[[2]][[2]]},
{w21[[1]][[1]]+w21[[2]][[2]], w22[[1]][[1]]+w22[[2]][[2]],
w23[[1]][[1]]+w23[[2]][[2]], w24[[1]][[1]]+w24[[2]][[2]]},
{w31[[1]][[1]]+w31[[2]][[2]], w32[[1]][[1]]+w32[[2]][[2]],
w33[[1]][[1]]+w33[[2]][[2]], w34[[1]][[1]]+w34[[2]][[2]]},
{w41[[1]][[1]]+w41[[2]][[2]], w42[[1]][[1]]+w42[[2]][[2]],
w43[[1]][[1]]+w43[[2]][[2]], w44[[1]][[1]]+w44[[2]][[2]]} };
weig=Eigenvalues[w];
He=-weig[[1]]*Log[weig[[1]],2]
-weig[[2]]*Log[weig[[2]],2]
-weig[[3]]*Log[weig[[3]],2]
-weig[[4]]*Log[weig[[4]],2];
f1=r.A1;
f2=r.A2;
f3=r.A3;
f4=r.A4;
f4t=r.trcA4;
F=Simplify[(f1[[1]][[1]]+f1[[2]][[2]])^2+(f2[[1]][[1]]+f2[[2]][[2]])^2+
(f3[[1]][[1]]+f3[[2]][[2]])^2+
(f4[[1]][[1]]+f4[[2]][[2]])*(f4t[[1]][[1]]+f4t[[2]][[2]])];
HeS=FullSimplify[-weig[[1]]*Log[weig[[1]],2]
-weig[[2]]*Log[weig[[2]],2]
-weig[[3]]*Log[weig[[3]],2]
-weig[[4]]*Log[weig[[4]],2]];
CI=H-He;

I do Simplify (or FullSimplify) to He. If I run it in batch by <<depol.nb
The result is different from after the program finished
I typed in Simplify[He]. Why ? Actually the time need to compute HeS is also different for different place I put
that line. WHY ?

Thank you for your answer.
Sincerely, Julian Ting

URL: ,
Help | Reply To Topic