import sympy as S
F = S.FiniteField(101)
When I call f = S.poly(y ** 2 - x ** 3 - x - 1,F)
I get the following error:
'FiniteField' object has no attribute 'is_commutative'
But finite fields are commutative by definition! So I'm not really sure what this error is supposed to mean!
Has anyone come across this before? How do you declare polynomials over a finite field?
is_commutative
is an attribute of operators generally. It is not implemented for domains (unlike is_numeric
etc).
e.g.
>>> F = sympy.RealField() #returns the same error
>>> f = sympy.poly(y ** 2 - x ** 3 - x - 1, F)
AttributeError: 'RealField' object has no attribute 'is_commutative'
Hence, poly
is interpreting your positional argument as something other than the domain. To get the intended behaviour with poly
(and factor
etc) you must use the domain
(or equivalent) kwarg i.e:
f = sympy.poly(y ** 2 - x ** 3 - x - 1, domain=F)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With