4
$\begingroup$

I a computing the eigenvalues and eigenfunctions of a Laplacian on a unit square. I have written it as follows:

{ℒ, ℬ} = {-Laplacian[u[x, y], {x, y}],DirichletCondition[u[x, y] == 0, True]};
{vals, funs} = DEigensystem[{ℒ, ℬ}, u[x, y], {x, 0, 1}, {y, 0, 1}, 8];
vals

Therefore, I have received the list of first $8$ eigenvalues, that is:

$\qquad \{2\pi^2,\, 5\pi^2,\, 5\pi^2,\, 8\pi^2,\, 10\pi^2,\, 10\pi^2,\, 10\pi^2,\, 10\pi^2 \}$.

Now I want to use Tally to find the multiplicity of a specific eigenvalue (for example, take the eigenvalue $5\pi^2$). I have no idea how to use Tally within the code written above. Please help me. I have read the reference here, but I have no idea how to use it in my case.

Please help me.

$\endgroup$
2

1 Answer 1

3
$\begingroup$

Tally can certainly count the occurrances of eigenvalues in your list called vals. For instance Tally[vals] tells me that there are $2$ instances of $10 \pi^{2}$ and $2$ instance of $5 \pi^{2}$.

enter image description here


Looking at Tally in the documentation I see that the word "multiplicities" means the number of instances of each distinct element in a list.

enter image description here


I notice that your code is producing a different vals in my notebook! Please quit your kernel and re-evaluate!

enter image description here


Also Wolfram mentions this in his documentation.

enter image description here

$\endgroup$
7
  • $\begingroup$ Thanks for your answer. Actually I want to know the multiplicity of a specific eigenvalue $5 \pi^2$. By "Multiplicity" I mean the dimension of eigenspace (number of linearly independent eigenvectors corresponding to the specific eigenvalue). Are the the multiplicity of an eigenvalue and "Tally" same things? $\endgroup$
    – user81126
    Commented Feb 14, 2021 at 6:35
  • $\begingroup$ sorry, I'm in a zoom meeting now. I'll get back to you in 2 hours. (maybe have a look at Thread[{funs, vals}]) $\endgroup$ Commented Feb 14, 2021 at 6:42
  • $\begingroup$ Upon reading different sources on google I'm $90$% certain that the "multiplicity" of $5\pi^{2}$ is $2$. $\endgroup$ Commented Feb 14, 2021 at 9:12
  • $\begingroup$ Thanks for your advise, but I have some confusions that whether the "multiplicity" in the mathematica documentation same as the "multiplicity" defined in linear algebra (i.e. here by "multiplicity" we mean dimension of eigenspace or number of linearly independent eigenvectors corresponding to the specific eigenvalue or please see the link). Can you please help me? $\endgroup$
    – user81126
    Commented Feb 14, 2021 at 10:09
  • 1
    $\begingroup$ Thanks for your link. But my confusions is still there.Your link gives the idea about number of occurrence of a specific eigenvalue in the eigenvalue list. But, it does not tell about my confusions. My question is as follows: $\textbf{Is the "multiplicity" in the mathematica documentation same as the "multiplicity" defined in linear algebra (i.e. here by "multiplicity" we mean dimension of eigenspace or number of linearly independent eigenvectors corresponding to the specific eigenvalue)?$ $\endgroup$
    – user81126
    Commented Feb 14, 2021 at 11:07

Your Answer

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