Yes, I certainly understand the residue field behavior, but the Zmod behavior seemed weird. It is clearly not checking primality, but there does seem to be some kind of size limit that affects what happens. I couldn't find where this is in the code. For my situations I'd typically be willing to take the time hit to check primality (for ideals or whatever), so if there were an option to specify that, I'd probably take advantage of it. But, as I said, I couldn't figure out where this logic is in the code.
Ben On Monday, February 29, 2016 at 8:26:46 AM UTC-6, John Cremona wrote: > > On 29 February 2016 at 14:19, Ben Hutz <[email protected] <javascript:>> > wrote: > > I was exploring some quotient ring operations and came across the > following: > > > > {{{ > > R.<y>=QQ[] > > K.<w>=NumberField(y^3 + 2*y - 2401) > > k.<v>=K.quo(K.prime_factors(7)[1]) > > R.<x,y>=PolynomialRing(k) > > R.monomial_divides(y,x^3*y) > > Error > > }}} > > > > {{{ > > R.<y>=QQ[] > > K.<w>=NumberField(y^3 + 2*y - 2401) > > k.<v>=K.residue_field(K.prime_factors(7)[1]) > > R.<x,y>=PolynomialRing(k) > > R.monomial_divides(y,x^3*y) > > True > > }}} > > > > The second works, the first does not. I came across this since > > .monomial_divides is used is a groebner basis computation. So played > around > > I am not sure what you are expecting to get by doing K.quo(P) where P > is an ideal of the ring oif integers of K. The result seems to know > lottle about itself and have no functionality, while > K.residue_field(P) does what you would expect. > > > > a little more and the following seems weirder > > > > {{{ > > A.<x,y,z> = PolynomialRing(Zmod(42)) > > A.monomial_divides(y,x^2*y) > > True > > }}} > > > > {{{ > > A.<x,y,z> = PolynomialRing(Zmod(2521515232)) #but one less digit works > > A.monomial_divides(y,x^2*y) > > Error > > }} > > > > The first works, but the 2nd does not, even though neither is prime. It > > seems to have to do with what type of polynomial ring they are > initialized > > as, but I had a hard time tracking down where that code lived and how it > > decided. Is there someone familiar with polynomial rings in Sage who > could > > shed some light on whether this is expected behavior? > > I don't know about this one but do not find it surprising that Zmod(n) > should give a different type of object depending on the value of n. > For one thing, n may or may not be prime, and it may or may not b > sensible to take the time to check that. > > John > > > > > Thanks, > > Ben > > > > -- > > 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 [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at https://groups.google.com/group/sage-devel. > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
