# Alternating Frobenius form in Sage

Given an alternating, non-degenerate matrix $$A$$ over the integers, I need to compute the matrix "closest" to the standard symplectic form that can be obtained from $$A$$ by an integer change of basis in Sage. This is not the same as the symplectic_form() Sage method, as that one is designed to work over a field instead of a ring.

In the MAGMA documentation, I found a function that does precisely what I want called FrobeniusFormAlternating(A):

FrobeniusFormAlternating(A) : AlgMatElt -> SeqEnum

Given a non-singular 2n x 2n alternating matrix A over the integers, this function returns the (alternating) Frobenius form F of A. That is, a block matrix F = (matrix(0 & D

- D & 0)), where D is a diagonal matrix with positive diagonal entries, di, satisfying d1 | d2 | ... | dn. The second return value is the change of basis matrix B, such that BA ()tB = F.

I cannot find any information on how to compute this matrix (and change of basis), other than the cited work [Ste97] (which, as far as I can tell, does not explicitly address the alternating case).

Is there a more standard name for this normal form? Is there a Sage function that computes it?

There are two symplectic_form methods in Sage, one with documentation saying "Find a symplectic form for self if self is an anti-symmetric, alternating matrix defined over a field" and one specifically for integer matrices — see documentation for integer matrices. If you specify an integer matrix with mat = matrix(ZZ, ...), the second version should be used.