Re: Possible bug in Eigenvalues[ ] ???

• To: mathgroup at smc.vnet.net
• Subject: [mg100538] Re: [mg100469] Possible bug in Eigenvalues[ ] ???
• From: "David Park" <djmpark at comcast.net>
• Date: Sun, 7 Jun 2009 05:01:54 -0400 (EDT)
• References: <20545116.1244187701779.JavaMail.root@n11>

```Lorenzo,

This comes about because of the non-standard evaluation of Table and the
fact that it has the attribute HoldAll. In one case it is obtaining a
symbolic expression for the eigenvalues and then substituting into that, and
in the other case it is solving the Eigenvalues problem each time.

In both cases your solutions are undergoing a switch somewhere in the lambda
domain, which corresponds to crossing a branch line.

The Presentations package at my web site (\$50) has a multifunctions
capability that will provide continuous solutions for each of the branches
of the solutions. For your example this takes the following form:

Needs["Presentations`Master`"]

eigenvalues = Eigenvalues[mat + \[Lambda] pert]

{(-(1/6) + I/6) ((5 + 5 I) + 3 \[Lambda] - Sqrt[
514 I - (93 + 93 I) \[Lambda] + (18 - 9 I) \[Lambda]^2]), (-(1/
6) + I/6) ((5 + 5 I) + 3 \[Lambda] + Sqrt[
514 I - (93 + 93 I) \[Lambda] + (18 - 9 I) \[Lambda]^2])}

Then we use the Multivalues routine to initialize the evaluation and the
CalculateMultivalues routine to calculate successive values. This does not
work properly with Table, but works if we map the table functions onto the
list of data points. Here we show the value of lambda, the two complex
values, and the order of the two values in terms of the two functions above.
I used wider steps just to shorten the posted output. You will notice that
the order of the solutions switched between lambda = 3.5 and lambda = 4.0
and the two sets of solutions give continuous paths.

eigendata = Multivalues[Null, eigenvalues, \[Lambda]];
{#, CalculateMultivalues[eigendata][#]} & /@ Range[0, 10, .5]

{{0.,  {{3.67707 + 0. I, -7.01041 + 0. I}, {1, 2}}},
{0.5, {{3.17252 + 0.479244 I, -7.00585 + 0.0207556 I}, {1, 2}}},
{1.,  {{2.63718 + 0.93368 I, -6.97052 + 0.06632 I}, {1, 2}}},
{1.5, {{2.0619 + 1.36404 I, -6.89524 + 0.135965 I}, {1, 2}}},
{2.,  {{1.43436 + 1.77216 I, -6.7677 + 0.227837 I}, {1,  2}}},
{2.5, {{0.736607 + 2.16242 I, -6.56994 + 0.337576 I}, {1, 2}}},
{3.,  {{-0.0602051 + 2.54621 I, -6.27313 + 0.453794 I}, {1, 2}}},
{3.5, {{-1.00604 + 2.95992 I, -5.82729 + 0.54008 I}, {1, 2}}},
{4.,  {{-2.15722 + 3.54582 I, -5.17612 + 0.454183 I}, {2, 1}}},
{4.5, {{-3.2619 + 4.54089 I, -4.57143 - 0.0408875 I}, {2, 1}}},
{5.,  {{-4.03354 + 5.62978 I, -4.2998 - 0.629777 I}, {2, 1}}},
{5.5, {{-4.65302 + 6.6284 I, -4.18031 - 1.1284 I}, {2, 1}}},
{6.,  {{-5.21554 + 7.55475 I, -4.11779 - 1.55475 I}, {2, 1}}},
{6.5, {{-5.75291 + 8.4319 I, -4.08042 - 1.9319 I}, {2, 1}}},
{7.,  {{-6.27786 + 9.27459 I, -4.05548 - 2.27459 I}, {2, 1}}},
{7.5, {{-6.79632 + 10.0922 I, -4.03701 - 2.59215 I}, {2, 1}}},
{8.,  {{-7.31138 + 10.8908 I, -4.02196 - 2.89078 I}, {2, 1}}},
{8.5, {{-7.8247 + 11.6747 I, -4.00863 - 3.17474 I}, {2, 1}}},
{9.,  {{-8.33728 + 12.4471 I, -3.99606 - 3.44707 I}, {2, 1}}},
{9.5, {{-8.84967 + 13.21 I, -3.98366 - 3.71004 I}, {2, 1}}},
{10., {{-9.36223 + 13.9653 I, -3.9711 - 3.96533 I}, {2, 1}}}}

The routines work by remembering the last set of multivalues and using a
linear programming assignment problem to reassign the multivalues at each
step.

This has many uses, and one of the most interesting is to drag a locator
around a Riemann surface. We can attach an arrow to the locator to represent
the value of the complex multifunction, and also display the numerical
value. Although we don't directly 'see' the Riemann surface itself, we do
see that the function is single valued and continuous as we move the locator
around, and as we circle around various branch points we recover all of the
values. There are no discontinuous branch line artifacts - just as Riemann
promised.

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/

From: Lorents [mailto:lorents at amp.te]

Hello,
I'm using Mathematica v.6.0.1.0 under Windows.
I was using the Eigenvalues function to find the eigenvalues of some
complex matrices when I found a very strange behaviour.
Cutting the problem down to the bone, consider the 2x2 matrices
mat = {{11/3, -(1/3)}, {-(1/3), -7}}
pert={{-1 + \[ImaginaryI], 1/2 + \[ImaginaryI]/2}, {-1, 0}}

I'm interested in the trajectories on the complex plane of the
eigenvalues of A(lambda)= mat + lambda*pert as a function of the
"strength" lambda. I calculated these trajectories in two ways and I get
different results (one of which is the correct one).

--> 1st way
expr = Eigenvalues[mat + \[Lambda]  pert];
traj1 = Table[expr, {\[Lambda], 0, 10, 0.1}];

--> 2nd way
traj2 = Table[Eigenvalues[mat + \[Lambda]  pert], {\[Lambda], 0, 10, 0.1}];

The resulting lists traj1 and traj2 are NOT the same!
A small notebook showing this problem can be found here:
http://www.homepages.ucl.ac.uk/~ucapllo/test.eig.nb

Any thoughts? Is this behaviour normal?

Lorenzo

```

• Prev by Date: Re: MergeSort with replacerepeated - a follow-up
• Next by Date: Re: Why is recursion so slow in Mathematica?
• Previous by thread: Possible bug in Eigenvalues[ ] ???
• Next by thread: 1GB Kernel Memory Limit