# 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 or Hermitian. matrix type is Symmetric if the input matrix is real or Hermitian if the input matrix is complex.

If matrix type is Symmetric or Hermitian, the node returns the real eigenvalues in ascending order.

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 and Vectors 1

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

Default: Eigenvalues and Vectors

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## eigenvalues

A complex vector of n elements that contains all of the computed eigenvalues of 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.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## 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.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application