Documentation

# `Dom`::`DistributedPolynomial`

Domains of distributed polynomials

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

### Domain Creation

`Dom::DistributedPolynomial(<`Vars, <R, <Order>>`>)`

### Element Creation

`Dom::DistributedPolynomial(Vars, R, Order)(`p`)`
`Dom::DistributedPolynomial(Vars, R, Order)(`lm`)`
`Dom::DistributedPolynomial(Vars, R, Order)(`lm`, `v`)`

## Description

`Dom::DistributedPolynomial(Vars, R, ..)` creates the domain of polynomials in the variables of the list `Vars` over the commutative ring `R` in distributed representation.

`Dom::DistributedPolynomial(Vars, R, Order)` creates a domain of polynomials in the variables of the list `Vars` over a domain of category `Cat::CommutativeRing` in sparse distributed representation with respect to the monomial ordering `Order`.

If `Dom::DistributedPolynomial` is called without any argument, a polynomial domain in arbitrarily many indeterminates over the domain `Dom::ExpressionField``(normal)` with respect to the lexicographic monomial ordering is created.

If `Dom::DistributedPolynomial` is called only with the variable list `Vars` as argument, the polynomial domain in the variable list `Vars` over the domain `Dom::ExpressionField``(normal)` with respect to the lexicographic monomial ordering is created.

### Note

Only commutative coefficient rings of type `DOM_DOMAIN` are allowed which inherit from `Dom::BaseDomain`. If `R` is of type `DOM_DOMAIN` but does not inherit from `Dom::BaseDomain`, the domain `Dom::ExpressionField``(normal)` will be used instead.

`Dom::DistributedPolynomial` accepts expressions as indeterminates, similar to the kernel domain `DOM_POLY`. Hence, for example, `[x,cos(x)]` is a valid variable list.

If the variable list `Vars` is the empty list (`[]`), a polynomial domain in arbitrarily many indeterminates is created. In this case, when creating new elements from polynomials or polynomial expressions, the system function `indets` is first called to get the variables and then the polynomial is created with respect to these variables. Hence, in this case only identifiers can be valid indeterminates, because `indets` returns only identifiers.

It is not allowed to create polynomial domains in arbitrarily many indeterminates over another polynomial domain of category `Cat::Polynomial`, but it is possible to create multivariate polynomial domains with a given list of variables over any polynomial domain.

`Dom::DistributedPolynomial` represents polynomials over arbitrary commutative rings. It is intended as a basic domain for distributed polynomials from which it is easy to create new distributed polynomial domains.

All usual algebraic and arithmetical polynomial operations are implemented, including Gröbner basis computation.

### Note

It is highly recommended to use only coefficient rings with unique zero representation. Otherwise it can happen that, e.g., a polynomial division will not terminate or a wrong degree will be returned.

Please note that for reasons of efficiency not all methods check their arguments, not even at the interactive level. In particular this is true for many access methods, converting methods and technical methods.

## Superdomain

`Dom::BaseDomain`

## Axioms

If `R` has `Ax::normalRep`, then `Ax::normalRep`.

If `R` has `Ax::canonicalRep`, then `Ax::canonicalRep`.

## Categories

If `Vars` has exactly one variable, then `Cat::UnivariatePolynomial``(R)`, else `Cat::Polynomial``(R)`.

## Examples

### Example 1

The following call creates a polynomial domain in x, y and z.

`DP := Dom::DistributedPolynomial([x, y, z])`
` `

Since neither the coefficient ring nor the monomial ordering was specified, this domain is created with the default values for these parameters.

It is rather easy to create elements of this domain, as e.g.

`a := DP(x + 2*y*z + 3)`
` `
`b := DP(z^4 - 2*y^2*x^2)`
` `

In contrast to expressions all elements of this domain have a representation which is fixed by the chosen `Order`, the representation of the coefficient ring `R` and the way of representing monomials.

With these elements one can now perform usual arithmetic operations as, e.g., (scalar) multiplication, multiplication with integers and adding polynomials and ring elements:

`4*b^2 + a/3 + 1/2`
` `

There are a lot of methods for manipulating polynomials and to get access to all parts of a polynomial. For example one has access to the leading monomial of `a` as follows:

`lmonomial(a)`
` `

The leading monomial of a polynomial depends on the monomial ordering, so with respect to the degree order one gets a different result:

`lmonomial(a, DegreeOrder)`
` `

To get `a` minus its leading monomial one may call:

`DP::reductum(a)`
` `

Obviously the following identity holds:

`a - lmonomial(a) - DP::reductum(a)`
` `

