The fact that the discrepancy is 46273*46153 (both primes) makes me suspect 
that there's a factor of
2 missing in the CRT bounds, to allow for $\pm$. But I don't have the 
source here to check.

On Thursday, 26 April 2012 11:19:49 UTC+1, Alastair Irving wrote:
>
> On 25/04/2012 16:45, Graham Gerrard wrote: 
> > Finding occasional inconsistencies when using matrices with cyclotomic 
> > entries, though works well most of the time... 
> > 
> > sage: s=CyclotomicField(24,'s').gen() 
> > sage: (8*s^6-1)^10 
> > -1098715216*s^6 - 372960063 
> > sage: xb=matrix(1,1,[8*s^6-1]) 
> > sage: xb^10 
> > [1036922553*s^6 - 372960063] 
> I can confirm this behaviour. 
> > 
> > Above example is trivial computation, though problem recurs in several 
> > contexts. I believe that scalar multiplication is correct and xb^10 
> > incorrect. 
> Yes, I've checked with Magma and you're right. 
> > 
> > Any suggestions? 
> Sage has a special algorithm for multiplying matrices over cyclotomic 
> fields which works modulo primes and then does a Chinese remainder to 
> put the answer together.  There is presumably a problem somewhere in 
> this algorithm but I don't know where.  A rather unpleasant workaround 
> is to do 
> xb.sparse_matrix()^10 
> Sage just uses a generic algorithm for multiplying the sparse matrices 
> so this gives the correct answer.  However, the performance probably 
> won't be as good. 
>
> Alastair 
>

-- 
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
URL: http://www.sagemath.org

Reply via email to