� ɍ�Xc @ s� d d l Te d � Z e d � Z e d � Z d d l Td d l m Z d d l m Z d d l Td e f d � � YZ d e f d � � YZ d e e f d � � YZ d e d � Z d S( i����( t *i i i ( t FinitelyGeneratedMatrixGroup_gap( t ParentLibGAPt MatrixGroup_subgroupc B s e Z d Z d � Z d � Z RS( s� This class can be used to create subgroups of matrix_groups beeing generated by a finite list of generators in the ambient group. It is an analogy to the PermutationGroup_subgroup class It can be used in cases of matrix groups which don't pocess a subgroup attribute. If you don't see this well formatted type sage: print MatrixGroup_subgroup.__doc__ This class has two methods overwriting the corresponding methods of FinitelyGeneratedMatrixGroup_gap class. - "__init__": to register the information corresponding to the ambient group - "_repr_: to print a representing string containing the ambient group INPUT (to the constructor): - "ambient": the matrix group for which the subgroup shoul be craeted - "generators": list of elements in the ambient group generating the subgroup to be defined EXAMPLE: sage: UCF = UniversalCyclotomicField() sage: G = GL(2, UCF) sage: M = matrix( UCF, [[1, E(12)], [0,-1]] ); M [ 1 -E(12)^7] [ 0 -1] sage: S = G.subgroup([M]) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ....... AttributeError: 'LinearMatrixGroup_generic_with_category' object has no attribute 'subgroup' sage: sage: from lib.local_matrix_group import * sage: S = MatrixGroup_subgroup(G, [M]) sage: S Subgroup of General Linear Group of degree 2 over Universal Cyclotomic Field generated by ([ 1 -E(12)^7] [ 0 -1],) sage: TESTS: sage: UCF = UniversalCyclotomicField() sage: G = GL(2, UCF) sage: M = matrix( UCF, [[1, E(12)], [0,-1]] ) sage: S = MatrixGroup_subgroup(G, [M]) sage: TestSuite(S).run() AUTHOR - Sebastian Oehms, Okt. 2016 c C s� x- | D]% } | | k r t d | � � q q Wg | D] } t | � ^ q7 } t j | � } | j � } | j � } t j | | | | � | | _ d S( s� Python constructor. for more information type sage: print MatrixGroup_subgroup.__doc__ AUTHOR - Sebastian Oehms, Sept. 2016 s Generator %s is not in the groupN( t ValueErrort libgapt Groupt base_ringt degreeR t __init__t _ambient( t selft ambientt generatorst gt matrix_gent gap_genst gap_groupR R ( ( s lib/local_matrix_group.pyR o s c C s d | j | j � f S( s[ Return a string representation If you don't see this well formatted type sage: print MatrixGroup_subgroup._repr_.__doc__ OUTPUT: String decribing self TESTS: sage: UCF = UniversalCyclotomicField() sage: G = GL(2, UCF) sage: M = matrix( UCF, [[1, E(12)], [0,-1]] ) sage: S = MatrixGroup_subgroup(G, [M]) sage: S Subgroup of General Linear Group of degree 2 over Universal Cyclotomic Field generated by ([ 1 -E(12)^7] [ 0 -1],) sage: s Subgroup of %s generated by: %s( R t gens( R ( ( s lib/local_matrix_group.pyt _repr_� s ( t __name__t __module__t __doc__R R ( ( ( s lib/local_matrix_group.pyR 4 s 9 t local_UnitaryMatrixGroup_genericc B s\ e Z d Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s� This class is an extension of the sage class UnitaryMatrixGroup_generic If you don't see this well formatted type sage: print local_UnitaryMatrixGroup_generic.__doc__ This class contains the following additional methods - _conjugate - _adjoined - subgroup - invariant_bilinear_form / invariant_form Furthermore the original method - _check_matrix has been overwritten since the original one does not behave correctly in the case of finite fields EXAMPLES: See the method documentation. For instance, type: sage: print local_UnitaryMatrixGroup_generic.subgroup.__doc__ sage: print local_UnitaryMatrixGroup_generic.invariant_bilinea_form.__doc__ TESTS: sage: G34 = GU(3,4) sage: TestSuite(G33).run() sage: UCF = UniversalCyclotomicField() sage: G3UCF = GU(3, UCF) sage: TestSuite(G3UCF).run() sage: h=matrix(UCF, 3,3,[[0,0,1],[0,1,0],[1,0,0]] ) sage: G3h = GU(3, UCF, hermitian_form=h) sage: TestSuite(G3h).run() AUTHOR - Sebastian Oehms, Sept. 2016 c C sT t | t � rA y t j | | � } WqP t | | � } qP Xn t | | � } | S( sM Return the subgroup generated by the given generators If you don't see this well formatted type sage: print local_UnitaryMatrixGroup_generic.subgroup.__doc__ In case where self is an instance of ParentLibGAP this method is identical to the corresponding method of that class. In all other cases an instance of the class MatrixGroup_subgroup is returned INPUT: - ``generators`` -- a list/tuple/iterable of group elements of self OUTPUT: The subgroup generated by ``generators`` as an in instance of - FinitelyGeneratedMatrixGroup_gap if self is an instance of ParentLibGAP - MatrixGroup_subgroup elsewise EAMPLE: sage: from lib.local_matrix_group import * sage: UCF = UniversalCyclotomicField() sage: M = matrix( UCF, [[0, 1], [1,0]] ) sage: GU2=GU(2,UCF, hermitian_form=M); GU2 General Unitary Group of degree 2 over Universal Cyclotomic Field with respect to hermitian form [0 1] [1 0] sage: S = GU2.subgroup( [M] ); S Subgroup of General Unitary Group of degree 2 over Universal Cyclotomic Field with respect to hermitian form [0 1] [1 0] generated by ([0 1] [1 0],) sage: isinstance( GU3, ParentLibGAP) False sage: isinstance( S, ParentLibGAP) True sage: isinstance( S, MatrixGroup_subgroup ) True sage: TESTS: see the tests for the class AUTHOR: - Sebastian Oehms, Sept. 2016 ( t isinstanceR t subgroupR ( R R t SubGroup( ( s lib/local_matrix_group.pyR � s 6c C s | | _ d S( sd This method registers the hermitian form to which should be kept invariant be self N( t _hermitian_form_( R t hermitian_form( ( s lib/local_matrix_group.pyt __set_hermitian_form__ s c C s� | j d k r | j S| j � t k rq y | j � j � d j � } Wq� t k rm | j � j � } q� Xn t t t t g � } | j � | S( s Return the sesquilinear form preserved by the unitary group. If you don't see this well formatted type sage: print local_UnitaryMatrixGroup_generic.invariant_bilinear_form.__doc__ If a hermitian_form has been set explicitely by the method __set_hermitian_form__ it will be returned. Elsewise the gap function "InvariantSesquilinearForm" is used. Compare the corresponding methods with respect to the orthogonal groups OUTPUT: the hermitian form as a matrix with entries in the base_ring EXAMPLES: sage: GU25 = GU(2,5) sage: GU52.invariant_bilinear_form() [0 0 0 0 1] [0 0 0 1 0] [0 0 1 0 0] [0 1 0 0 0] [1 0 0 0 0] sage: GU3Q = GU(3,QQ) sage: GU3Q.invariant_bilinear_form() [1 0 0] [0 1 0] [0 0 1] TESTS: see the tests for the class AUTHOR - Sebastian Oehms, Sept. 2016 t matrixN( R t NoneR t _sage_const_1t gapt InvariantSesquilinearFormR t AttributeErrort onet set_immutable( R t m( ( s lib/local_matrix_group.pyt invariant_bilinear_form% s * c C s | j � S( sV Return the sesquilinear form preserved by the unitary group. Compare the corresponding methods with respect to the symplectic groups. It is identical to invariant_bilinear_form (duplicate names in sage). For more information type sage: print local_UnitaryMatrixGroup_generic.invariant_bilinear_form.__doc__ ( R'