Skip to contents

Get the eigenbasis associated with an eigenvalue based on the representation of a Hermitian Matrix given by class spectral.

Usage

# S3 method for spectral
get_eigspace(object, id, ...)

Arguments

object

an instance of class spectral.

id

index for the desired eigenspace according to the ordered (decreasing) spectra.

...

further arguments passed to or from other methods.

Value

A matrix whose columns form the orthonormal eigenbasis.

If s <- spectral(A) and V <- s$eigvectors, then the extracted eigenspace \(V_{id}\) is some submatrix V[, _].

Examples

# Spectra is {2, -1} with multiplicities one and two respectively.
decomp <- spectral(matrix(c(0,1,1,1,0,1,1,1,0), nrow=3))

# Returns the two orthonormal eigenvectors corresponding to the eigenvalue -1.
get_eigspace(decomp, id=2)
#>            [,1]       [,2]
#> [1,]  0.8164966  0.0000000
#> [2,] -0.4082483 -0.7071068
#> [3,] -0.4082483  0.7071068

# Returns the eigenvector corresponding to the eigenvalue 2.
get_eigspace(decomp, id=1)
#>           [,1]
#> [1,] 0.5773503
#> [2,] 0.5773503
#> [3,] 0.5773503