There are also methods for converting elements of this domain into other domains, like a basic polynomial domain or the domain of arbitrary expressions:

`poly(a), domtype(poly(a))`
` `
`expr(b), domtype(expr(b))`
` `

## Parameters

 `Vars` A list of indeterminates. Default is `[]` (the empty list, indicating “arbitrary indeterminates”). `R` A commutative ring, i.e., a domain of category `Cat::CommutativeRing`. Default is `Dom::ExpressionField(normal)`. `Order` A monomial ordering, i.e., one of the predefined orderings `LexOrder`, `DegreeOrder` or `DegInvLexOrder` or any object of type `Dom::MonomOrdering`. Default is `LexOrder`. `p` A polynomial or a polynomial expression. `lm` List of monomials, which are represented as lists containing the coefficients together with the exponents or exponent vectors. `v` List of indeterminates. This parameter is only valid for ```Vars = []```.

## Entries

 "characteristic" The characteristic of this domain. "coeffRing" The coefficient ring of this domain as defined by the parameter `R`. "key" The name of the created domain. "one" The neutral element w.r.t. `"_mult"`. "ordering" The monomial order as defined by the parameter `Order`. "variables" The list of variables as defined by the parameter `Vars`. "zero" The neutral element w.r.t. `"_plus"`.

## Methods

expand all

#### Mathematical Methods

`_divide(a, b)`

`_divide(a, b)`

`_divide(a, b)`

It overloads the function `_divide` for polynomials, i.e., one may use it either in the form `a / b`, or in functional form `_divide(a, b)`.

### Note

This method only exists if `R` is an integral domain, i.e., a domain of category `Cat::IntegralDomain`.

`_invert(a)`

`_mult(<a, b, …>)`

This method overloads the function `_mult` for polynomials, i.e., one may use it either in the form `a * b * ...` or in functional notation `_mult(a, b, ...)`.

`_negate(a)`

This method overloads the function `_negate` for polynomials, i.e., one may use it either in the form `-a` or in functional notation `_negate(a)`.

`_plus(<a, b, …>)`

This method overloads the function `_plus` for polynomials, i.e., one may use it either in the form `a + b + ...` or in functional notation `_plus(a, b, ...)`.

`_power(a, n)`

This method overloads the function `_power` for polynomials, i.e., one may use it either in the form `a^n` or in functional notation `_power(a,n)`.

`_subtract(a, b)`

This method overloads the function `_subtract` for polynomials, i.e., one may use it either in the form `a - b` or in functional notation `_subtract(a, b)`.

`content(a)`

### Note

This method only exists if `R` is a domain of category `Cat::GcdDomain`.

`D(a)`

`D(l, a)`

`Dpoly(a)`

`Dpoly(l, a)`

`Dpoly(l,a)` computes the partial derivative of `a` with respect to `l`. For details see `polylib::Dpoly`.

This method overloads the function `polylib::Dpoly` for polynomials.

`decompose(a, <var>)`

If `a` is a polynomial in only one variable, the second argument is not necessary.

This method overloads the function `polylib::decompose` for polynomials.

`diff(a, varseq)`

If `varseq` is an empty sequence, `a` is returned unchanged.

If in `varseq` an expression occurs which is not a variable of `a`, the zero polynomial is returned.

This method overloads the function `diff` for polynomials.

`dimension(ais, <ord>)`

`dimension(ais, <ord>)`

This method is merely an interface for the function `groebner::dimension`.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field` and `Vars` is not the empty list.

```divide(a, b, <Quo | Rem | Exact>)```

```divide(a, b, var, <Quo | Rem | Exact>)```

If no option is given, the quotient `s` and the remainder `r` are computed such that ```a = s*b + r``` and the degree of `r` in the relevant indeterminate is smaller than that of `b`. The sequence consisting of `s, r` is returned, otherwise `FAIL`.

If the option `Quo` is given, only the quotient `s` is returned.

If the option `Rem` is given, only the remainder `r` is returned.

If the option `Exact` is given, only the quotient `s` is returned, in case the remainder is zero, otherwise `FAIL`.

`divide(a,b,Exact)` divides the multivariate polynomial `a` by `b`. If `a` cannot be divided by `b`, the method returns `FAIL`.

This method overloads the function `divide` for polynomials.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field` and either this domain is of category `Cat::UnivariatePolynomial(R)` or `R` has characteristic zero (`R::characteristic = 0`). If the first pair of conditions is true then the first call is valid otherwise the second one.

`evalp(a, var = e)`

This method overloads the function `evalp` for polynomials.

