Ticket #2348: numberfields_gap.patch

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

This solves only a part of the problem

  • sage/rings/number_field/number_field.py

    # HG changeset patch
    # User Simon King <king@mathematik.uni-jena.de>
    # Date 1204365654 -3600
    # Node ID 5cb96702e4dcdf63b63e2a0b187f93e5b01d9234
    # Parent  5db8b4f0c24b27fee4b5287154af7a7b374d4d34
    Adding a _gap_init_ method to NumberField_generic
    
    diff -r 5db8b4f0c24b -r 5cb96702e4dc sage/rings/number_field/number_field.py
    a b class NumberField_generic(number_field_b 
    636636            self.__latex_variable_name = latex_name
    637637        self.__polynomial = polynomial
    638638        self.__pari_bnf_certified = False
     639
     640    def _gap_init_(self):
     641        """
     642        Return a gap object or a string that can be understood by gap
     643        """
     644        PR = sage.interfaces.gap.gap(sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing(self.base_field(),self.gen()))
     645        BF = sage.interfaces.gap.gap(self.base_field())
     646        MP = sage.interfaces.gap.gap(self.polynomial())
     647        return BF.AlgebraicExtension(MP)
    639648
    640649    def _Hom_(self, codomain, cat=None):
    641650        """