M = Matrix.New({{1,1,1,1,1,1}, {1,1,2,3,4,5}, {1,2,3,4,8,6}, {1,3,4,5,6,7}, {1,4,8,6,7,8}, {1,5,6,7,8,1}}) G1, U1 = Matrix.Tridiagonalize(M,{{"BlockSize",1}}) G2, U2 = Matrix.Tridiagonalize(M,{{"BlockSize",2}}) print("The matrix M in tri-diagonal form is") print(ResponseFunction.ToMatrix(G1)) print("The unitary matrix U1 that transforms M to tridiagonal form is given as") print(U2) print("And if we look at U^**M*U^T we get") print(Chop(U1*M*Matrix.Transpose(U1))) print("The matrix M in Block tri-diagonal form is") print(ResponseFunction.ToMatrix(G2)) print("The unitary matrix U2 that transforms M to tridiagonal form is given as") print(U2) print("And if we look at U^**M*U^T we get") print(Chop(U2*M*Matrix.Transpose(U2)))