# Ticket #3835: trac_3835-algebraic_closure.patch

File trac_3835-algebraic_closure.patch, 4.5 KB (added by cremona, 12 years ago)

Applies to 4.1.1

• ## sage/rings/complex_field.py

```# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1251664397 -3600
# Node ID df1c71a8d73a14131da533285f3565db5f8050e5
# Parent  684eea91ff224e5bc6259ca19f1576c4c082b9d3
#3835: Implement algebraic_closure() function for fields

diff -r 684eea91ff22 -r df1c71a8d73a sage/rings/complex_field.py```
 a def scientific_notation(self, status=None): return self._real_field().scientific_notation(status) def algebraic_closure(self): """ Return the algebraic closure of self (which is itself). EXAMPLES:: sage: CC Complex Field with 53 bits of precision sage: CC.algebraic_closure() Complex Field with 53 bits of precision sage: CC = ComplexField(1000) sage: CC.algebraic_closure() is CC True """ return self
• ## sage/rings/number_field/number_field.py

`diff -r 684eea91ff22 -r df1c71a8d73a sage/rings/number_field/number_field.py`
 a else: return embedding(self.gen()) def algebraic_closure(self): """ Return the algebraic closure of self (which is QQbar). EXAMPLES:: sage: K. = QuadraticField(-1) sage: K.algebraic_closure() Algebraic Field sage: K. = NumberField(x^3-2) sage: K.algebraic_closure() Algebraic Field sage: K = CyclotomicField(23) sage: K.algebraic_closure() Algebraic Field """ return sage.rings.all.QQbar def latex_variable_name(self, name=None): """ Return the latex representation of the variable name for this
• ## sage/rings/rational_field.py

`diff -r 684eea91ff22 -r df1c71a8d73a sage/rings/rational_field.py`
 a from sage.rings.number_field.all import NumberField return NumberField(poly, names=names, check=check, embedding=embedding) def algebraic_closure(self): """ Return the algebraic closure of self (which is QQbar). EXAMPLES:: sage: QQ.algebraic_closure() Algebraic Field """ from sage.rings.all import QQbar return QQbar def order(self): """ EXAMPLES::
• ## sage/rings/ring.pyx

`diff -r 684eea91ff22 -r df1c71a8d73a sage/rings/ring.pyx`
 a import sage.rings.finite_field return sage.rings.finite_field.FiniteField(self.characteristic()) def algebraic_closure(self): """ Return the algebraic closure of self. .. note:: This is only implemented for certain classes of field. EXAMPLES:: sage: K = PolynomialRing(QQ,'x').fraction_field(); K Fraction Field of Univariate Polynomial Ring in x over Rational Field sage: K.algebraic_closure() Traceback (most recent call last): ... NotImplementedError: Algebraic closures of general fields not implemented. """ raise NotImplementedError, "Algebraic closures of general fields not implemented." cdef class FiniteFieldIterator: cdef object iter cdef FiniteField parent """ return self._factory_data[0].reduce_data(self) def algebraic_closure(self): """ Return the algebraic closure of self (not implemented). .. note:: This is not yet implemented for finite fields. EXAMPLES:: sage: GF(5).algebraic_closure() Traceback (most recent call last): ... NotImplementedError: Algebraic closures of finite fields not implemented. """ raise NotImplementedError, "Algebraic closures of finite fields not implemented." def unpickle_FiniteField_ext(_type, order, variable_name, modulus, kwargs): return _type(order, variable_name, modulus, **kwargs)