Chris,

I'm having trouble posting a reply here.  Here's the essence of what I
wanted to show you.  Perhaps more in just a minute.

sage: m=matrix(QQ, [[3/2, 4/3], [1/7, 5/11])
sage: m._clear_denoms()

([693 616]
[ 66 210], 462)

Rob

On Mar 19, 8:13 pm, Mike Hansen <mhan...@gmail.com> wrote:
> On Mar 19, 6:54 pm, Chris Godsil <cgod...@uwaterloo.ca> wrote:
>
> > What algorithm(s) does sage use to compute determinants over QQ[t] or
> > QQ[t,u]?
>
> For both of these, it is computing them using minors, which is awful
> when the matrices are not tiny.
>
> > Does they work over the ring of definition, or over the field of
> > fractions?
>
> These work over the ring of definition.  If you work over the field of
> fractions, then you can get some speedup since you can put then matrix
> in Hessenberg form and read the determinant off from the
> characteristic polynomial.  For the CycleGraph(9):
>
> sage: m.change_ring(R.fraction_field()).det()
> t^9 - 9*t^7 + 27*t^5 - 30*t^3 + 9*t - 2
> CPU time: 0.54 s,  Wall time: 0.57 s
>
> > over QQ[t] is not polynomial time. As the Reference Manual suggests, I
> > entered
> > M.determinant? to see what algorithm was being used, but did not get
> > any useful information.
>
> In this case, doing M.determinant?? to see the actual source code
> gives you everything it's doing.
>
> --Mike
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to