#4126: [with patch; positive review] improve sage <--> magma interface for
number
fields
-------------------------+--------------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: new
Priority: minor | Milestone: sage-3.1.3
Component: interfaces | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by mabshoff):
The following two hunks
{{{
@@ -5300,6 +5301,14 @@
return NumberField_cyclotomic_v1, (self.__n,
self.variable_name())
def _magma_init_(self):
+ # TODO: I really don't like this on multiple levels.
+ # (1) it kills a global symbol self.gen()
+ # (2) it abuses how conversion works and throws in an extra
define.
+ # (3) a cyclo field in a funny generator wouldn't get converted
to
+ # one with the right name via this.
+ # (4) One should define _magma_coerce_ instead of _magma_init_
+ # in this case, probably.
+ # -- William
return 'CyclotomicField(%s);
%s:=CyclotomicField(%s).1;'%(self.__n, self.gen(), self.__n)
def _repr_(self):
}}}
and
{{{
@@ -5306,7 +5306,7 @@
# (2) it abuses how conversion works and throws in an extra
define.
# (3) a cyclo field in a funny generator wouldn't get converted
to
# one with the right name via this.
- # (4) One should define _magma_coerce_ instead of _magma_init_
+ # (4) One should define _magma_convert_ instead of _magma_init_
# in this case, probably.
# -- William
return 'CyclotomicField(%s);
%s:=CyclotomicField(%s).1;'%(self.__n, self.gen(), self.__n)
}}}
did not apply cleanly against my merge tree, so I committed them manually.
Patch is attached.
Cheers,
Michael
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4126#comment:8>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---