Changes between Version 5 and Version 75 of Ticket #21413


Ignore:
Timestamp:
10/07/19 15:56:34 (2 years ago)
Author:
caruso
Comment:

See the description of the ticket for a small tutorial showing the main functionalities provided by this ticket.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21413

    • Property Cc nthiery SimonKing saraedum added
    • Property Dependencies changed from to #26105
    • Property Keywords padicBordeaux added
    • Property Commit changed from 036fb2a439cd9ee534d8e9489da02a3dde2452ea to 8acb01923a727fa5031d67082727d95cefb6916a
  • Ticket #21413 – Description

    v5 v75  
    1 Sage actually provides a rich framework for dealing with all classical algebraic structures: rings, fields, algebras, etc.
     1Sage provides a rich framework for dealing with all classical algebraic structures: rings, fields, algebras, etc.
    22Nevertheless, given (for instance) two fields K and L with K \subset L, it is not possible to build the extension L/K as a Sage object. However one can easily imagine methods related to this extension (e.g. `degree`, `discriminant`, `normal_basis`, `decompose_on_basis`, etc.)
    33
     
    55[https://gist.github.com/defeo/cabab27ea93aeb9e0deb0ba8c5bc745b here].
    66
    7 This ticket implements very generic classes for ring extensions. Other more specific classes (e.g. for field extensions or even finite field extensions) are coming soon...
     7This ticket implements a generic class for ring extensions, and more specific classes for finite free ring extensions (as finite degree field extensions).
     8
     9Below is a small tutorial extracted from the documentation:
     10
     11{{{
     12Extension of rings.
     13
     14Sage offers the possibility to work with ring extensions `L/K` as
     15actual parents and perform meaningful operations on them and their
     16elements.
     17
     18The simplest way to build an extension is to use the method
     19:meth:`sage.rings.ring.CommutativeRing.over` on the top ring,
     20that is `L`.
     21For example, the following line constructs the extension of
     22finite fields `\mathbf{F}_{5^4}/\mathbf{F}_{5^2}`::
     23
     24    sage: GF(5^4).over(GF(5^2))
     25    Field in z4 with defining polynomial x^2 + (4*z2 + 3)*x + z2 over its base
     26
     27By default, Sage reuses the canonical generator of the top ring
     28(here `z_4 \in \mathbf{F}_{5^4}`), together with its name. However,
     29the user can customize them by passing in appropriate arguments::
     30
     31    sage: F = GF(5^2)
     32    sage: k = GF(5^4)
     33    sage: z4 = k.gen()
     34    sage: K.<a> = k.over(F, gen = 1-z4)
     35    sage: K
     36    Field in a with defining polynomial x^2 + z2*x + 4 over its base
     37
     38The base of the extension is available via the method :meth:`base` (or
     39equivalently :meth:`base_ring`)::
     40
     41    sage: K.base()
     42    Finite Field in z2 of size 5^2
     43
     44It also possible to building an extension on top of another extension,
     45obtaining this way a tower of extensions::
     46
     47    sage: L.<b> = GF(5^8).over(K)
     48    sage: L
     49    Field in b with defining polynomial x^2 + (4*z2 + 3*a)*x + 1 - a over its base
     50    sage: L.base()
     51    Field in a with defining polynomial x^2 + z2*x + 4 over its base
     52    sage: L.base().base()
     53    Finite Field in z2 of size 5^2
     54
     55The method :meth:`bases` gives access to the complete list of rings in
     56a tower::
     57
     58    sage: L.bases()
     59    [Field in b with defining polynomial x^2 + (4*z2 + 3*a)*x + 1 - a over its base,
     60     Field in a with defining polynomial x^2 + z2*x + 4 over its base,
     61     Finite Field in z2 of size 5^2]
     62
     63Once we have constructed an extension (or a tower of extensions), we
     64have interesting methods attached to it. As a basic example, one can
     65compute a basis of the top ring over any base in the tower::
     66
     67    sage: L.basis_over(K)
     68    [1, b]
     69    sage: L.basis_over(F)
     70    [1, a, b, a*b]
     71
     72When the base is omitted, the default is the natural base of the extension::
     73
     74    sage: L.basis_over()
     75    [1, b]
     76
     77The method :meth:`sage.rings.ring_extension_element.RingExtensionWithBasis.vector`
     78computes the coordinates of an element according to the above basis::
     79
     80    sage: u = a + 2*b + 3*a*b
     81    sage: u.vector()   # over K
     82    (a, 2 + 3*a)
     83    sage: u.vector(F)
     84    (0, 1, 2, 3)
     85
     86One can also compute traces and norms with respect to any base of the tower::
     87
     88    sage: u.trace()           # over K
     89    (2*z2 + 1) + (2*z2 + 1)*a
     90    sage: u.trace(F)
     91    z2 + 1
     92    sage: u.trace().trace()   # over K, then over F
     93    z2 + 1
     94
     95    sage: u.norm()            # over K
     96    (z2 + 1) + (4*z2 + 2)*a
     97    sage: u.norm(F)
     98    2*z2 + 2
     99
     100And minimal polynomials::
     101
     102    sage: u.minpoly()
     103    x^2 + ((3*z2 + 4) + (3*z2 + 4)*a)*x + (z2 + 1) + (4*z2 + 2)*a
     104    sage: u.minpoly(F)
     105    x^4 + (4*z2 + 4)*x^3 + x^2 + (z2 + 1)*x + 2*z2 + 2
     106}}}