H.coeff {pdSpecEst} | R Documentation |
Orthonormal basis expansion of a Hermitian matrix
Description
H.coeff
expands a -dimensional Hermitian matrix
H
with respect to
an orthonormal (in terms of the Frobenius inner product) basis of the space of Hermitian matrices.
That is, H.coeff
transforms H
into a numeric vector of real-valued basis coefficients,
which is possible as the space of Hermitian matrices is a real vector space. Let
be a
-dimensional zero matrix with a 1 at location
.
The orthonormal basis contains the following matrix elements; let
and
,
- If
n == m
the real matrix element
- If
n < m
the complex matrix element
- If
n > m
the real matrix element
The orthonormal basis coefficients are ordered by scanning through the matrix H
in a row-by-row
fashion.
Usage
H.coeff(H, inverse = FALSE)
Arguments
H |
if |
inverse |
a logical value that determines whether the forward basis transform ( |
Value
If inverse = FALSE
takes as input a -dimensional Hermitian matrix and outputs a numeric
vector of length
containing the real-valued basis coefficients. If
inverse = TRUE
takes as input a
-dimensional numeric vector of basis coefficients and outputs the corresponding
-dimensional
Hermitian matrix.
Examples
## random Hermitian matrix
H <- matrix(complex(real = rnorm(9), imaginary = rnorm(9)), nrow = 3)
diag(H) <- rnorm(3)
H[lower.tri(H)] <- t(Conj(H))[lower.tri(H)]
## orthonormal basis expansion
h <- H.coeff(H)
H1 <- H.coeff(h, inverse = TRUE) ## reconstructed Hermitian matrix
all.equal(H, H1)