Re: [sage-support] Strange behavior when evaluating multivariate polynomials over integers modulo n

2021-03-08 Thread Alex Braat
Small update:
Replacing Integers(p^2) by QuotientRing(ZZ, p^2) seems to fix the issue.

Op maandag 8 maart 2021 om 10:34:06 UTC+1 schreef dim...@gmail.com:

> On Mon, Mar 8, 2021 at 9:25 AM Alex Braat  wrote:
> >
> > Hello,
> >
> > I have encountered some strange behavior when I evaluate multivariate 
> polynomials over the integers modulo n. For instance,
> >
> > In:
> > p = 3
> > S = Integers(p^2)
> > R. = PolynomialRing(S)
> > f = x^2 * y^2
> > print(f([S(p),S(1)]), f([S(1), S(p)]))
> >
> > Out:
> > 1 0
> >
> > while both evaluations should ofcourse be equal to 0. This does not 
> depend on the prime p, and is consistent in both of these versions of 
> SageMath:
>
> looks like a bug (also in the 9.3.beta7)
> sage: f(S(3),S(1))
> 1
>
>
> >
> > 'SageMath version 8.7, Release Date: 2019-03-23'
> > 'SageMath version 9.2, Release Date: 2020-10-24'
> >
> > Am I doing something wrong or is this a bug?
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-support" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-support...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/e3b67e84-1d8b-46e4-b0dd-5558f6d4929bn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/c860111e-aeea-43ff-b6c5-5c392e590789n%40googlegroups.com.


[sage-support] Strange behavior when evaluating multivariate polynomials over integers modulo n

2021-03-08 Thread Alex Braat
Hello,

I have encountered some strange behavior when I evaluate multivariate 
polynomials over the integers modulo n. For instance,

In:
p = 3
S = Integers(p^2)
R. = PolynomialRing(S)
f = x^2 * y^2
print(f([S(p),S(1)]), f([S(1), S(p)]))

Out:
1 0

while both evaluations should ofcourse be equal to 0. This does not depend 
on the prime p, and is consistent in both of these versions of SageMath:

'SageMath version 8.7, Release Date: 2019-03-23'
'SageMath version 9.2, Release Date: 2020-10-24'

Am I doing something wrong or is this a bug?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/e3b67e84-1d8b-46e4-b0dd-5558f6d4929bn%40googlegroups.com.