Off[General::spell1];
Clear[GramSchmidt,a0];
GramSchmidt[a0_] := 
Module[{a, b, n, m }, 
 a = a0;
 mna = Dimensions[a];
 m = mna[[1]]; 
 n = mna[[2]];
   norm[V_] :=N[ Sqrt[V.Conjugate[V]/.List->Plus], digit];
   b=Transpose[a];   (*In Mathematica a[[k]] is the k-th 
                      row of a,here we work with columns*)
   Clear[t]; 
   t=Table[0,{i,1,n},{j,1,n}];
 For[k=1, k <= n, k++,
      t[[k,k]] =  norm[b[[k]]];
      b[[k]] = N[ b[[k]] / t[[k,k]], digit]; 
    For[j=k+1, j <=n, j++,
      t[[k,j]] = N[Conjugate[b[[k]]].b[[j]]/.List->Plus,digit];
      b[[j]] = N[b[[j]] - t[[k,j]] b[[k]],digit]; ];];
 a=Transpose[b];     
 Return[a]; ];
  On[General::spell1];

Clear[digit];
digit = 8;

Clear[A];
A={{1,2},{1,1}}; 
MatrixForm[A]

GS=GramSchmidt[A];
MatrixForm[GS]

MatrixForm[t]

MatrixForm[GS.t]

MatrixForm[Chop[Transpose[GS].GS] ]

Clear[A];
A={{2,1,0},{1,2,1}, {0,1,2}} ;
MatrixForm[A]

Clear[GS];
GS=GramSchmidt[A];
MatrixForm[GS]

MatrixForm[t]

MatrixForm[Chop[GS.t]]

MatrixForm[Chop[Transpose[GS].GS]]

Clear[A,B];
B={{1,2,1},{2,1,1} } ;
A=Transpose[B];  
MatrixForm[A]

Clear[GS];
GS=GramSchmidt[A];
MatrixForm[GS]

MatrixForm[t]

MatrixForm[Chop[GS.t]]

MatrixForm[Chop[Transpose[GS].GS]]

Clear[A];
A={{1+I,2},{1,1},{1,2-2I}}; 
MatrixForm[A]

Clear[GS];
GS=GramSchmidt[A];
MatrixForm[Chop[GS] ]

MatrixForm[t]

MatrixForm[Chop[GS.t]]

MatrixForm[Chop[ Transpose[Conjugate[GS]].GS]  ]