-1

I am a newbie when it comes to using python libraries for numerical tasks. I was reading a paper on LexRank and wanted to know how to compute eigenvectors of a transition matrix. I used the eigval function and got a result that I have a hard time interpreting:

a = numpy.zeros(shape=(4,4))

a[0,0]=0.333
a[0,1]=0.333
a[0,2]=0
a[0,3]=0.333

a[1,0]=0.25
a[1,1]=0.25
a[1,2]=0.25
a[1,3]=0.25

a[2,0]=0.5
a[2,1]=0.0
a[2,2]=0.0
a[2,3]=0.5

a[3,0]=0.0
a[3,1]=0.333
a[3,2]=0.333
a[3,3]=0.333

print LA.eigval(a)

and the eigenvalue is:

[ 0.99943032+0.j         
-0.13278637+0.24189178j  
-0.13278637-0.24189178j  
  0.18214242+0.j        ]

Can anyone please explain what j is doing here? Isn't the eigenvalue supposed to be a scalar quantity? How can I interpret this result broadly?

ali_m
  • 67,619
  • 20
  • 215
  • 288
Vikram Murthy
  • 173
  • 4
  • 16

2 Answers2

2

j is the imaginary number, the square root of minus one. In math it is often denoted by i, in engineering, and in Python, it is denoted by j.

Community
  • 1
  • 1
unutbu
  • 777,569
  • 165
  • 1,697
  • 1,613
1

A single eigenvalue is a scalar quantity, but an (m, m) matrix will have m eigenvalues (and m eigenvectors). The Wiki page on eigenvalues and eigenvectors has some examples that might help you to get your head around the concepts.

As @unutbu mentions, j denotes the imaginary number in Python. In general, a matrix may have complex eigenvalues (i.e. with real and imaginary components) even if it contains only real values (see here, for example). Symmetric real-valued matrices are an exception, in that they are guaranteed to have only real eigenvalues.

Community
  • 1
  • 1
ali_m
  • 67,619
  • 20
  • 215
  • 288