Ask Your Question

Hermite form, entries reduced over pivots

asked 2017-06-16 17:24:41 +0200

philipp7 gravatar image

updated 2017-07-31 21:14:40 +0200

FrédéricC gravatar image


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]);

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


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-06-16 22:01:07 +0200

nbruin gravatar image

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.

edit flag offensive delete link more


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

kcrisman gravatar imagekcrisman ( 2017-06-17 04:30:01 +0200 )edit

answered 2017-06-16 18:50:55 +0200

kcrisman gravatar image

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 (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[];

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

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.

edit flag offensive delete link 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.

philipp7 gravatar imagephilipp7 ( 2017-06-16 19:13:18 +0200 )edit

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

kcrisman gravatar imagekcrisman ( 2017-06-16 19:48:18 +0200 )edit

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

philipp7 gravatar imagephilipp7 ( 2017-06-16 20:16:20 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-06-16 17:24:41 +0200

Seen: 729 times

Last updated: Jun 16 '17