Hi Andrew!
On 10 Okt., 16:58, andrew ewart <[email protected]> wrote:
> hmm sage doesnt seem to recognise the Im() command
How do you define your polynomials? Are you sure that you *do* define
polynomials?
Examples:
1. This is a polynomial:
sage: R.<x,y> = QQ[]
sage: p = x^2+3*x*y+y^3
sage: p.lm()
y^3
sage: type(p)
<type
'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
2. This is not a polynomial (but a symbolic expression):
sage: var('x y')
(x, y)
sage: p = x^2+3*x*y+y^3
sage: p.lm()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
...
AttributeError: 'sage.symbolic.expression.Expression' object has no
attribute 'lm'
sage: type(p)
<type 'sage.symbolic.expression.Expression'>
3. I just noticed that unfortunately there exists at least one sort of
polynomials in Sage that does not have "lm":
sage: R.<x> = ZZ[]
sage: x.lm()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
...
AttributeError:
'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'
object has no attribute 'lm'
%%%%%%%%%%%%%%
The latter is rather unfortunate. I consider it a bug that the
different polynomial classes in Sage do not have the same method names
for the same functionality. But if you had worked with symbolic
expressions then you should better switch to polynomials: Symbolic
expressions are not made for Gröbner theory stuff.
Regards,
Simon
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org