TenEig — Tensor Eigenpairs Solver

heig

Tensor Real H-Eigenvalues and H-Eigenvectors

Syntax

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

Description

example

lambda = heig(A) returns a row vector containing the H-Eigenvalues, that satisfy the equation Av m-1 = λ v[m-1], where A is an n-dimensional real 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 H-Eigenvalues. The corresponding values of v that satisfy the equation are the H-Eigenvectors.

example

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

example

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

example

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

example

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

Examples

expand all

H-Eigenvalues of a real 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 H-Eigenvalues of A. The result is a row vector.

lambda = heig(A)
lambda =

   -0.4750   14.0000

H-Eigenvalues and H-Eigenvectors of a symmetric real 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 real tensor A is nonsymmetric. Convert it to a symmetric tensor and calculate the H-Eigenvalues and H-Eigenvectors.

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

   -2.6841   -0.6665   -0.0887    0.2499    0.2528    0.4108    0.7228    0.8944    0.9780    1.9316    2.3129


V =

   -0.8983    0.2296    1.0000    0.4213    1.0000   -0.2073    1.0000    0.6193   -0.1546    1.0000   -0.9677
    1.0000   -0.2584    0.8054    1.0000    0.1020    0.5241    0.5792    0.9542    1.0000   -0.7471   -0.7966
    0.5814    1.0000    0.1703    0.2203   -0.0868    1.0000    0.9396    1.0000   -0.6742    0.7928    1.0000

H-Eigenvalues and H-Eigenvectors of a symmetric real 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 H-Eigenvalues, lambda and the H-Eigenvectors, V.

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

    1.0000    3.0000    3.8028    3.8028


V =

         0    1.0000    1.0000    1.0000
    1.0000         0    0.7316   -0.7316

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 H-Eigenvalues, lambda, the H-Eigenvectors, V, the residule, res and the reciprocal of the condition number, cnd.

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

    1.0000    1.0000    1.0000    3.0000    3.0000    3.0000


V =

   -0.0000   -0.0000    0.0000    1.0000    1.0000    1.0000
    1.0000    1.0000    1.0000   -0.0000    0.0000    0.0000


res =

   1.0e-15 *

    0.0362    0.0997    0.1115    0.4015    0.6281    0.1140


cnd =

   1.0e-09 *

    0.0207    0.0914    0.0207    0.1886    0.0170    0.0166

Input Arguments

expand all

A — Input real tensor n-dimensional real tensor of order m

Input real tensor, specified as a real tensor.

Data Types: double | single
Complex Number Support: No

P — H-Eigenvalue problem input polynomial cell

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

Data Types: cell of one string

Output Arguments

expand all

lambda — H-Eigenvaluesrow vector

H-Eigenvalues, returned as a row vector containing the H-Eigenvalues.

V — H-Eigenvectors matrix

H-Eigenvectors, returned as a square matrix whose columns are the H-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 heig function returns all H-Eigenvalues of a real tensor for the syntax, lambda = heig(A). Use the teig function if all Eigenvalues including complex are interested.