You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This ticket replaces #2348 and #2367. The attached patch provides several new features related with number fields.
Firstly, the patch fixes a bug of the gap interface for number fields and their elements. The _gap_init_ method of number fields is now based on gap inline functions (thanks to Nathan Dunfield for that hint!):
sage: F=CyclotomicField(8)
sage: gap(QQ).name()
'$sage1'
sage: F._gap_init_()
'CallFuncList(function() local x,E; x:=Indeterminate($sage1,"x"); E:=AlgebraicExtension($sage1,x^4 + 1,"zeta8"); return E; end,[])'
sage: gap(F)
<algebraic extension over the Rationals of degree 4>
Note that the variable $sage1 represents gap(QQ) -- QQ is the base ring of F.
I also learned from Nathan Dunfield that gap(F) is cached. Hence, if p is an element of F then p.gap_init() may refer to gap(F).name(), which is $sage2:
Note that the generator of gap(F) got the same name 'zeta8' as the generator of F.
Another extension was needed in the _gap_init_ method of matrices. The problem is that [[elem1,elem2],[elem3,elem4]] is in general not a matrix; it has to be multiplied with One(field):
Note that !-1 means that the integer -1 is interpreted as element of a different field, namely of gap(F).
Secondly, the patch extends the method invariant_generators of MatrixGroup to the case of matrix groups over number fields. Fixing the gap interface for number fields suffices for defining matrix groups over number fields; but extending the method invariant_generators requires more effort. Now, the following computation works:
The various _gap_init_ methods (in matrix1.pyx, number_field_element.pyx, number_field.py, matrix_group.py and matrix_group_element.py) got doctests. Also, i added more doc tests to invariant_generators, based on examples of David Joyner.
This looks good too. Applies cleanly against 2.10.3.rc1. Passes sage -testall, except for the ones that fail without any patches (rings/polynomial/groebner_fan.py, plot/plot.py).
This ticket replaces #2348 and #2367. The attached patch provides several new features related with number fields.
Firstly, the patch fixes a bug of the gap interface for number fields and their elements. The
_gap_init_
method of number fields is now based on gap inline functions (thanks to Nathan Dunfield for that hint!):Note that the variable
$sage1
represents gap(QQ) -- QQ is the base ring of F.I also learned from Nathan Dunfield that gap(F) is cached. Hence, if p is an element of F then p.gap_init() may refer to gap(F).name(), which is
$sage2
:Note that the generator of gap(F) got the same name
'zeta8'
as the generator of F.Another extension was needed in the
_gap_init_
method of matrices. The problem is that[[elem1,elem2],[elem3,elem4]]
is in general not a matrix; it has to be multiplied with One(field):Now, one can compute with the gap matrices:
Note that
!-1
means that the integer -1 is interpreted as element of a different field, namely of gap(F).Secondly, the patch extends the method invariant_generators of MatrixGroup to the case of matrix groups over number fields. Fixing the gap interface for number fields suffices for defining matrix groups over number fields; but extending the method invariant_generators requires more effort. Now, the following computation works:
The various
_gap_init_
methods (in matrix1.pyx, number_field_element.pyx, number_field.py, matrix_group.py and matrix_group_element.py) got doctests. Also, i added more doc tests to invariant_generators, based on examples of David Joyner.CC: @wdjoyner
Component: group theory
Keywords: gap interface, matrix group
Issue created by migration from https://trac.sagemath.org/ticket/2395
The text was updated successfully, but these errors were encountered: