1
$\begingroup$

I have a matrix $M(\lambda)$ of the form given below with a parameter $\lambda$. I would like to plot the quantity $$\langle\phi_{i}|Q|\phi_{i}\rangle$$ for every Eigenvectors corresponding to ascending order in Eigenvalues of this matrix with respect $\lambda$.Here $|\phi_{i}\rangle$ are the eigen vector of the matrix $M$.

I am having a bit of trouble to sort the eigenvectors and plot it w.r.t $\lambda$.

Could somebody help me to get that.

M=[{0.5, 0., 0., 0. + [\lambda], 0.000141421, 0., 0., 0.},{0., -0.5, 0. + \[Lambda], 0., 0., 0.000141421, 0., 0.},
   {0., 0. + \[Lambda], 1.5, 0., 0., 0. + Sqrt[2] \[Lambda], 0.000244949, 0.}, 
  {0. + \[Lambda], 0., 0., 0.5, 0. + Sqrt[2] \[Lambda], 0., 0., 0.000244949},
 {0.000141421, 0., 0., 0. + Sqrt[2] \[Lambda], 2.5, 0., 0., 0. + Sqrt[3] \[Lambda]},
 {0., 0.000141421, 0. + Sqrt[2] \[Lambda], 0., 0., 1.5,0. + Sqrt[3] \[Lambda], 0.},
 {0., 0., 0.000244949, 0., 0., 0. + Sqrt[3] \[Lambda], 3.5, 0.},
  {0., 0., 0., 0.000244949, 0. + Sqrt[3] \[Lambda], 0., 0., 2.5}]

The Q Matrix is

Q={{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0},
   {0,0,0,1,0,0,0,0},{0,0,0,0,2,0,0,0},{0,0,0,0,0,2,0,0},
   {0,0,0,0,0,0,3,0},{0,0,0,0,0,0,0,3}}
$\endgroup$
10
  • 1
    $\begingroup$ What do you mean by "the norm of the eigenvector"? Eigenvectors are non-unique and are usually normalized to have unit norm for that reason. This is what Eigenvectors and Eigensystem do for numeric matrices. For matrices involving symbols (like yours), these functions just pick representations that have convenient symbolic forms, which is why they're not usually normalized in that case. $\endgroup$ Jul 17, 2020 at 10:30
  • $\begingroup$ You could start by Plot[Eigenvalues[M[\[Lambda]]] // Evaluate, {\[Lambda], 0, 25}] $\endgroup$
    – chris
    Jul 17, 2020 at 10:30
  • $\begingroup$ @Chris: I would like to plot norm of the eigenvector not the eigenvalues itself. The eigenvector has to be taken in the ascending order in its eigenvalues. $\endgroup$
    – AVM
    Jul 17, 2020 at 10:32
  • $\begingroup$ @AVM The norm of an eigenvector is a meaningless concept unless you give more detail about constraints on the eigenvectors. If x is an eigenvector of M, then so is s*x for any scalar s. You can create eigenvectors of any norm you want. $\endgroup$ Jul 17, 2020 at 10:37
  • $\begingroup$ @Sjorerd: Thanks for your reply. Here I have done a mistake in writing the question. One operator I have to introduced. $\endgroup$
    – AVM
    Jul 17, 2020 at 10:38

1 Answer 1

1
$\begingroup$

Fixing the problem a bit:

M[λ_] = {{0.5, 0, 0, λ, 0.000141421, 0, 0, 0},
         {0, -0.5, λ, 0, 0, 0.000141421, 0, 0},
         {0, λ, 1.5, 0, 0, Sqrt[2] λ, 0.000244949, 0},
         {λ, 0, 0, 0.5, Sqrt[2] λ, 0, 0, 0.000244949},
         {0.000141421, 0, 0, Sqrt[2] λ, 2.5, 0, 0, Sqrt[3] λ},
         {0, 0.000141421, Sqrt[2] λ, 0, 0, 1.5, Sqrt[3] λ, 0},
         {0, 0, 0.000244949, 0, 0, Sqrt[3] λ, 3.5, 0},
         {0, 0, 0, 0.000244949, Sqrt[3] λ, 0, 0, 2.5}};

Q = {{0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0, 0},
     {0, 0, 1, 0, 0, 0, 0, 0},
     {0, 0, 0, 1, 0, 0, 0, 0},
     {0, 0, 0, 0, 2, 0, 0, 0},
     {0, 0, 0, 0, 0, 2, 0, 0},
     {0, 0, 0, 0, 0, 0, 3, 0},
     {0, 0, 0, 0, 0, 0, 0, 3}};

For a given value of $\lambda$ you can compute the eigenvalues and eigenvectors, and sort them, with

es[λ_?NumericQ] := Sort[Transpose[Eigensystem[M[N[λ]]]]]

and plot your expectation values with

Plot[#[[2]].Q.#[[2]] & /@ es[λ], {λ, 0, 1}]

enter image description here

Update

If you only need the three lowest eigenvalues, use es[λ][[;;3]]:

Plot[#[[2]].Q.#[[2]] & /@ es[λ][[;; 3]], {λ, 0, 1}]

enter image description here

For improved speed (large matrices) you can try to restrict the calculation to the three lowest eigenvalues, instead of calculating all eigenvalues and extracting the three lowest ones.

$\endgroup$
11
  • $\begingroup$ Thanks a lot. This plotting I was expecting. I would like to know about Plot[#[[2]]. Is it for the 2nd Eigenvector? $\endgroup$
    – AVM
    Jul 17, 2020 at 12:10
  • $\begingroup$ Pl tell me what does the symbol N signify in [M[N[λ]]]]] ? $\endgroup$
    – AVM
    Jul 17, 2020 at 12:23
  • $\begingroup$ Please have a look at the official documentations of Slot, Part, and N. $\endgroup$
    – Roman
    Jul 17, 2020 at 12:33
  • $\begingroup$ Thanks for your information. If I would like to plot first three eigenvector corresponding to three lowest Eigenvalues, What I have to do? $\endgroup$
    – AVM
    Jul 17, 2020 at 12:46
  • $\begingroup$ This is needed because if I increase the dim. of M matrix, the number of graphs also increases. So If I am interested to first few of them e.g. 3, what I should do? What command I have to modify. Pl let me know. $\endgroup$
    – AVM
    Jul 17, 2020 at 12:49

Your Answer

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

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