TenEig — Tensor Eigenpairs Solver

rteig

Tensor real generalized eigenvalues and eigenvectors for m=m'

Syntax

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

Description

example

lambda = rteig(A,B) returns a vector containing the real 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 also 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, V] = rteig(___) 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] = rteig(___) 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(1,1,1) = 1; B(1,2,1) = 0; B(2,1,1) = 0; B(2,2,1) = 0;
B(1,1,2) = 0; B(1,2,2) = 0; B(2,1,2) = 0; B(2,2,2) = 1;
[lambda,V] = rteig(A,B)
    

lambda =
    
  -107.8499    0.6616    2.9535
    
    
V =
    
    1.0000   -0.1450   -0.1197
    0.7368    0.1777   -0.3377
   -0.6761    1.0000    1.0000

Residue and reciprocal of the condition number of eigenpairs

Given the same inputs like the previous example, calculate the eigenvalues, lambda, the eigenvectors, V, the residule, res and the reciprocal of the condition number, cnd.

[lambda, V, res, cnd] = rteig(A,B)
lambda =

  -107.8499    0.6616    2.9535


V =

    1.0000   -0.1450   -0.1197
    0.7368    0.1777   -0.3377
   -0.6761    1.0000    1.0000


res =

    1.0e-13 *

    0.3975    0.0022    0.0096


cnd =

    0.0007    0.0559    0.0195

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

Output Arguments

expand all

lambda — Eigenvaluesrow vector

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

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