3
$\begingroup$

Basically I have a matrix and when I used either Eigenvalue or Eigensystem, it doesn't output nonreal eigenvalues, instead it leaves it in the form of $$\sqrt{-1}^{1/3}$$ or something in terms of $\sqrt{-1}$

The matrix I have is

F = {{-1/4, 1/4 + 1/Sqrt[2], -1/2 + 1/(2  Sqrt[2])},
     {1/4 - 1/Sqrt[2], -1/4, -1/2 - 1/(2 Sqrt[2])},
     {-1/2 - 1/(2 Sqrt[2]), -1/2 + 1/(2 Sqrt[2]), 1/2}}

I am trying to diagonalize this.

EDIT Adding Simplify seems to have solved half of the problem, it displays the eigenvectors in complex numbers, but the eigenvalues still in unsimplified form.

$\endgroup$
6
  • $\begingroup$ Why do you think $\sqrt{-1}$ is not non-real? In any case, use N@Eigenvalues@F. $\endgroup$
    – rm -rf
    Nov 16, 2012 at 7:11
  • $\begingroup$ What does '@' do? $\endgroup$
    – Lemon
    Nov 16, 2012 at 7:14
  • 1
    $\begingroup$ if you type F-Transpose[F] you will find out that your matrix is not symmetric so its eigenvalues need not be real. And indeed they are not. $\endgroup$
    – chris
    Nov 16, 2012 at 7:29
  • 1
    $\begingroup$ @jak N @ Eigenvalues @ F is the same as N[ Eigenvalues[ F ] ] and the same as F // Eigenvalues // N. So these are the three ways of using functions on some arguments. $\endgroup$
    – au700
    Nov 16, 2012 at 7:36
  • 1
    $\begingroup$ Have a look at reference.wolfram.com/mathematica/tutorial/… $\endgroup$ Nov 16, 2012 at 8:33

2 Answers 2

7
$\begingroup$

This might be what you were expecting:

In[]:=
 {{-1/4, 1/4 + 1/Sqrt[2], -1/2 + 1/(2 Sqrt[2])},
  {1/4 - 1/Sqrt[2], -1/4, -1/2 - 1/(2 Sqrt[2])},
  {-1/2 - 1/(2 Sqrt[2]), -1/2 + 1/(2 Sqrt[2]), 1/2}} // Eigenvalues // ExpToTrig

Out[]=  
 {-1/2 + (I Sqrt[3])/2, -1/2 - (I Sqrt[3])/2, 1}

where ExpToTrig[] converts the exponentials like $(-1)^{2/3}$ accordingly.

$\endgroup$
6
$\begingroup$

The appropriate function for symbolic representation of complex functions and numbers is ComplexExpand, e.g.

ComplexExpand @ Table[(-1)^(k/3), {k, 3}]
{1/2 + (I Sqrt[3])/2, -(1/2) + (I Sqrt[3])/2, -1}

For this specific task ExpToTrig yields the expected result, but for more general cases I recommend using ComplexExpand instead of ExpToTrig, for F (defined in the question) it yields the same :

ComplexExpand @ Eigenvalues @ F == ExpToTrig @ Eigenvalues @ F
True

Consider for example this matrix :

m = Array[GCD, {3, 3}];

it yields eigenvalues of m in terms of Root objects, to get the result in terms of radicals one could add this option Cubics->True to Eigenvalues, Eigensystem etc. (this answer would be helpful as well).

Let's compare how ExpToTrig and ComplexExpand deal with Eigenvalues in this case :

ExpToTrig @ Eigenvalues[ m, Cubics -> True] // TraditionalForm

enter image description here

Therefore we can't even be sure that the eigenvalues are real numbers until we don't evaluate e.g. :

# ∈ Reals & /@ Eigenvalues[ m]
{True, True, True}

we can see that ExpToTrig is not really helpful here, unlike ComplexExpand yielding symbolic eigenvalues, manifestly real:

ComplexExpand @ Eigenvalues[ m, Cubics -> True] // TraditionalForm

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.