Cartesian product is a generic construction, so it should be clear that it 
is much slower than the super-optimized routines for prime finite fields.

Do you need element-wise multiplication? If you are only interested in the 
Abelian group structure then there is AbelianGroup([2,3]). Maybe you want 
IntegerModRing(6).


On Wednesday, July 23, 2014 7:13:12 AM UTC-4, Dima Pasechnik wrote:
>
> in GF(2)xGF(3) addition is about 50 times (!) slower than in GF(7). 
> sage: c=cartesian_product([GF(2),GF(3)]) 
> sage: %timeit c((1,1))+c((1,1)) 
> 10000 loops, best of 3: 67.5 µs per loop 
> sage: d=GF(7) 
> sage: %timeit d(1)+d(1) 
> 1000000 loops, best of 3: 1.44 µs per loop 
>
> This makes it next to useless for serious computations. 
> How could one speed it up? 
> Profiling the code will tell you that most time is spent in taking the 
> tuple apart and putting it back on again, finding the parents, 
> all in plain Python... 
>
> Should one have a dedicated cartesian_product_of_finite_rings or 
> something like this? 
>
>
>

-- 
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