You're right, the problem is that Sage isn't simplifying it:
The following code applies the simplify_full() method to each entry of
OT*M*O
sage: D=OT*M*O
sage: D.apply_map(lambda x: x.simplify_full())
[ 2 0 0]
[ 0 11 0]
[ 0 0 11]
Jason
>
> That worked great, thanks! Here's the exact code I've used, if it may
> help some noobie like myself someday:
>
> M = matrix([[8,-3,-3],[-3,8,-3],[-3,-3,8]])
> show(M)
> O = matrix([[1/sqrt(3),1/sqrt(2),1/sqrt(6)],[1/sqrt(3),-1/sqrt(2),1/
> sqrt(6)],[1/sqrt(3),0,-2/sqrt(6)]])
> OT = O.transpose()
> show(O)
> show(OT)
> show(OT * O)
> diag = matrix([[2,0,0],[0,11,0],[0,0,11]])
> show(diag)
> D=OT * M * O
> show(D)
> f = D.apply_map(lambda x: x.simplify_full())
> show(f)
>
> The important thing I noticed is that D.apply_map() doesn't update D
> itself, but must be assigned to a new variable.
>
Yes, or you could assign it to D again:
D = D.apply_map(lambda x: x.simplify_full())
Jason