import sympy as S
F = S.FiniteField(101)
当我打电话时,f = S.poly(y ** 2 - x ** 3 - x - 1,F)
我收到以下错误:
'FiniteField' 对象没有属性 'is_commutative'
但是根据定义,有限域是可交换的!所以我不太确定这个错误应该是什么意思!
有没有人遇到过这个?如何在有限域上声明多项式?
import sympy as S
F = S.FiniteField(101)
当我打电话时,f = S.poly(y ** 2 - x ** 3 - x - 1,F)
我收到以下错误:
'FiniteField' 对象没有属性 'is_commutative'
但是根据定义,有限域是可交换的!所以我不太确定这个错误应该是什么意思!
有没有人遇到过这个?如何在有限域上声明多项式?
is_commutative
一般是算子的一个属性。它不适用于域(与is_numeric
等不同)。
例如
>>> 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'
因此,poly
将您的位置参数解释为域以外的东西。要获得poly
(factor
等)的预期行为,您必须使用domain
(或等效的)kwarg,即:
f = sympy.poly(y ** 2 - x ** 3 - x - 1, domain=F)