# Hermite form, entries reduced over pivots

Hello!

I have a question concerning the function hermite_form. This function unfortunately does not reduce the entries above the pivots of the hermite normal form if I use the function on a matrix with polynomial entries. Is there another function or option which enables me to do that? Following short example hopefully illustrates what I mean:

R.<x> = QQ[];
M = matrix(2,2, [x,x, 0,x]);
M.hermite_form()


This will give the exact same matrix M and not the matrix [x,0, 0,x] which I would expect or hope to get.

Especially if somebody wants to apply another algorithm to such a matrix in hermite form it can be difficult to work with non-reduced matrices.

Kind regards

Philipp

edit retag close merge delete

Sort by » oldest newest most voted

A little digging in the code shows that M.hermite_form calls M._echelon_form_PID which is a very generic routine. It also documents that further reduction of non-pivot entries in pivot colums is done when ideals of the base ring have a small_residue method.

It should be a nice beginner ticket.

more

Thanks for doing that digging - I saw the pid call but didn't have time to look further!

( 2017-06-16 21:30:01 -0500 )edit

One problem might be that you aren't working over the fraction field. Are you sure you want Hermite form and not a different echelon? Note that this is even partly documented - if you add the line M = M.change_ring(R.fraction_field())as suggested in http://doc.sagemath.org/html/en/refer... (search for "hermite_form") it still does the same thing.

On the other hand, M.echelon_form() does what you (apparently) want.

R.<x> = QQ[];

@interact
def _(form=['Hermite','Echelon']):
M = matrix(2,2, [x,x, 0,x]);
M = M.change_ring(R.fraction_field())
if form=='Hermite':
show(M.hermite_form())
else:
show(M.echelon_form())


I don't know enough about the Hermite form to say more, but this is often what the issue is for other users in a similar situation. If this is wrong, then this is probably a bug, as opposed to inadequate documentation.

more

Thank you very much for your answer. Unfortunately it is not what I hoped to get. Changing to the fraction field does not give the result that I want. I want to stay in the polynomials over the rationals and I only want to reduce the entries above the pivots. I know that the hermite normal form is defined quite differently amongst different authors but a lot of times the definition include that entries above the pivots are 0 or have a degree which is strictly smaller than the degree of the pivot. Furthermore often a unique representative (for instance monic polynomials here) is chosen.

( 2017-06-16 12:13:18 -0500 )edit

My guess is that it is some disagreement about definitions, then. Hopefully someone else may have a better answer.

( 2017-06-16 12:48:18 -0500 )edit

Probably. However, hermite form on integer matrices does reduce entries above the pivots. So even in Sage different definitions are used. Thanks anyway!

( 2017-06-16 13:16:20 -0500 )edit