Bill Page <bill.p...@newsynthesis.org> writes:

> On Thu, Aug 27, 2009 at 8:34 AM, MaxTheMouse wrote:
>>
>> This is a known problem. The patch at
>> http://trac.sagemath.org/sage_trac/ticket/6318
>> should fix this.
>>
>> sage: expr=x+1
>> sage: maxima(expr)
>> x+1
>> sage: fricas(expr)
>> x + 1
>>
>> I am using fricas 1.0.7 (
>> http://trac.sagemath.org/sage_trac/ticket/6517
>> ) with the included ecl (also works with the updated ecl that is
>> coming). It would be great if someone could review these two
>> tickets.
>>
>
> Thanks! I will install and look at both of these ASAP.

I just tried it (with external FriCAS) and it seems to work ok.  It
might make sense to expand FriCASElement a little.  Currently we have:

        P = self._check_valid()
        name = str(self)
        if name == 'Integer':
            from sage.rings.all import ZZ
            return ZZ
        elif name == 'DoubleFloat':
            from sage.rings.all import RDF
            return RDF
        elif name.startswith('Fraction('):
            name = name.lstrip('Fraction(')
            name = name.rstrip(')')
            return P(name)._sage_domain().fraction_field()

        raise NotImplementedError

Types that often occur in FriCAS, might have an equivalent in sage, and
come to my mind right now are:

Polynomial(YourFavoriteRing)           [polynomials with arbitrary many 
variables]
Expression(Integer)                    [probably SymbolicRing]
PrimeField(yourFavouritePrime)         [probably Integers(yourFavouritePrime)]
IntegerMod(yourFavouriteNaturalNumber) [probably 
Integers(yourFavouriteNaturalNumber)]
AlgebraicNumber                        [probably QQbar]
Float                                  [RR with given precision]
Complex(YourFavoriteCommutativeRing)   [no idea]

some more information, in the hope it's helpful:

if you have an element p in Polynomial R or Expression Integer,
variables(p) gives you a list of variables.

The following parses a polynomial in FriCAS:

[[leadingCoefficient m, listOfTerms degree m] for m in monomials p]

digits() gives you the current precision used in FriCAS -- currently,
the precision is not stored together with the number.

Martin

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to