# Ticket #2348: numberfields_gap.2.patch

File numberfields_gap.2.patch, 2.3 KB (added by SimonKing, 14 years ago)

This may be close to a solution

• ## sage/rings/number_field/number_field.py

# HG changeset patch
# User Simon King <king@mathematik.uni-jena.de>
# Date 1204381413 -3600
# Node ID 12318d9a52fd76803eae3298f317f974a509ef69
# Parent  5db8b4f0c24b27fee4b5287154af7a7b374d4d34
Potential solution of the gap(Numberfield) problem

diff -r 5db8b4f0c24b -r 12318d9a52fd sage/rings/number_field/number_field.py
 a class NumberField_generic(number_field_b """ return 0 def _gap_init_(self): """ Create a gap object representing self and return its name """ if not self.is_absolute(): raise NotImplementedError, "Currently, only simple algebraic extensions are possible in gap" if self.__dict__.has_key('_gap_name_'): # if it was constructed before return self.__dict__['_gap_name_'] PR = sage.interfaces.gap.gap(sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing(self.base_field(),self.gen())) BF = sage.interfaces.gap.gap(self.base_field()) MP = sage.interfaces.gap.gap(self.polynomial()) OUT = BF.AlgebraicExtension(MP) self.__dict__['_gap_name_'] = OUT.name() return OUT.name() def class_group(self, proof=None, names='c'): r""" Return the class group of the ring of integers of this number field.
• ## sage/rings/number_field/number_field_element.pyx

diff -r 5db8b4f0c24b -r 12318d9a52fd sage/rings/number_field/number_field_element.pyx
 a cdef class NumberFieldElement(FieldEleme \zeta_{12}^{2} - \zeta_{12} - 1 """ return self.polynomial()._latex_(name=self.number_field().latex_variable_name()) def _gap_init_(self): """ Return gap string representation of self. """ if self.parent().__dict__.has_key('_gap_name_'): return self.__repr__() self.parent()._gap_init_() return self.__repr__() def _pari_(self, var='x'): raise NotImplementedError, "NumberFieldElement sub-classes must override _pari_"