# Eigenvalues and Vectors (G Dataflow)

Finds the eigenvalues and right eigenvectors of a square matrix.

##### Programming Patterns

Use the Back Transform Eigenvectors node after balancing a matrix with the Matrix Balance node and computing the eigenvectors of the balanced matrix with the Eigenvalues and Vectors node. Use the outputs of the Matrix Balance node and the Eigenvalues and Vectors node as the inputs of the Back Transform Eigenvectors node.

## matrix type

Type of the input matrix.

Specifying the matrix type allows this node to execute more quickly by avoiding unnecessary computations, which could introduce numerical inaccuracy.

A symmetric matrix or Hermitian matrix needs less computation than a general matrix.

Name Value Description
General 0 A matrix that is not symmetric or Hermitian.
Symmetric or Hermitian 1 A matrix that is symmetric if it is real or Hermitian if it is complex.

Default: General

## matrix A

An n-by-n square matrix, where n is the number of rows and columns of the input matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

## output option

A value specifying whether this node computes eigenvalues and vectors.

Name Value Description
Eigenvalues 0

The node computes only the eigenvalues of the input matrix.

Eigenvalues & Vectors 1

The node computes both the eigenvalues and the eigenvectors of the input matrix.

Default: Eigenvalues & Vectors

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## eigenvalues

A complex vector of n elements that contains all of the computed eigenvalues of the the input matrix. The input matrix could have complex eigenvalues if it is not symmetric or Hermitian.

## eigenvectors

An n-by-n complex matrix containing all of the computed eigenvectors of the input matrix.

The ith column of this output is the eigenvector corresponding to the ith component of eigenvalues. Each eigenvector is normalized so that its Euclidean norm equals 1.

If output option is Eigenvalues, this output is an empty array.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating Eigenvalues and Eigenvectors

The eigenvalue problem is to determine the nontrivial solutions to the equation:

Ax = λx

where

• A is an n-by-n square matrix
• x is a vector with n elements
• λ is a scalar

The n values of λ that satisfy the equation are the eigenvalues of A and the corresponding values of x are the right eigenvectors of n. A real, symmetric matrix always has real eigenvalues and eigenvectors.

This node returns the real eigenvalues in ascending order if the input matrix is a real symmetric matrix or a Hermitian matrix.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported