TenEig — Tensor Eigenpairs Solver

eeig

Tensor E-eigenvalues and E-eigenvectors

Syntax

  • [lambda,V] = eeig(___) example
  • [lambda,V,res,cnd] = eeig(___) example

Description

example

lambda = eeig(A) returns a row vector containing the E-eigenvalues, that satisfy the equation Av m-1 = λ v, where A is an n-dimensional tensor of order m, v is a row vector of length n, and λ is a scalar. The values of λ that satisfy the equation are the E-eigenvalues. The corresponding values of v that satisfy the equation are the E-eigenvectors.

example

lambda = eeig(A,'symmetric') specifies that A is a symmetric tensor. If it is not, convert it to a symmetric tensor.

example

lambda = eeig(P) specifies that a tensor A implicitly given by P = Av m.

example

[lambda, V] = eeig(___) returns two optional outputs for any of the previous input syntaxes. lambda row vector containing the E-eigenvalues. V is a matrix whose columns are the corresponding E-eigenvectors.

example

[lambda, V,res, cnd] = eeig(___) also returns two row vectors containing the residue and reciprocal of the condition number of each eigenpair.

Examples

expand all

E-eigenvalues of a tensor

A(1,1,1) = 1; A(1,2,1) = 2; A(2,1,1) = 3; A(2,2,1) = 4;
A(1,1,2) = 5; A(1,2,2) = 6; A(2,1,2) = 7; A(2,2,2) = 0
A(:,:,1) =

     1     2
     3     4


A(:,:,2) =

     5     6
     7     0

Calculate the E-eigenvalues of A. The result is a row vector.

lambda = eeig(A)
lambda =

  Columns 1 through 4

  -9.8995 - 0.0000i  -4.3820 + 0.0000i  -0.4105 + 0.0000i   0.4105 + 0.0000i

  Columns 5 through 6

   4.3820 - 0.0000i   9.8995 + 0.0000i

E-eigenvalues and E-eigenvectors of a symmetric tensor

A = zeros(3,3,3,3);
A(1,1,1,1) =  0.2883; A(1,1,1,2) = -0.0031; A(1,1,1,3) =  0.1973;
A(1,1,2,2) = -0.2485; A(1,1,2,3) = -0.2939; A(1,1,3,3) =  0.3847;
A(1,2,2,2) =  0.2972; A(1,2,2,3) =  0.1862; A(1,2,3,3) =  0.0919;
A(1,3,3,3) = -0.3619; A(2,2,2,2) =  0.1241; A(2,2,2,3) = -0.3420;
A(2,2,3,3) =  0.2127; A(2,3,3,3) =  0.2727; A(3,3,3,3) = -0.3054;

Note that the above tensor A is nonsymmetric. Convert it to a symmetric tensor and calculate the E-eigenvalues and E-eigenvectors.

[lambda,V] = eeig(A,'symmetric')
lambda =

  Columns 1 through 6

  -1.0954 + 0.0000i  -1.0954 - 0.0000i  -0.5629 + 0.0000i  -0.5629 + 0.0000i  -0.0451 - 0.0000i  -0.0451 + 0.0000i

  Columns 7 through 12

   0.1735 + 0.0000i   0.1735 + 0.0000i   0.2433 - 0.0000i   0.2433 + 0.0000i   0.2628 + 0.0000i   0.2628 - 0.0000i

  Columns 13 through 18

   0.2682 - 0.0000i   0.2682 - 0.0000i   0.3633 - 0.0000i   0.3633 + 0.0000i   0.5105 + 0.0000i   0.5105 - 0.0000i

  Columns 19 through 24

   0.6764 - 0.0014i   0.6764 + 0.0014i   0.6764 - 0.0014i   0.6764 + 0.0014i   0.8169 - 0.0000i   0.8169 + 0.0000i

  Columns 25 through 26

   0.8893 + 0.0000i   0.8893 - 0.0000i