`factor(a)`

This method overloads the function `factor` for polynomials.

### Note

This method only exists if `R` is a domain of category `Cat::Field` or if `R` is the domain `Dom::Integer`.

```func_call(a, e1, …, en, <Expr>)```

```func_call(a, e1, …, en, <Expr>)```

```func_call(a, e1, …, en, <Expr>)```

`a(e1,...,en)` applies the sequence `e1,...,en` of either elements of this domain or elements of `R` with respect to `Vars` (where `n` is the number of variables) to the polynomial `a`. An element of this domain or an element of the coefficient ring respectively is returned.

`a(e1,...,en, Expr)` applies the sequence of expressions or of elements of this domain or of elements of `R` to the polynomial `a`. With this call `a` is first converted into an expression. Afterwards `e1,...,en` is substituted into this expression with respect to `Vars`. The return value may be any object.

The number of variables must be equal to the number of applied expressions.

### Note

This method only exists if `Vars` has at least one indeterminate.

`gcd(a, b, …)`

This method overloads the function `gcd` for polynomials.

### Note

This method only exists if `R` is a domain of category `Cat::GcdDomain`.

`gcdex(a, b)`

This method overloads the function `gcdex` for polynomials. Especially, it only works for coefficient rings described there.

### Note

This method only exists if `R` is a domain of category `Cat::GcdDomain`.

```groebner(ais, <ord>, <Reorder>)```

```groebner(ais, <ord>, <Reorder>)```

If the option `Reorder` is given, the lexicographical order of variables may change to another one that is likely to decrease the running time.

### Note

Note that this may also cause a change of the returned list, which may now have polynomials over the same coefficient ring `R` but with a possibly re-ordered variable list. Thus, it may contain elements not belonging to this domain.

This method is merely an interface for the function `groebner::gbasis`.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field`, and `Vars` is not the empty list.

`int(a, <x>)`

```int(a, <x = x0 .. x1>)```

`int(a,x=x0..x1)` returns the definite integral or `FAIL`, if the result is not an element of this domain or an element of a polynomial domain over `Dom::Fraction(R)`.

This method overloads the function `int` for polynomials.

`intmult(a, z)`

This method is more efficient than using polynomial multiplication and is, e.g., necessary for the method `"Dpoly"`.

`isone(a)`

### Note

The result can only be valid if the coefficients of `a` are in normal form (i.e., if zero has a unique representation in `R`). Thus, `R` should have at least `Ax::normalRep`.

`iszero(a)`

### Note

The result can only be valid, if the coefficients of `a` are in normal form (i.e., if zero has a unique representation in `R`). Thus, the coefficient ring `R` should have at least `Ax::normalRep`.

`lcm(a, b, …)`

This method overloads the function `lcm` for polynomials.

### Note

This method only exists if `R` is a domain of category `Cat::GcdDomain`.

`makeIntegral(a)`

### Note

This method only exists if `R` is a domain of category `Cat::GcdDomain` and `R` has the method `"denom"`.

`monic(a)`

The zero polynomial returns itself.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field`.

```normalForm(a, ais, <ord>)```

```normalForm(a, ais, <ord>)```

This method is merely an interface for the function `groebner::normalf`.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field`, and `Vars` is not the empty list.

`pdioe(a, b, c)`

This method overloads the function `solvelib::pdioe`.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field` and `Vars` consists of a single variable.

```pdivide(a, b, <Quo | Rem>)```

If the option `Quo` is given, only the pseudo-quotient `q` is returned.

If the option `Rem` is given, only the pseudo-remainder `r` is returned.

This method overloads the function `pdivide` for polynomials.

### Note

This method only exists if `Vars` consists of a single variable.

`pquo(a, b)`

### Note

This method only exists if `Vars` consists of a single variable.

`prem(a, b)`

### Note

This method only exists if `Vars` consists of a single variable.

`random()`

With every call the global variable `SEED` is changed by a call of `random()`. Thus it is hard to create the same random sequence twice, see `random`.

If the parameter `Vars` is the empty list, first a list of 1 to 4 variables is generated randomly and the random polynomial is generated in these indeterminates afterwards.

This method overloads the function `polylib::randpoly` for polynomials.

```resultant(a, b, <var>)```

`resultant(a, b, var)` returns the resultant of `a` and `b` with respect to the variable `var`.

The value returned is a polynomial of this domain or `FAIL`.

This method overloads the function `polylib::resultant` for polynomials.

### Note

This method only exists if `R` has the method `"_divide"`.

`ringmult(a, c)`

```solve(a, <var>, <options>)```

