Pensé en mostrar lo que el algoritmo de el.Slavador de Dada una $4\times 4$ matriz simétrica, ¿existe una forma eficiente de encontrar sus valores propios y diagonalizarla? hace para su forma $xy + zx - 3yz.$ Tuve que doblar para obtener enteros en $M,$ no es realmente importante. Se reduce a $$ \left(\frac{1}{2} \, x + \frac{1}{2} \, y - z \right)^2 - \frac{1}{4} (-x+y+4z)^2 + 3 z^2 = xy + zx - 3yz. $$
$$ Q^T D Q = H $$ $$\left( \begin{array}{rrr} \frac{ 1 }{ 2 } & - 1 & 0 \\ \frac{ 1 }{ 2 } & 1 & 0 \\ - 1 & 4 & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & - \frac{ 1 }{ 2 } & 0 \\ 0 & 0 & 6 \\ \end{array} \right) \left( \begin{array}{rrr} \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & - 1 \\ - 1 & 1 & 4 \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 0 & 1 & 1 \\ 1 & 0 & - 3 \\ 1 & - 3 & 0 \\ \end{array} \right) $$
$$ E_j^T D_{j-1} E_j = D_j $$ $$ P_{j-1} E_j = P_j $$ $$ E_j^{-1} Q_{j-1} = Q_j $$ $$ P_j Q_j = I $$ $$ P_j^T H P_j = D_j $$ $$ Q_j^T D_j Q_j = H $$
$$ H = \left( \begin{array}{rrr} 0 & 1 & 1 \\ 1 & 0 & - 3 \\ 1 & - 3 & 0 \\ \end{array} \right) $$
\==============================================
$$ E_{1} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{1} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{1} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ - 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{1} = \left( \begin{array}{rrr} 2 & 1 & - 2 \\ 1 & 0 & - 3 \\ - 2 & - 3 & 0 \\ \end{array} \right) $$
\==============================================
$$ E_{2} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 2 } & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{2} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 2 } & 0 \\ 1 & \frac{ 1 }{ 2 } & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{2} = \left( \begin{array}{rrr} \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & 0 \\ - 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{2} = \left( \begin{array}{rrr} 2 & 0 & - 2 \\ 0 & - \frac{ 1 }{ 2 } & - 2 \\ - 2 & - 2 & 0 \\ \end{array} \right) $$
\==============================================
$$ E_{3} = \left( \begin{array}{rrr} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{3} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 2 } & 1 \\ 1 & \frac{ 1 }{ 2 } & 1 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{3} = \left( \begin{array}{rrr} \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & - 1 \\ - 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{3} = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & - \frac{ 1 }{ 2 } & - 2 \\ 0 & - 2 & - 2 \\ \end{array} \right) $$
\==============================================
$$ E_{4} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & - 4 \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{4} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 2 } & 3 \\ 1 & \frac{ 1 }{ 2 } & - 1 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{4} = \left( \begin{array}{rrr} \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & - 1 \\ - 1 & 1 & 4 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{4} = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & - \frac{ 1 }{ 2 } & 0 \\ 0 & 0 & 6 \\ \end{array} \right) $$
\==============================================
$$ P^T H P = D $$ $$\left( \begin{array}{rrr} 1 & 1 & 0 \\ - \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & 0 \\ 3 & - 1 & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 0 & 1 & 1 \\ 1 & 0 & - 3 \\ 1 & - 3 & 0 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 2 } & 3 \\ 1 & \frac{ 1 }{ 2 } & - 1 \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & - \frac{ 1 }{ 2 } & 0 \\ 0 & 0 & 6 \\ \end{array} \right) $$ $$ Q^T D Q = H $$ $$\left( \begin{array}{rrr} \frac{ 1 }{ 2 } & - 1 & 0 \\ \frac{ 1 }{ 2 } & 1 & 0 \\ - 1 & 4 & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & - \frac{ 1 }{ 2 } & 0 \\ 0 & 0 & 6 \\ \end{array} \right) \left( \begin{array}{rrr} \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & - 1 \\ - 1 & 1 & 4 \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 0 & 1 & 1 \\ 1 & 0 & - 3 \\ 1 & - 3 & 0 \\ \end{array} \right) $$
PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.
Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.
parisize = 4000000, primelimit = 500509
? m = [ 0,1,1; 1,0,-3; 1,-3,0]
%1 =
[0 1 1]
[1 0 -3]
[1 -3 0]
? m - mattranspose(m)
%2 =
[0 0 0]
[0 0 0]
[0 0 0]
? p1 = [ 1,0,0; 1,1,0; 0,0,1]
%3 =
[1 0 0]
[1 1 0]
[0 0 1]
?
? m1 = mattranspose(p1) * m * p1
%4 =
[2 1 -2]
[1 0 -3]
[-2 -3 0]
p2 = [ 1, -1/2, 1; 0,1,0; 0,0,1]
? p2 = [ 1, -1/2, 1; 0,1,0; 0,0,1]
%5 =
[1 -1/2 1]
[0 1 0]
[0 0 1]
? m2 = mattranspose(p2) * m1 * p2
%6 =
[2 0 0]
[0 -1/2 -2]
[0 -2 -2]
?
p3 = [1,0,0; 0,1,-4; 0,0,1]
?
? p3 = [1,0,0; 0,1,-4; 0,0,1]
%7 =
[1 0 0]
[0 1 -4]
[0 0 1]
? m3 = mattranspose(p3) * m2 * p3
%8 =
[2 0 0]
[0 -1/2 0]
[0 0 6]
? p = p1 * p2 * p3
%9 =
[1 -1/2 3]
[1 1/2 -1]
[0 0 1]
?
? matdet(p)
%10 = 1
?
? q = matadjoint(p)
%11 =
[1/2 1/2 -1]
[-1 1 4]
[0 0 1]
?
? m3
%12 =
[2 0 0]
[0 -1/2 0]
[0 0 6]
?
? mattranspose(q) * m3 * q
%13 =
[0 1 1]
[1 0 -3]
[1 -3 0]
? m
%14 =
[0 1 1]
[1 0 -3]
[1 -3 0]
? p
%15 =
[1 -1/2 3]
[1 1/2 -1]
[0 0 1]
?
? mattranspose(p) * m * p
%16 =
[2 0 0]
[0 -1/2 0]
[0 0 6]
?
Recogí un montón de estos, en algunos i respuesta y tipografía también, más fácil de leer que este:
referencia para libros de álgebra lineal que enseñan el método de Hermite inverso para matrices simétricas
Diagonalización de la forma bilineal
Dada una $4\times 4$ matriz simétrica, ¿existe una forma eficiente de encontrar sus valores propios y diagonalizarla?
Encuentra la matriz de transición que transformaría esta forma en una forma diagonal.
Escribir una expresión como suma de cuadrados
Matriz determinante $A$ y $B$ , matriz rectangular