Learn R Programming

Matrix (version 0.3-24)

Hermitian.test: Test a Matrix for Conjugate Symmetry

Description

Hermitian.test returns the maximum modulus of the difference between a matrix and the conjugate of its transpose. is.Hermitian checks if this value is less than a tolerance.

Usage

is.Hermitian(x, tol)
Hermitian.test(x)

Arguments

x
a numeric or complex matrix.
tol
tolerance for the maximum modulus of the elements of the difference elements in the lower triangle and the corresponding elements in the upper triangle.

Value

  • Hermitian.test returns the maximum modulus of the difference between x and its conjugate transpose. (If x is not a matrix or is not square, Inf is returned.) is.Hermitian returns a logical value according to whether the value of Hermitian.test(x) is less than or equal to the tolerance tol.

Examples

Run this code
is.Hermitian(hilbert(6))  # returns TRUE
x <- Matrix(1:9,3,3)
x[row(x) > col(x)] <- t(x)[row(x) > col(x)]
is.Hermitian(x, tol = 0)  # returns TRUE
Hermitian.test(x)         # returns 0

Run the code above in your browser using DataLab