# The difference between unitary and orthogonal matrices.

17 Apr 2022I didn’t know the difference between a unitary and orthogonal matrix. They seemed to behave the same, so …?

It turns out that a unitary matrix has similar properties as an orthogonal matrix, except that the unitary matrix’s entries may be complex, while the orthogonal matrix’s entries are real numbers.

These are properties of an orthogonal matrix

\[R^TR = I, \: R^{-1} = R^T, \: R R^{T} = I. \label{orthogonality}\]Related post: Rotation parameterizations in neural networks: some options.

And for a unitary matrix, since the entries may be complex, the conjugate transpose (\(^*\)) is used instead of the transpose (\(^T\)):

\[R^*R = I, \: R^{-1} = R^*, \: R R^* = I. \label{unitary}\]In Eigen, you can get the conjugate transpose of a matrix using the `adjoint()`

function, docs, and the transpose with the `transpose()`

function, docs. There are also `inPlace`

versions of these functions.