FiniteFieldRationalPolynomial
FiniteFieldRationalPolynomial()
A Symbolica rational polynomial.
Methods
Name | Description |
---|---|
apart | Compute the partial fraction decomposition in x . |
derivative | Take a derivative in x . |
gcd | Compute the greatest common divisor (GCD) of two rational polynomials. |
get_var_list | Get the list of variables in the internal ordering of the polynomial. |
parse | Parse a rational polynomial from a string. |
to_latex | Convert the rational polynomial into a LaTeX string. |
apart
FiniteFieldRationalPolynomial.apart(x)
Compute the partial fraction decomposition in x
.
Examples
>>> from symbolica import Expression
>>> x = Expression.symbol('x')
>>> p = Expression.parse('1/((x+y)*(x^2+x*y+1)(x+1))').to_rational_polynomial()
>>> for pp in p.apart(x):
>>> print(pp)
derivative
FiniteFieldRationalPolynomial.derivative(x)
Take a derivative in x
.
Examples
>>> from symbolica import Expression
>>> x = Expression.symbol('x')
>>> p = Expression.parse('1/((x+y)*(x^2+x*y+1)(x+1))').to_rational_polynomial()
>>> print(p.derivative(x))
gcd
FiniteFieldRationalPolynomial.gcd(rhs)
Compute the greatest common divisor (GCD) of two rational polynomials.
get_var_list
FiniteFieldRationalPolynomial.get_var_list()
Get the list of variables in the internal ordering of the polynomial.
parse
FiniteFieldRationalPolynomial.parse(_cls, input, vars, prime)
Parse a rational polynomial from a string. The list of all the variables must be provided.
If this requirements is too strict, use Expression.to_polynomial()
instead.
Examples
>>> e = FiniteFieldRationalPolynomial.parse('3*x^2+y+y*4', ['x', 'y'], 17)
Raises
Type | Description |
---|---|
ValueError | If the input is not a valid Symbolica rational polynomial. |
to_latex
FiniteFieldRationalPolynomial.to_latex()
Convert the rational polynomial into a LaTeX string.