Macaulay2 » Documentation
Packages » A1BrouwerDegrees :: diagonalizeViaCongruence
next | previous | forward | backward | up | index | toc

# diagonalizeViaCongruence -- diagonalizes a symmetric matrix via congruence

- Usage:
    `diagonalizeViaCongruence M`
- Inputs:
  - M, a matrix, a symmetric matrix over any field or finite étale algebras over a field
- Outputs:
  - a matrix, a diagonal matrix congruent to M

## Description

Given a symmetric matrix M over any field or finite étale algebra over a field, this command gives a diagonal matrix congruent to M. Note that the order in which the diagonal terms appear is not specified.

    i1 : R = QQ[x]/(x^2 - 1)

    o1 = R

    o1 : QuotientRing

    i2 : M = matrix(R, {{1,2},{2,x}});

                 2      2
    o2 : Matrix R  <-- R

    i3 : diagonalizeViaCongruence M

    o3 = | 1 0   |
         | 0 x-4 |

                 2      2
    o3 : Matrix R  <-- R

## See also

- getDiagonalClass -- produces a diagonalized form for any (unstable) Grothendieck-Witt class, with simplified terms on the diagonal
- getDiagonalEntries -- extracts a list of diagonal entries for a GrothendieckWittClass

## Ways to use diagonalizeViaCongruence:

- `diagonalizeViaCongruence(Matrix)`

## For the programmer

The object diagonalizeViaCongruence is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/A1BrouwerDegrees/Documentation/MatrixMethodsDoc.m2:25:0.