MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Orthogonalize[expr]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123348] Re: Orthogonalize[expr]
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Fri, 2 Dec 2011 07:22:28 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112011052.FAA14667@smc.vnet.net>

On 12/01/2011 04:52 AM, é?? å?? wrote:
> Question: We  diagonalize the matrix
>
> {{L^2*mw^2 + ml^2, a*mw*ml}, {a*mw*ml, r^2*mw^2 + ml^2}}
>
> where L, mw, ml, a and r are real numbers.
>
> As a result, the normalizing orthogonalizion base is
>
> {Cos[the],Sin[the]} and {-Sin[the],Cos[the]}
>
> where Tan[2*the]=2*a*ml/((L^2-r^2)*mw)
>
> But now in mathematica we do it as follows:
>
> In[1]:= Mat = {{L^2*mw^2 + ml^2, a*mw*ml}, {a*mw*ml, r^2*mw^2 + ml^2}}
>
> In[2]:= Orthogonalize[Eigenvectors[Mat]]
>
> The result is quite complicated with Abs[expr] and Conjugate[expr].
> How can we get the desired result?Can you help me?

Why do you use Orthogonalize on the eigenvectors? The matrix is real and 
symmetric so for generic values of the parameters the eigenvectors are 
already orthogonal.

In[28]:= mat = {{l^2*mw^2 + ml^2, a*mw*ml}, {a*mw*ml,
     r^2*mw^2 + ml^2}};

In[29]:= {vals, vecs} = Eigensystem[mat]
Out[29]= {{(1/2)*(2*ml^2 + l^2*mw^2 + mw^2*r^2 -

      Sqrt[mw^2*(4*a^2*ml^2 + l^4*mw^2 - 2*l^2*mw^2*r^2 +
          mw^2*r^4)]),
      (1/2)*(2*ml^2 + l^2*mw^2 + mw^2*r^2 +

      Sqrt[mw^2*(4*a^2*ml^2 + l^4*mw^2 - 2*l^2*mw^2*r^2 + mw^2*r^4)])},
    {{-(((-l^2)*mw^2 + mw^2*r^2 + Sqrt[mw^2*(4*a^2*ml^2 + l^4*mw^2 -
                       2*l^2*mw^2*r^2 + mw^2*r^4)])/(2*a*ml*mw)), 1},
      {-(((-l^2)*mw^2 + mw^2*r^2 - Sqrt[mw^2*(4*a^2*ml^2 + l^4*mw^2 -
                       2*l^2*mw^2*r^2 + mw^2*r^4)])/(2*a*ml*mw)), 1}}}

In[32]:= v2 =
  vecs /. Thread[{l, r, ml, mw, a} -> RandomReal[{-10, 10}, 5]]
Out[32]= {{-17.1707, 1}, {0.0582389, 1}}

In[33]:= v2[[1]].v2[[2]]
Out[33]= 1.02141*10^-14

You might want to orthogonalize mat itself. The form below seems not too 
bad. Maybe FullSimplify would improve it (I did not have the patience to 
wait out its undoubtably subtle ruminations).

In[25]:= Simplify[ComplexExpand[Orthogonalize[mat]],
  Element[{l, r, ml, mw, a}, Reals]]

Out[25]= {{(ml^2 + L^2*mw^2)/
    Sqrt[Abs[a*ml*mw]^2 + Abs[ml^2 + L^2*mw^2]^2],
      (a*ml*mw)/Sqrt[Abs[a*ml*mw]^2 + Abs[ml^2 + L^2*mw^2]^2]},
    {-((a*ml*mw*((ml^2 + L^2*mw^2)*(2*ml^2 + mw^2*(L^2 + r^2)) -
                 Abs[a*ml*mw]^2 - Abs[ml^2 + L^2*mw^2]^2))/
           ((Abs[a*ml*mw]^2 + Abs[ml^2 + L^2*mw^2]^2)*

        Sqrt[Abs[
            ml^2 + mw^2*
              r^2 - (a^2*ml^2*mw^2*(2*ml^2 + mw^2*(L^2 + r^2)))/
                          (Abs[a*ml*mw]^2 +
                Abs[ml^2 + L^2*mw^2]^2)]^2 +

          Abs[a*ml*
             mw*(1 - ((ml^2 + L^2*mw^2)*(2*ml^2 + mw^2*(L^2 + r^2)))/
                             (Abs[a*ml*mw]^2 +
                  Abs[ml^2 + L^2*mw^2]^2))]^2])),
      ((-a^2)*ml^2*mw^2*(ml^2 + L^2*mw^2) + (ml^2 + mw^2*r^2)*

       Abs[ml^2 + L^2*mw^2]^2)/((Abs[a*ml*mw]^2 +
        Abs[ml^2 + L^2*mw^2]^2)*

      Sqrt[Abs[
          ml^2 + mw^2*r^2 - (a^2*ml^2*mw^2*(2*ml^2 + mw^2*(L^2 + r^2)))/
                       (Abs[a*ml*mw]^2 + Abs[ml^2 + L^2*mw^2]^2)]^2 +

        Abs[a*ml*
           mw*(1 - ((ml^2 + L^2*mw^2)*(2*ml^2 + mw^2*(L^2 + r^2)))/
                          (Abs[a*ml*mw]^2 +
                Abs[ml^2 + L^2*mw^2]^2))]^2])}}

I will add that diagonalizing and orthogonalizing are two different 
operations. One involves finding a similarity transform (used with its 
inverse, one on each side of the diagonal matrix). The other is more in 
the vein of a QR decomposition, or Gram-Schmidt if you prefer. The 
orthogonal multiplier is only used on one side of the upper triangular 
(if no pivoting was used).

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Re: gives different result compared to 1/Diagonal[Normal@A] when A is sparse
  • Next by Date: Re: gives different result compared to 1/Diagonal[Normal@A] when A is sparse
  • Previous by thread: Orthogonalize[expr]
  • Next by thread: Re: Orthogonalize[expr]