Hi all,

I wrote some code for product rings a while back, and went back to it for 
more computations. My computations took vastly longer, and it seems the 
culprit is the inverse function in my ring.

The product code ring is here:

http://pastebin.com/V2Cx6gVB

I ran the following test code:

=====
from sage.matroids.advanced import *
load /path/to/product_ring.py

H5 = ProductRing((GF(5), GF(5), GF(5), GF(5), GF(5), GF(5)))
print H5

H5CrossRatios = set([H5(1)])
H5CrossRatios.update([H5(x) for x in
                      Permutations([2, 2, 3, 3, 4, 4])])
L = list(H5CrossRatios)
print len(H5CrossRatios)

timeit("""
s = 0
for i in xrange(91):
    for j in xrange(91):
        for k in xrange(30):
                        s = s + L[i] + (L[j])^(-1) * L[k]""", number=1, 
repeat=1)
=====

In Sage 5.12 this takes 6.41 seconds on my computer; in Sage 6.5.beta5 it 
takes 117 seconds.

The culprit is the inverse, if you do just addition and multiplication the 
code runs in the same amount of time. So...

* did I implement my ring wrong, and did it just happen to work better in 
the past?
* can I change my ring code to speed this back up?
* can you point to a change in Sage that could have caused this? And help 
me think about a way to fix it?

Cheers,

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to