A = Matrix.New({{1,1,3}, {5,3,7}, {3,5,1}}) val, funL, funR = Eigensystem(A) print("The eigenvalues are\n",val) print("The left eigenfunctions are\n",funL) print("The right eigenfunctions are\n",funR) print("The matrix transformed to a diagonal matrix by its eigenfunctions is\n",Chop( Matrix.Conjugate(funL) * A * Matrix.Transpose(funR)) )