Should a polynomial ring insert its variable names into the GAP interface?

3 views
Skip to first unread message

Simon King

unread,
Jul 7, 2010, 1:07:40 PM7/7/10
to sage-devel
Hi!

Define
sage: P.<t> = QQ[]

Currently, when you call gap(P) then a variable of name "t" will be
created in the GAP interface.
sage: gap(P)
PolynomialRing( Rationals, ["t"] )
sage: gap('t')
t

I wonder if this is a safe practice. However, it has the big advantage
that (cum grano salis, see below) for any element p of P, it is
possible to do gap(repr(p)).

What do you think:
1. Better safe than sorry, avoid to create vandalising variables in
GAP, and accept that then p._gap_init_() must do something more
complicated than repr(p).

Or

2. Feel free to introduce meaningful variables to GAP - if a user has
a variable t in Sage than (s)he is unlikely to use it in a different
meaning in GAP.

I should add that in some cases gap(repr(p)) wouldn't work anyway: If
the base ring F is a cyclotomic field then gap(F) should produce a
cyclotomic field in GAP (currently it doesn't), but GAP insists to
call the field generators E(...).
So, I am in favour of solution 1.

Cheers,
Simon
Reply all
Reply to author
Forward
0 new messages