Suppose that a matrix 



M


{\displaystyle M}

 contains complex numbers. Then the conjugate transpose of 



M


{\displaystyle M}

 is a matrix 




M

H




{\displaystyle M^{H}}

 containing the complex conjugates of the matrix transposition of 



M


{\displaystyle M}

.

 



(

M

H



)

j
i


=



M

i
j


¯




{\displaystyle (M^{H})_{ji}={\overline {M_{ij}}}}




This means that row 



j


{\displaystyle j}

, column 



i


{\displaystyle i}

 of the conjugate transpose equals the

complex conjugate of row 



i


{\displaystyle i}

, column 



j


{\displaystyle j}

 of the original matrix.



In the next list, 



M


{\displaystyle M}

 must also be a square matrix.

 A Hermitian matrix equals its own conjugate transpose: 




M

H


=
M


{\displaystyle M^{H}=M}

.
 A normal matrix is commutative in multiplication with its conjugate transpose: 




M

H


M
=
M

M

H




{\displaystyle M^{H}M=MM^{H}}

.
 A unitary matrix has its inverse equal to its conjugate transpose: 




M

H


=

M

−
1




{\displaystyle M^{H}=M^{-1}}

. 
 This is true iff 




M

H


M
=

I

n




{\displaystyle M^{H}M=I_{n}}

 and iff 



M

M

H


=

I

n




{\displaystyle MM^{H}=I_{n}}

, where 




I

n




{\displaystyle I_{n}}

 is the identity matrix.


Task

Given some matrix of complex numbers, find its conjugate transpose.

Also determine if the matrix is a:

 Hermitian matrix,
 normal matrix, or 
 unitary matrix.


See also

 MathWorld entry: conjugate transpose
 MathWorld entry: Hermitian matrix
 MathWorld entry: normal matrix
 MathWorld entry: unitary matrix


 
test: procedure options (main); /* 1 October 2012 */
   declare n fixed binary;
 
   put ('Conjugate a complex square matrix.');
   put skip list ('What is the order of the matrix?:');
   get (n);
   begin;
      declare (M, MH, MM, MM_MMH, MM_MHM, IDENTITY)(n,n) fixed complex;
      declare i fixed binary;
 
      IDENTITY = 0; do i = 1 to n; IDENTITY(I,I) = 1; end;
      put skip list ('Please type the matrix:');
      get list (M);
      do i = 1 to n;
         put skip list (M(i,*));
      end;
      do i = 1 to n;
         MH(i,*) = conjg(M(*,i));
      end;
      put skip list ('The conjugate transpose is:');
      do i = 1 to n;
         put skip list (MH(i,*));
      end;
      if all(M=MH) then
         put skip list ('Matrix is Hermitian');
      call MMULT(M, MH, MM_MMH);
      call MMULT(MH, M, MM_MHM);
 
      if all(MM_MMH = MM_MHM) then
         put skip list ('Matrix is Normal');
 
      if all(ABS(MM_MMH - IDENTITY) < 0.0001) then
         put skip list ('Matrix is unitary');
      if all(ABS(MM_MHM - IDENTITY) < 0.0001) then
         put skip list ('Matrix is unitary');
   end;
 
MMULT: procedure (M, MH, MM);
   declare (M, MH, MM)(*,*) fixed complex;
   declare (i, j, n) fixed binary;
 
   n = hbound(M,1);
   do i = 1 to n;
      do j = 1 to n;
         MM(i,j) = sum(M(i,*) * MH(*,j) );
      end;
   end;
end MMULT;
end test;
 