TenEig — Tensor Eigenpairs Solver

teneig

Tensor mode-k generalized eigenvalues and eigenvectors for m≠m'

Syntax

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

Description

example

lambda = teneig(A,B) returns a vector containing the generalized eigenvalues of the pair, (A,B), that satisfy the equation Av m-1 = λBv m'-1, where A is an n-dimensional tensor of order m, B 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 B-eigenvalues. The corresponding values of v are the B-eigenvectors.

example

lambda = teneig(A,B, k) specifies the eigenvalues of interest are mode-k B eigenvalues.

example

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

example

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

Examples

expand all

Generalized Eigenvalues and Eigenvectors

Create two tensors, A and B, then solve the generalized eigenvalue problem for the eigenvalues and eigenvectors of the pair (A,B).

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;
B = eye(2);
[lambda,V] = teneig(A,B)
lambda =

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


V =

   1.0000 + 0.0000i  -0.5252 + 0.0000i   1.0000 + 0.0000i   1.0000 + 0.0000i  -0.5252 + 0.0000i   1.0000 + 0.0000i
   1.0000 - 0.0000i   1.0000 + 0.0000i  -0.2626 - 0.0000i  -0.2626 - 0.0000i   1.0000 + 0.0000i   1.0000 - 0.0000i

Generalized mode k-Eigenvalues and mode k-Eigenvectors

Create two tensors, A and B, then solve the generalized mode k-eigenvalue problem for the mode 3-eigenvalues and mode 3-eigenvectors of the pair (A,B).

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;
B = eye(2);
[lambda,V] = teneig(A,B,3)
lambda =

  -9.4025 + 0.0000i  -4.3007 + 0.0000i  -0.2936 - 0.0000i   0.2936 + 0.0000i   4.3007 + 0.0000i   9.4025 - 0.0000i


V =

   0.6950 - 0.0000i  -0.4323 + 0.0000i   1.0000 + 0.0000i   1.0000 + 0.0000i   1.0000 + 0.0000i   0.6950 - 0.0000i
   1.0000 + 0.0000i   1.0000 + 0.0000i  -0.3756 - 0.0000i  -0.3756 - 0.0000i  -2.3133 + 0.0000i   1.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 eigenvalues, lambda, the eigenvectors, V, the residule, res and the reciprocal of the condition number, cnd.

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

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


V =

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


res =

   1.0e-15 *

    0.0362    0.0997    0.1115    0.0007    0.6281    0.1140


cnd =

   1.0e-10 *

    0.2067    0.9141    0.2067    0.0145    0.1698    0.1655

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

B — Generalized eigenvalue problem input tensor n-dimensional tensor of order m'

Generalized eigenvalue problem input tensor, specified as a real or complex tensor.

Data Types: double | single
Complex Number Support: Yes

k — mode-k eigenvalue probelm input k constant

Specified the mode-k eigenvalue problem

Data Types: integer

Output Arguments

expand all

lambda — Eigenvaluesrow vector

Eigenvalues, returned as a row vector containing the eigenvalues (or generalized eigenvalues of a pair).

V — Eigenvectors or mode-k B eigenvectorsmatrix

Eigenvectors, returned as a square matrix whose columns are the eigenvectors of A or generalized mode-k eigenvectors of the pair, (A,B). The form of V is given by normalizing the vector so that the largest magnitude of the elments in the vector is 1.

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 teneig function returns all eigenvalues of a tensor for the syntax, lambda = teneig(A). Use the heig function if only the real eigenvalues are interested.