Matrix.Tridiagonalize(M) returns the matrix in triple-diagonal form. The first element returned is a try-diagonal response function representing the matrix. The second element returned is a matrix that represents the unitary matrix that transforms the Hermitian matrix M to try-diagonal form. Possible options include
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)))
The matrix M in tri-diagonal form is
{ { 1 , -2.2361 , 0 , 0 , 0 , 0 } ,
{ -2.2361 , 24.6 , 5.8515 , 0 , 0 , 0 } ,
{ 0 , 5.8515 , -0.7402 , -2.334 , 0 , 0 } ,
{ 0 , 0 , -2.334 , -2.4962 , 2.2758 , 0 } ,
{ 0 , 0 , 0 , 2.2758 , -3.2905 , 2.162 } ,
{ 0 , 0 , 0 , 0 , 2.162 , -1.0732 } }
The unitary matrix U1 that transforms M to tridiagonal form is given as
{ { 1 , 0 , 0 , 0 , 0 , 0 } ,
{ 0 , 1 , 0 , 0 , 0 , 0 } ,
{ 0 , 0 , 0.8328 , 0.4502 , 0.0676 , -0.315 } ,
{ 0 , 0 , 0.0805 , 0.312 , 0.5435 , 0.7751 } ,
{ 3e-17 , 0 , 0.4415 , -0.8303 , 0.3361 , 0.0527 } ,
{ -8e-17 , 0 , -0.3242 , 0.1032 , 0.7662 , -0.5452 } }
And if we look at U^**M*U^T we get
{ { 1 , -2.2361 , 0 , 0 , 0 , 0 } ,
{ -2.2361 , 24.6 , 5.8515 , 0 , -3e-15 , 0 } ,
{ 0 , 5.8515 , -0.7402 , -2.334 , 0 , 0 } ,
{ 0 , 0 , -2.334 , -2.4962 , 2.2758 , 0 } ,
{ 0 , -3e-15 , 0 , 2.2758 , -3.2905 , 2.162 } ,
{ 0 , 0 , 0 , 0 , 2.162 , -1.0732 } }
The matrix M in Block tri-diagonal form is
{ { 1 , 1 , 1.0355 , 1.7111 , 0 , 0 } ,
{ 1 , 1 , 1.7111 , 7.1465 , 0 , 0 } ,
{ 1.0355 , 1.7111 , 2.0149 , 11.884 , 1.062 , 0.4744 } ,
{ 1.7111 , 7.1465 , 11.884 , 16.985 , 0.4744 , 3.0368 } ,
{ 0 , 0 , 1.062 , 0.4744 , 0.8681 , 0.9176 } ,
{ 0 , 0 , 0.4744 , 3.0368 , 0.9176 , -3.8681 } }
The unitary matrix U2 that transforms M to tridiagonal form is given as
{ { 1 , 0 , 0 , 0 , 0 , 0 } ,
{ 0 , 1 , 0 , 0 , 0 , 0 } ,
{ 0 , 0 , 0.8328 , 0.4502 , 0.0676 , -0.315 } ,
{ 0 , 0 , 0.0805 , 0.312 , 0.5435 , 0.7751 } ,
{ 0 , 0 , 0.4415 , -0.8303 , 0.3361 , 0.0527 } ,
{ 0 , 0 , -0.3242 , 0.1032 , 0.7662 , -0.5452 } }
And if we look at U^**M*U^T we get
{ { 1 , 1 , 1.0355 , 1.7111 , 0 , 0 } ,
{ 1 , 1 , 1.7111 , 7.1465 , 0 , 0 } ,
{ 1.0355 , 1.7111 , 2.0149 , 11.884 , 1.062 , 0.4744 } ,
{ 1.7111 , 7.1465 , 11.884 , 16.985 , 0.4744 , 3.0368 } ,
{ 0 , 0 , 1.062 , 0.4744 , 0.8681 , 0.9176 } ,
{ 0 , 0 , 0.4744 , 3.0368 , 0.9176 , -3.8681 } }