[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [DistributedMultivariatePolynomial] (new)

From: hemmecke
Subject: [Axiom-developer] [DistributedMultivariatePolynomial] (new)
Date: Tue, 21 Feb 2006 04:56:30 -0600

The use of
R := Expression Integer
as the coefficient domain in
P := DistributedMultivariatePolynomial([x,y], R)
might lead to unexpected results due to the fact that the domain $R$ can 
contain arbitrary expressions (including the variable $x$).
Take for example.
a: P := x
b: P := a/x
Although it might seem strange that the result is not equal to 1,
Axiom behaved perfectly the way you told it to.

If the interperter sees $a/x$, it knows the type of $a$ but not yet for $x$. So 
it looks for a function it can apply.
It finds that if x is coerced to $R$ (Expression Integer) than there is a 
function in $P$, namely::

       if R has Field then
        (p : %) / (r : R) == inv(r) * p

By the way, in Axiom Expression Integer is considered to be a Field.
R has Field

Thus $x$ is inverted (and now lies in $R$) and then multiplied with $a$.
There is no further simplification done.

The problematic thing is if the above expression ($a/x$) is not treated 
carefully enough.
For example, by construction it should by now be clear that it has degree 1.
degree b

And it should also be clear that the following two expressions result in 
different output.
They are even stored differently in the internal structure of $P$.
For the first expression, $x$ is converted to the indeterminate $x$ of the 
polynomial ring $P$.
The interpreter finds an appropriate function::

  *: (%, %) -> %

and applies it.

In the second case, it is explicitly said that $x$ has to be considered as an 
element of $R$.
The interpreter finds the function with a more appropriate signature, namely::

  *: (R, %) -> %

Be careful with something like that.
d: P := x + (x::R)*1
>From the above discussion it should be clear that this expression is that what 
>Axiom was told to do.

Now, a polynomial in $n$ variables is a function (with finite support) 
from the domain of exponents $E=N^n$ (where $N$ is the non-negative integers) 
to the domain $R$ of coefficients.

P = \bigoplus_{e \in E} R

With such an interpretation, $d$ has support 
(i.e. the set of elements $e \in E$ for which the coefficient of $d$ 
corresponding to $e$ is non-zero)
\{ (1,0), (0,0) \}
and is therefore **not** equal to the polynomial $2x$ which has support
\{ (1,0) \}.

I Axiom is asked to convert $d$ to an arbitrary expression (Expression Integer),
it will convert both summands of $d$ to $R$ and as such they are, of course, 

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]