Go to the first, previous, next, last section, table of contents.

### `ptosfp`, `sfptop`

`ptosfp(p)`
`sfptop(p)`
  :: Transformation to/from a small finite field

return
  polynomial
p
  polynomial

- `ptosfp()` converts coefficients of a polynomial to elements in a small finite field GF(p^n) set as a ground field. If a coefficient is already an element of the field, no conversion is done. If a coefficient is a positive integer, then its residue modulo p^n is expanded as p-adic integer, then p is substituted by x, finally the polynomial is converted to its correspoding logarithmic representation with respect to the primitive element. For example, GF(3^5) is represented as F(3)[x]/(x^5+2*x+1), and each element of the field is represented as @_k by its exponent k with respect to the primitive element x. 23 = 2*3^2+3+2 is represented as 2*x^2+x+2 and it is equivalent to x^17 modulo x^5+2*x+1. Therefore an integer 23 is conterted to @_17.
- `sfptop()` is the inverse of `ptosfp()`.

    [196] setmod_ff(3,5);
    [3,x^5+2*x+1,x]
    [197] A = ptosfp(23);
    @_17
    [198] 9*2+3+2;
    23
    [199] x^17-(2*x^2+x+2);
    x^17-2*x^2-x-2
    [200] sremm(@,x^5+2*x+1,3);
    0
    [201] sfptop(A);
    23

`References`
  section `setmod_ff`, section `simp_ff`

Go to the first, previous, next, last section, table of contents.