V =

  Columns 1 through 6

  -0.5915 + 0.0000i   0.5915 + 0.0000i  -0.1762 + 0.0000i   0.1762 + 0.0000i  -0.7797 - 0.0000i   0.7797 - 0.0000i
   0.7467 - 0.0000i  -0.7467 + 0.0000i   0.1796 - 0.0000i  -0.1796 - 0.0000i  -0.6135 + 0.0000i   0.6135 + 0.0000i
   0.3043 + 0.0000i  -0.3043 + 0.0000i  -0.9678 - 0.0000i   0.9678 - 0.0000i  -0.1250 + 0.0000i   0.1250 - 0.0000i

  Columns 7 through 12

  -0.3357 + 0.0000i   0.3357 - 0.0000i  -0.9895 + 0.0000i   0.9895 + 0.0000i  -0.1318 + 0.0000i   0.1318 + 0.0000i
  -0.9073 - 0.0000i   0.9073 + 0.0000i  -0.0947 - 0.0000i   0.0947 - 0.0000i   0.4425 + 0.0000i  -0.4425 + 0.0000i
  -0.2531 + 0.0000i   0.2531 + 0.0000i   0.1088 + 0.0000i  -0.1088 + 0.0000i   0.8870 - 0.0000i  -0.8870 - 0.0000i

  Columns 13 through 18

  -0.6099 - 0.0000i   0.6099 - 0.0000i  -0.2676 - 0.0000i   0.2676 + 0.0000i  -0.3598 + 0.0000i   0.3598 + 0.0000i
  -0.4362 - 0.0000i   0.4362 + 0.0000i  -0.6447 + 0.0000i   0.6447 + 0.0000i   0.7780 - 0.0000i  -0.7780 - 0.0000i
  -0.6616 + 0.0000i   0.6616 - 0.0000i  -0.7160 - 0.0000i   0.7160 + 0.0000i  -0.5150 + 0.0000i   0.5150 - 0.0000i

  Columns 19 through 24

  -0.2945 + 0.0578i  -0.2945 - 0.0578i   0.2945 - 0.0578i   0.2945 + 0.0578i  -0.8412 + 0.0000i   0.8412 + 0.0000i
  -0.8215 - 0.0358i  -0.8215 + 0.0358i   0.8215 + 0.0358i   0.8215 - 0.0358i   0.2635 + 0.0000i  -0.2635 + 0.0000i
   0.4937 - 0.0252i   0.4937 + 0.0252i  -0.4937 + 0.0252i  -0.4937 - 0.0252i  -0.4722 - 0.0000i   0.4722 - 0.0000i

  Columns 25 through 26

  -0.6672 + 0.0000i   0.6672 - 0.0000i
  -0.2471 + 0.0000i   0.2471 + 0.0000i
   0.7027 + 0.0000i  -0.7027 + 0.0000i

E-eigenvalues and E-eigenvectors of a symmetric tensor implicitly given in a polynomial

Create a cell of string P which equals Av m.

 P = {'3*x1^4+x2^4+3*x1^2*x2^2'};

Calculate the E-eigenvalues, lambda and the E-eigenvectors, V.

[lambda, V] = eeig(P)
lambda =

  Columns 1 through 6

   0.7500 + 0.0000i   0.7500 + 0.0000i   0.7500 - 0.0000i   0.7500 - 0.0000i   1.0000 + 0.0000i   1.0000 + 0.0000i

  Columns 7 through 8

   3.0000 + 0.0000i   3.0000 + 0.0000i


V =

  Columns 1 through 6

  -0.0000 - 0.7071i   0.0000 + 0.7071i   0.0000 - 0.7071i   0.0000 + 0.7071i   0.0000 + 0.0000i   0.0000 + 0.0000i
  -1.2247 + 0.0000i  -1.2247 + 0.0000i   1.2247 + 0.0000i   1.2247 - 0.0000i  -1.0000 + 0.0000i   1.0000 + 0.0000i

  Columns 7 through 8

  -1.0000 + 0.0000i   1.0000 + 0.0000i
   0.0000 + 0.0000i   0.0000 + 0.0000i

Residue and reciprocal of the condition number of eigenpairs

Create a cell of string P which equals Av m.

 P = {'3*x1^4+x2^4'};

Calculate the E-eigenvalues, lambda, the E-eigenvectors, V, the residule, res and the reciprocal of the condition number, cnd.

[lambda, V, res, cnd] = eeig(P)
lambda =

  Columns 1 through 6

   0.7500 + 0.0000i   0.7500 - 0.0000i   0.7500 + 0.0000i   0.7500 + 0.0000i   1.0000 + 0.0000i   1.0000 + 0.0000i

  Columns 7 through 8

   3.0000 + 0.0000i   3.0000 + 0.0000i


V =

  Columns 1 through 6

  -0.5000 + 0.0000i  -0.5000 - 0.0000i   0.5000 - 0.0000i   0.5000 - 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
  -0.8660 + 0.0000i   0.8660 - 0.0000i  -0.8660 - 0.0000i   0.8660 - 0.0000i  -1.0000 + 0.0000i   1.0000 + 0.0000i

  Columns 7 through 8

  -1.0000 + 0.0000i   1.0000 + 0.0000i
   0.0000 + 0.0000i   0.0000 + 0.0000i


res =

   1.0e-16 *

    0.5551    0.5551    0.5551    0.5551         0         0         0         0


cnd =

    0.2159    0.2401    0.2342    0.2342    0.1667    0.1667    0.0357    0.0357

Input Arguments

expand all

A — Input tensor n-dimensional tensor of order m

Input tensor, specified as a real or complex tensor.

Data Types: double | single
Complex Number Support: Yes

P — E-eigenvalue problem input polynomial cell

Specifies the tensor implicitly defined by the polynomial P = Av m.

Data Types: cell of one string

Output Arguments

expand all

lambda — E-eigenvaluesrow vector

E-eigenvalues, returned as a row vector containing the E-eigenvalues.

V — E-eigenvectors matrix

E-eigenvectors, returned as a square matrix whose columns are the E-eigenvectors of A.

res — Residue row vector

Residue, returned as a row vector containing the residue of each eigenpair.

cnd — reciprocal of the condition numberrow vector

reciprocal of the condition number, returned as a row vector containing the reciprocal of the condition number of each eigenpair.

More About

expand all

Tips

  • The eeig function returns all E-eigenvalues of a tensor for the syntax, lambda = eeig(A). Use the zeig function if only the real E-eigenvalues are interested.