```solve(a, <vars>, <options>)```

```solve(ais, <var>, <options>)```

```solve(ais, <vars>, <options>)```

`solve(ais, ..)` tries to find the zeros of the polynomial system `ais`. The exact behavior depends on further arguments.

For a detailed description of possible return values and options see function `solve`.

This method overloads the function `solve`.

```SPolynomial(a, b, <ord>)```

This method is merely an interface for the function `groebner::spoly`.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field`, and `Vars` is not the empty list.

`sqrfree(a)`

The `ai` are primitive and pairwise different square-free divisors of `a` and represented as elements of this domain. `u` is a unit of the coefficient ring and represented as an element of this domain. The `ei` are integers.

This method overloads the function `polylib::sqrfree` for polynomials.

### Note

This method only exists if `R` is a field, i.e., a domain of category `Cat::Field`, or if `R` is `Dom::Integer`.

#### Access Methods

`coeff(a)`

`coeff(a, var, n)`

`coeff(a, n)`

`coeff(a,var,n)` returns the coefficient of the term `var^n`—as an element of this domain if it is of category `Cat::Polynomial(R)`, or as an element of the coefficient ring `R` if it is of `Cat::UnivariatePolynomial(R)`, where `a` is considered as a univariate polynomial in a valid variable `var`.

`coeff(a,n)` returns the coefficient of the term `var^n`—as an element of this domain if it is of category `Cat::Polynomial(R)`, or as an element of the coefficient ring `R` if it is of `Cat::UnivariatePolynomial(R)`, where `a` is considered as a univariate polynomial in `var` and `var` is the main variable of `a`, i.e., the variable returned by `dom::mainvar(a)`.

This method overloads the function `coeff` for polynomials.

`degree(a)`

`degree(a, var)`

`degree(a, var)` returns the degree of `a` with respect to `var`.

The degree of the zero polynomial is defined as zero.

This method overloads the function `degree` for polynomials.

`degreevec(a, <ord>)`

The degree vector of the zero polynomial is defined as a list of zeros.

This method overloads the function `degreevec` for polynomials.

`euclideanDegree(a)`

### Note

This method only exists if `Vars` consists of a single variable.

`ground(a)`

This method overloads the function `ground` for polynomials.

`has(a, obj)`

This method overloads the function `has`.

`indets(<a>)`

In case `Vars` is not the empty list, `indets` can be called without argument.

Since this domain allows expressions as indeterminates, the returned set may contain expressions, too.

This method overloads the function `indets` for polynomials.

`lcoeff(a)`

```lcoeff(a, <vars>, <ord>)```

`lcoeff(a, ord)` returns the leading coefficient of `a` with respect to the monomial ordering `ord` as an element of the coefficient ring `R`.

`lcoeff(a, vars, ord)` returns the leading coefficient of `a` with respect to the variable list `vars` and the monomial ordering `ord` as an element of this domain if it is of category `Cat::Polynomial(R)`, or as an element of the coefficient ring `R` if it is of `Cat::UnivariatePolynomial(R)`.

• If `ord` is not explicitly given, the lexicographical order `LexOrder` will be used instead.

• It tries to convert `a` into a polynomial in the specified list of indeterminates `vars` over the coefficient ring `R` and returns `FAIL` if this conversions fails.

This method overloads the function `lcoeff` for polynomials.

`ldegree(a)`

`ldegree(a, x)`

`ldegree(a, x)` returns the lowest degree of the variable `x` in `a`.

This method overloads the function `ldegree` for polynomials.

`lmonomial(a, <ord>)`

```lmonomial(a, <vars>, <ord>, <Rem>)```

`lmonomial(a, vars, ord)` returns the leading monomial of `a` with respect to the variable list `vars` and the monomial ordering `ord` as an element of this domain.

• If `ord` is not explicitly given, the lexicographical order `LexOrder` will be used instead.

• It tries to convert `a` into a polynomial in the specified list of indeterminates `vars` over the coefficient ring `R` and returns `FAIL` if this conversions fails.

`lmonomial(a, vars, ord, Rem)` returns the list consisting of the leading monomial and the reductum of `a` with respect to the variable list `vars` and the monomial ordering `ord` as a list of elements of this domain.

• If `ord` is not explicitly given, the lexicographical order `LexOrder` will be used instead.

• It tries to convert `a` into a polynomial in the specified list of indeterminates `vars` over the coefficient ring `R` and returns `FAIL` if this conversions fails.

### Note

In MuPAD® a monomial denotes a coefficient together with a power product as, e.g., 3 x2.

This method overloads the function `lmonomial` for polynomials.

`lterm(a)`

```lterm(a, <vars>, <ord>)```

`lterm(a, ord)` returns the leading coefficient of `a` with respect to the monomial ordering `ord` as an element of this domain.

`lterm(a, vars, ord)` returns the leading term of `a` with respect to the variable list `vars` and the monomial ordering `ord` as an element of this domain.

• If `ord` is not explicitly given, the lexicographical order `LexOrder` will be used instead.

• It tries to convert `a` into a polynomial in the specified list of indeterminates `vars` over the coefficient ring `R` and returns `FAIL` if this conversions fails.

### Note

In MuPAD a term denotes a power product without a coefficient as, e.g., x2y3z.

This method overloads the function `lterm` for polynomials.

`mainvar(<a>)`

If `Vars` is not the empty list, `mainvar` can be called without argument.

```mapcoeffs(a, f, <e1, …>)```

This method overloads the function `mapcoeffs` for polynomials.

`multcoeffs(a, c)`

This method overloads the function `multcoeffs` for polynomials.

`nterms(a)`

This method overloads the function `nterms` for polynomials.

```nthcoeff(a, n, <ord>)```

If `n` is larger than the number of monomials of the polynomial then the function returns `FAIL`.

The zero polynomial has no monomials. `nthcoeff` returns `FAIL` when invoked on the zero polynomial.

This method overloads the function `nthcoeff` for polynomials.

```nthmonomial(a, n, <ord>)```

If `n` is larger than the number of monomials of the polynomial then the function returns `FAIL`.

The zero polynomial has no monomials. `nthmonomial` returns `FAIL` for the zero polynomial.

This method overloads the function `nthmonomial` for polynomials.

```nthterm(a, n, <ord>)```

If `n` is larger than the number of monomials of the polynomial then the function returns `FAIL`.

The zero polynomial has no monomials. `nthterm` returns `FAIL` when called with the zero polynomial.

This method overloads the function `nthterm` for polynomials.

`orderedVariableList(<a>)`

In case `Vars` is not the empty list, `orderedVariableList` can be called without an argument.

`pivotSize(a)`

This method is called if this domain is used as the component ring of a matrix domain to perform Gaussian elimination.

`reductum(a, <ord>)`

`tcoeff(a, <ord>)`

This method overloads the function `tcoeff` for polynomials.

#### Conversion Methods

`convert(p)`

`expr(a)`

This method overloads the function `expr`.

`poly(a)`

This method overloads the function `poly`.

`TeXCoeff(c)`

`TeXident(var)`

`TeXTerm(t)`

#### Technical Methods

`adaptIndets(<a, b, …>)`

### Note

This method only exists if the parameter `Vars` is the empty list (`[]`).

`isNeg(a)`

`mult(a, b, …)`

`new(p)`

`new(lm)`

`new(lm, v)`

`dom(p)` creates an element of this domain from a polynomial or a polynomial expression `p` and returns that element. If this is not possible, an error message is given.

If `Vars` is chosen as the empty list (`[]`) then in creating new elements from a polynomial or polynomial expression the function `indets` is first called to get the identifiers. Afterwards the element is created with this list of identifiers. For creating an element from a constant the dummy variable `_dummy` is introduced. The drawback of this approach is that two mathematically equal polynomials may have variable lists which differ by the dummy variable.

`dom(lm)` creates, if `Vars` is not the empty list `[]`, a polynomial from the list `lm` of the form `[[c1, [e11,... e1n]],... [cm,[em1,... emn]]]` where the `ci` are coefficients and the `eij` are the exponents with respect to `Vars`. For a univariate polynomial this list can be simplified to `[[c1,e1],... [cm,em]]`.

`dom(lm,v)` creates, if `Vars = []`, a polynomial from the list `lm` of the form ```[[c1, [e11,... e1n]],... [cm,[em1,... emn]]]``` where the `ci` are coefficients and the `eij` are the exponents with respect to `v`. For a univariate polynomial this list can be simplified to `[[c1,e1],... [cm,em]]`. The list of indeterminates `v` must contain valid indeterminates.

`plus(a, b, …)`

`print(a)`

This method overloads the function `print`.

`printMonomial(c, d, v)`

`printTerm(d)`

`printTerm(d, v)`

`printTerm(d,v)` returns an ordered sequence of the indeterminates together with their powers as given in the variable list `v` and the degree vector `d` respectively.

Note that this call is only valid if `nops(v)=nops(d)`.

`Rep(a)`

`sign(a)`

Note: this method does not have the meaning of a mathematical sign function!