7
$\begingroup$

Bug introduced in 8.0 or earlier and fixed in 10.3.0


Why can't Mathematica find the eigenvectors of this matrix?

Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}]

Eigenvectors::eivec0: Unable to find all eigenvectors. >>
{{0, 0}, {0, 0}}

If I get rid of the (0. +) in the cosine, it works fine.

$\endgroup$
  • $\begingroup$ What version of MMA are you currently using? $\endgroup$ – MarcoB Jul 20 '15 at 3:00
  • $\begingroup$ Version 10.0.2.0, running on Mac OS X x86 $\endgroup$ – tparker Jul 20 '15 at 3:29
  • $\begingroup$ V10.1 has this problem, too. Running on OS X 10.10.2. Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}} // Simplify] works $\endgroup$ – m_goldberg Jul 20 '15 at 3:51
  • 1
    $\begingroup$ Yeah, the Simplify inside the Eigenvectors just gets rid of the (0. +) in the Cos, which as I mentioned in the OP fixes the problem. But obviously not always practical to Simplify if the expression's hugely complicated. Looks like a Mathematica bug, I'll report it. $\endgroup$ – tparker Jul 20 '15 at 4:34
  • 1
    $\begingroup$ Try a ZeroTest -> PossibleZeroQ for a workaround. $\endgroup$ – ilian Jul 20 '15 at 4:43
3
$\begingroup$

[This is what Wolfram tech support told me when I filed a bug report:]

That is because using machine precision (inexact) numbers such 0. (as opposed to exact numbers like 0) forces Eigenvectors[] to seach for eigenvectors numerically and hence the error message. For example, please evaluate and compare the results of the following expression used with machine precision and exact numbers:

Eigenvectors[{{Cos[1. x], Exp[I x]}, {1, 0}}]

Eigenvectors[{{Cos[1 x], Exp[I x]}, {1, 0}}]
$\endgroup$
  • 4
    $\begingroup$ No comment on this answer. I have filed a bug report. $\endgroup$ – ilian Jul 22 '15 at 2:52
3
$\begingroup$

This bug has been fixed as of Mathematica 10.3.

$Version

(* "10.3.0 for Mac OS X x86 (64-bit) (October 9, 2015)" *)

Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}]

(* {{-0.5 (-Cos[0. + x] + Sqrt[4 E^(I x) + Cos[0. + x]^2]), 1.}, 
    {-0.5 (-Cos[0. + x] - Sqrt[4 E^(I x) + Cos[0. + x]^2]), 1.}} *)
$\endgroup$
2
$\begingroup$
Simplify@Eigenvectors[{{Cos[0. + x], Exp[I x]}, {1, 0}}]

$\left( \begin{array}{cc} e^{-1. i x} \left(-0.25 \sqrt{1.+2. e^{2 i x}+16. e^{3 i x}+e^{4 i x}}+0.25 e^{2. i x}+0.25\right) & 1. \\ 0.25 e^{-1. i x} \left(\sqrt{1.+2. e^{2 i x}+16. e^{3 i x}+e^{4 i x}}+e^{2. i x}+1.\right) & 1. \end{array} \right)$

$\endgroup$
  • $\begingroup$ David, I get the same result as the OP with your expression. The Simplify does nothing at all for me, as Eigenvectors returns an error. I am on MMA v. 10.2; what version are you on? I wonder if this is some recently introduce bug with the numerical methods to calculate eigenvectors. $\endgroup$ – MarcoB Jul 20 '15 at 2:59
  • $\begingroup$ I'm on my home machine, v. 7.0. $\left( \begin{array}{cc} \frac{1}{4} e^{-i x} \left(-\sqrt{1+2 e^{2 i x}+16 e^{3 i x}+e^{4 i x}}+e^{2 i x}+1\right) & 1 \\ \frac{1}{4} e^{-i x} \left(\sqrt{1+2 e^{2 i x}+16 e^{3 i x}+e^{4 i x}}+e^{2 i x}+1\right) & 1 \end{array} \right)$ $\endgroup$ – David G. Stork Jul 20 '15 at 3:01
  • $\begingroup$ I'm surprised that you get the exact $1/4$ values in the result if you used a finite-precision 0. in the argument of Cos. $\endgroup$ – MarcoB Jul 20 '15 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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