Yes, as William points out, I wrote a generic Smith normal form implementation which has been in Sage since version 3.2.2 a couple of months back. I have tested it on matrices over QQ[x], although I'm not sure how long it would take on a 14x14 matrix -- like the Gap code you mention above, there are no specific optimisations for sparse matrices.
sage: R.<x> = QQ[] sage: M = Matrix(R, 4,4, [R.random_element() for i in xrange(16)]) sage: M.smith_form() This outputs a triple (d, u, v) of a diagonal matrix and two invertible transformation matrices. Unfortunately it is quite slow for large matrices, but this is mainly because the coefficients get large very fast on randomly chosen examples; presumably your examples are nicer in some sense, particularly if they're sparse. I didn't 100% follow what it was that you wanted to do, so I'm not quite sure if this answers your question. Did you just want Smith form of one matrix, or were you after some sort of simultaneous Smith form of multiple matrices? David On Feb 11, 6:37 am, William Stein <[email protected]> wrote: > On Tue, Feb 10, 2009 at 6:28 PM, Greg Kuperberg > > > > <[email protected]> wrote: > > > For a certain reason, I am interested in the Lie algebra generated by > > the generators of the Temperley-Lieb algebra, in its natural Catalan- > > dimensional representation. In other words given the T-L algebra with > > 2n strands, I am looking at a C_n x C_n matrix algebra quotient, where > > C_n is the nth Catalan number. Then in this quotient, the 2n-1 > > Temperley-Lieb generators also generate a Lie algebra. I only need 8 > > strands for the problem that I am studying. Thus it's a question in > > 14 x 14 matrices. > > > I wrote a SAGE/Python program to compute the matrices of the Temperley- > > Lieb generators, and then I gave them to GAP from SAGE. It isn't all > > that fast, because GAP does not use the fact that the matrices are > > sparse, but it works. Sort of. The problem is that the Temperley- > > Lieb algebra has a parameter d, and I want to know the answer for all > > d. My code can give me the answer for a specific d working over QQ. > > But if I want the answer for all d, I should be working over the > > polynomial ring QQ[d]. > > > Note that it is not hard to rephrase the question as a module question > > in R^(14^2), where R is the ground ring. I can write down the Lie > > adjoint action of the Temperley-Lieb generators on 14 x 14 matrices > > expressed as vectors. I can generate an invariant submodule, and I am > > then interested in the Smith Normal Form of this submodule, or > > equivalently the isomorphism type of the quotient module. I have to > > think a bit about keeping the number of generators of the module under > > control, but maybe there is a way. > > > My impression is that both GAP and SAGE can easily understand the > > question when it is posed over a field, but not over a univariate > > polynomial ring as I actually want. Am I wrong and is there a > > reasonable way to do this? > > David Loeffer recently added computation of Smith Normal Forms over > more general rings to Sage. See: > > http://trac.sagemath.org/sage_trac/ticket/4681 > > William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
