A square matrix U is a unitary matrix if U^H = U^(-1), where U^H denotes the conjugate transpose and U^(-1) is the matrix inverse. For example, A = [2^(-1/2) | 2^(-1/2) | 0 (-2)^(-1/2) i | 2^(-1/2) i | 0 0 | 0 | i] is a unitary matrix. Unitary matrices leave the length of a complex vector unchanged.