I have a 3 by 3 symbolic matrix M(x,y,z).


First, I want to find its eigenvalues and eigenvectors. After that I want to make each eigenvalue and eigenvector a function of x,y, and z i.e.

(*long expression to calcualte M[kx_,ky_,kz_]*)
{vals, vecs} = Eigensystem[M[x, y, z]];
(*I want to get expression like
v1[x_,y_,z_]:=first_eigenvector; same for remaining*)

I tried e1[x_,y_,z_]:=vals[[1]], it does not work.


at some point, I want to take ConjugateTranspose[] of v1 (or v2, v3). Assuming that like MATLAB, Mathematica also give eigenvector in the column, I defined v1 as vecs2 = Transpose[vecs]; v1=[[1]]; Now, when I try ConjugateTranpose[v1]; it gives an erorr that The first two levels ... can't be transposed

  • 4
    $\begingroup$ e1 = Function[{x, y, z}, Evaluate[vals]]; v1 = Function[{x, y, z}, Evaluate[vecs]]; You can then use them like functions for example e1[a,b,c] or v1[1,2,3] will substitute the x,y,z values for the arguments. $\endgroup$
    – flinty
    Oct 29, 2020 at 20:22
  • 3
    $\begingroup$ e1[x_, y_, z_] = vals[[1]] and v1[x_,y_,z_] = vecs[[1]] works. I suggest you learn about immediate and delayed assignments and how they differ. $\endgroup$
    – Roman
    Oct 29, 2020 at 21:14


Your Answer

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

Browse other questions tagged or ask your own question.