I have seen f = sympy.symbols('f', cls=Function) but not any documentation. Python does not like x = sympy.symbols('x', cls=FF(8)), it complains about
raise CoercionFailed("expected an integer, got %s" % a) CoercionFailed: expected an integer, got x
Whan is the purpose of the cls parameters and what must I do so that cls=FF(8) is meaning full?
With x = sympy.symbols('x', cls=FF(8)) I want x to be a symbol in the field FF(8), i.e x^(2^8-1) must give me 1.
There are a few issues here:
The
FFobject does not allow Symbols. It only works for exact numerical entries, likeFF(3)(2).Therefore, the
clsparameter ofsymbolswill not work. That just changes what object is used to create the symbol, so it must take a string as an input (the default isSymbol).SymPy does not currently support Symbols over finite fields. The best bet you can get is to use the
Polyobject with themodulusflag.FFcurrently only supports finite fields of prime cardinality.FF(8)has actually created the ring Z_8, not the finite field with 8 elements.You probably know this, but
^does not do exponentiation in SymPy/Python. Use**.