| act_eigfun.spectral {qwalkr} | R Documentation |
Apply a Function to a Hermitian Matrix
Description
Apply a function to a Hermitian matrix based on the representation
given by class spectral.
Usage
## S3 method for class 'spectral'
act_eigfun(object, FUN, ...)
Arguments
object |
an instance of class |
FUN |
the function to be applied to the matrix. |
... |
further arguments passed on to |
Value
The matrix resulting from the application of FUN.
A Hermitian Matrix admits the spectral decomposition
H = \sum_k \lambda_k E_k
where \lambda_k are its eigenvalues and E_k the
orthogonal projector onto the \lambda_k-eigenspace.
If f=FUN is defined on the eigenvalues of H, then
act_eigfun performs the following calculation
f(H) = \sum_k f(\lambda_k) E_k
See Also
Examples
H <- matrix(c(0,1,1,1,0,1,1,1,0), nrow=3)
decomp <- spectral(H)
# Calculates H^2.
act_eigfun(decomp, FUN = function(x) x^2)
# Calculates sin(H).
act_eigfun(decomp, FUN = function(x) sin(x))
# Calculates H^3.
act_eigfun(decomp, FUN = function(x, y) x^y, 3)
[Package qwalkr version 0.1.0 Index]