From ms8a017 at math.uni-hamburg.de Tue Dec 9 21:44:34 2003 From: ms8a017 at math.uni-hamburg.de (Hubert Kiechle) Date: Fri Apr 8 15:25:37 2005 Subject: [GAP Forum] InstallMethod Message-ID: Hi GAP-forum, I want to invert 2x2 matrices over a (finite) algebra with zero divisors. As there does not seem to be a method available, I tried to provide one, but the following file after *Read*ing into gap leads to the ERROR message below which seems cryptic to me. In fact, after *return*ing from the break loop *Inverse* works perfectly well. How can I get rid of the ERROR message? Why is there no method for *Inverse* in matrix rings over rings with zero divisors? ----- file ---- Inv22:=function(m) local u; if DimensionsMat(m)=[2,2] then u:=Determinant(m); if IsUnit(u) then return Inverse(u)*[[m[2][2],-m[1][2]],[-m[2][1],m[1][1]]]; else return fail; fi; else return fail; fi; end; InstallMethod( Inverse, "Inverse of 2x2 Matrix over any Ring", [IsMatrix and IsRingElementCollColl],Inv22); --------- Error, required filters [ "IS_LIST", "IS_DENSE_LIST", "IS_HOMOG_LIST", "IS_TABLE_LIST", "IsListOrCollection", "IsCollection", "IsExtAElement", "CategoryCollections(IsExtAElement)", "IsNearAdditiveElement", "CategoryCollections(IsNearAdditiveElement)", "CategoryCollections(CategoryCollections(IsNearAdditiveElement))", "IsNearAdditiveElementWithZero", "CategoryCollections(IsNearAdditiveElementWithZero)", "CategoryCollections(CategoryCollections(IsNearAdditiveElementWithZero))", "IsNearAdditiveElementWithInverse", "CategoryCollections(IsNearAdditiveElementWithInverse)", "CategoryCollections(CategoryCollections(IsNearAdditiveElementWithInverse))" , "IsAdditiveElement", "CategoryCollections(IsAdditiveElement)", "CategoryCollections(CategoryCollections(IsAdditiveElement))", "IsExtLElement", "CategoryCollections(IsExtLElement)", "CategoryCollections(CategoryCollections(IsExtLElement))", "IsExtRElement", "CategoryCollections(IsExtRElement)", "CategoryCollections(CategoryCollections(IsExtRElement))", "IsMultiplicativeElement", "CategoryCollections(CategoryCollections(IsMultiplicativeElement))", "IsGeneralizedRowVector" ] for 1st argument do not match a declaration of InverseImmutable called from called from ( ) called from read-eval-loop Thanks for any help, Hubert * Priv. Doz. Dr. Hubert Kiechle * * * * Mathematisches Seminar * * Universität Hamburg * Outside of a dog, * Bundesstr. 55 * a book is man's best friend. * D-20146 Hamburg * Inside of a dog, * Germany * it is too dark to read. * * * Tel.: +49 40 42838 5186 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * http://www.math.uni-hamburg.de/home/kiechle/ From kohl at mathematik.uni-stuttgart.de Wed Dec 10 09:55:02 2003 From: kohl at mathematik.uni-stuttgart.de (Stefan Kohl) Date: Fri Apr 8 15:25:37 2005 Subject: [GAP Forum] InstallMethod References: Message-ID: <3FD6ED76.DD513B6F@mathematik.uni-stuttgart.de> Dear Forum, Hubert Kiechle wrote: > I want to invert 2x2 matrices over a (finite) algebra with zero > divisors. As there does not seem to be a method available, I tried to > provide one, but the following file > after *Read*ing into gap leads to the ERROR message below which seems > cryptic to me. In fact, after *return*ing from the break loop > *Inverse* works perfectly well. > > How can I get rid of the ERROR message? > Why is there no method for *Inverse* in matrix rings over rings with > zero divisors? > > ----- file ---- > Inv22:=function(m) > local u; > if DimensionsMat(m)=[2,2] then > u:=Determinant(m); > if IsUnit(u) then > return Inverse(u)*[[m[2][2],-m[1][2]],[-m[2][1],m[1][1]]]; > else > return fail; > fi; > else > return fail; > fi; > end; > > InstallMethod( Inverse, > "Inverse of 2x2 Matrix over any Ring", > [IsMatrix and IsRingElementCollColl],Inv22); > > --------- > Error, required filters [ "IS_LIST", "IS_DENSE_LIST", "IS_HOMOG_LIST", [ ... ] The reason for the error message you got is that `InstallMethod' checks whether the required filters of your method match the declaration of the attribute `InverseImmutable', for which `Inverse' is a synonym. You can find these declarations in lib/arith.gd: DeclareAttribute( "InverseImmutable", IsMultiplicativeElementWithInverse ); DeclareSynonymAttr( "Inverse", InverseImmutable ); In your case, the requirement `IsMatrix and IsRingElementCollColl' does not imply the filter `IsMultiplicativeElementWithInverse' (as there are also non-invertible matrices), although the attribute `InverseImmutable' is only declared for such `multiplicative elements with inverse'. You can circumvent these strict checks by using `InstallOtherMethod' instead of `InstallMethod'. In any case you should issue `TryNextMethod();' instead of returning `fail' in case your matrix is not 2x2 -- otherwise you likely break other functionality, in particular you might run into trouble when trying to invert matrices larger than 2x2 after your method installation. This will happen whenever the method selection ranks your method highest. You might also think about whether you want to get a mutable or an immutable result (see the reference manual for a description of mutability / immutability) -- in the former case you should install your method for `InverseMutable', and in the latter case you should return an immutable object. Hope this helps, Stefan Kohl From costanti at science.unitn.it Fri Dec 12 16:52:29 2003 From: costanti at science.unitn.it (Marco Costantini) Date: Fri Apr 8 15:25:37 2005 Subject: [GAP Forum] The GAP interface to the Singular system Message-ID: <1071247949.3fd9f24dcd3a8@www.unitn.it> Dear GAP Forum, With this message we would like to draw your attention to the new version of the GAP interface to the Singular system, which has just become available. Features of this interface include: * fast computation of Groebner bases, * computation of multivariate Gcd, * factorization of multivariate polynomials, * computation of invariant rings of finite groups. The interface can be downloaded from http://www-math.science.unitn.it/~costanti More information on Singular can be found on http://www.singular.uni-kl.de (where the system can also be downloaded for free). If you have any questions please feel free to contact us. Best wishes, Marco Costantini (costanti@science.unitn.it) Willem de Graaf (quagroup@hetnet.nl) From primoz.moravec at fmf.uni-lj.si Tue Dec 16 16:35:00 2003 From: primoz.moravec at fmf.uni-lj.si (Primoz Moravec) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Low index normal subgroups Message-ID: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Dear GAP Forum, what is the best way to compute normal subgroups of low index in a given finitely presented group? Best Regards, Primoz. ------------------------------------ Primoz Moravec Institute of mathematics, physics and mechanics Jadranska 19 SI-1000 Ljubljana Slovenia email: primoz.moravec@fmf.uni-lj.si ------------------------------------ From p.dobcsanyi at designtheory.org Wed Dec 17 11:06:49 2003 From: p.dobcsanyi at designtheory.org (Peter Dobcsanyi) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] 'Releases from DesignTheory.org' Message-ID: Release Announcements from DesignTheory.org =========================================== The EPSRC funded DesignTheory.org project, based at Queen Mary, University of London, is pleased to announce the public releases of its XML-format for block designs and its Design package for GAP. We expect these releases to be of interest to those working in combinatorial or statistical design theory, as well as those interested in the development of standard electronic formats for mathematical objects. 1) The External Representation of Block Designs v1.1, http://designtheory.org/library/extrep/ This is a platform independent XML-format for encoding block designs, and their combinatorial, group-theoretical and statistical properties. Comments, questions, bug reports --> extrep@designtheory.org 2) Design v1.0 Package for GAP v4.3, http://designtheory.org/software/gap_design/ This GAP v4.3 package is for the classification, partitioning and study of block designs (which include but are not restricted to t-designs). This package can also write and read block designs in our External Representation XML-format. Comments, questions, bug reports --> gap-design@designtheory.org Please feel free to forward this announcement to anyone you think may be interested. Enjoy, The Developers From costanti at science.unitn.it Wed Dec 17 14:44:49 2003 From: costanti at science.unitn.it (Marco Costantini) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Low index normal subgroups In-Reply-To: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> References: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Message-ID: <1071672289.3fe06be17b5a6@www.unitn.it> Dear Primoz and dear gap forum, Scrive Primoz Moravec : > what is the best way to compute normal subgroups of low index in a given > finitely presented group? (I don't know the best way but I can suggest a way to try.) Look at the functions in the manual in the paragraph Groups - Sets of Subgroups: maybe the functions MaximalNormalSubgroups or NormalSubgroups are what you need. Such functions may not terminate in the case that your group is not finite... in this case, and if it make sense for your problem, you can consider some finite quotient of your group, and calculate MaximalNormalSubgroups or NormalSubgroups in it. There are package to calculare the p-/nilpotent/polyciclic/solvable quotients of finitely presented groups (see the packages anupq, nq, etc.). the kind of quotient to calculate depends on your problem. If otherwise your finitely presented group G is finite, it could be better to convert it into a polycyclic or permutation group, for efficiency, before doing any other computation. Image(IsomorphismSpecialPcGroup(G)); (if G is solvable) Image(IsomorphismPermGroup(G)); (otherwise) Best Regards, Marco From hulpke at math.colostate.edu Wed Dec 17 22:58:47 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Low index normal subgroups In-Reply-To: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Message-ID: <200312172258.hBHMwlmp016877@schur.math.colostate.edu> Dear Gap Forum, Primoz Moravec asked: > what is the best way to compute normal subgroups of low index in a given > finitely presented group? As Marco costatini already pointed out, the methods will be quite different if you know that the group is finite (``finite'' here probably means: order <10^15 ). If the group is finite, the best approach is to convert to a permutation group or pc group and use for example `NormalSubgroups'. If the group is potentially infinite or very large, this might be impossible or infeasible. In this case I would do the following (assuming again that your ``small index'' is really small, say up to n=1000: Using the library of small groups of order <=n (these are the potential factor groups), determine - For all solvable groups of order <= n the orders of chief factors. You can use these as input to the solvable quotient algorithm to obtain a large finite solvable quotient of your group which has all solvable factor groups as factors. - For each nonsolvable group $G$ determine a series of subgroups U1>...>Uk such that the image of the action of G on the cosets of Ui is nonsolvable and that the action on the cosets of Uk is faithful (often only one subgroup suffices, but for groups such as 2.A6 you might want to take a subgroup of inder 6 for U1). Then using `LowIndexSubgroups' determine all subgroups of the finitely presented group of index $[G:U1]$. Check whether the action on the cosets is permutation isomorphic to the action of G on the cosets of U1 (for example using `TransitiveIdentification' if the index is <=30). If U\le F is such a subgroup with [F:U]=[G:U1] determine subgroups of index [U1:U2] in U by the low index algorithm. Again compare the types of factor groups. Iterate until Uk (if not ruled out). Most nonsolvable groups of large order have a small-degree permutation representation or a factror group with a low-degree permutation representation. Thus the second step of this program is probably comparatively little work. Best regards, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From jjoao at netcabo.pt Tue Dec 30 10:24:49 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute Message-ID: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Dear GAP Forum, I have defined an attribute (SemiDirectProductElmAction) for certain tuples (elements of a semidirect product semigroup being constructed) because I need to know this attribute to multiply elements of this new semigroup, but it is not stored when I do Setter(SemiDirectProductElmAction)(t, act); where "t" is the tuple and "act" an action. My question is: how can I store this attribute on each of these tuples? Thank you, Jose Morais From jjoao at netcabo.pt Tue Dec 30 10:53:38 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute Message-ID: <1072781653.4368.10.camel@a213-22-130-67.netcabo.pt> Dear GAP Forum, I have defined an attribute (SemiDirectProductElmAction) for certain tuples (elements of a semidirect product semigroup being constructed) because I need to know this attribute to multiply elements of this new semigroup, but it is not stored when I do Setter(SemiDirectProductElmAction)(t, act); where "t" is the tuple and "act" an action. My question is: how can I store this attribute on each of these tuples? Sorry for using the list's old email address, but I got an "Out of office" reply when sending to the new email address. Thank you, Jose Morais From hulpke at math.colostate.edu Wed Dec 31 00:07:49 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute In-Reply-To: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Message-ID: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Dear GAP Forum, Jose Morais asked: > I have defined an attribute (SemiDirectProductElmAction) for certain >tuples (elements of a semidirect product semigroup being constructed) >because I need to know this attribute to multiply elements of this new >semigroup, but it is not stored when I do Attributes are only stored if the representation is in `IsAttributeStoringRep'. Tuples are not in this representation and thus do not store attributes (which is the behaviour you observed). To get around the problem there are two ways: the first is to create your own tuples that use the `ComponentObject' representation and thus are able to store attributes. In your case however this looks like overkill. What I would do instead (and is the way similar situations are dealt with in the library) is to declare the attribute for the *family* of tuples (which is by default attribute storing): DeclareAttribute("MyAttribute",IsFamily); and set this attribute once you create your initial objects: ... # create generating tuples tups:=.... fam:=FamilyObj(tups[1]); SetMyAttribute(fam,actioninfo); In your multiplication routine (when you need the attribute value) you can then get it from the family: MyMultiplication:=function(a,b) local actioninfo; actioninfo:=MyAttribute(FamilyObj(a)); Setter(SemiDirectProductElmAction)(t, act); (You can see examples of such code in the library file `gprd.gi' that implements generic products for groups.) Best wishes and a Happy New Year, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From jjoao at netcabo.pt Wed Dec 31 10:47:32 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute In-Reply-To: <200312310007.hBV07nJT022376@schur.math.colostate.edu> References: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Message-ID: <1072867685.4360.20.camel@localhost.localdomain> Dear GAP Forum, Thank you for your reply to my question about a Tuple attribute. While I hadn't your answer, I implemented a new GAP object (Pair) which is in `IsAttributeStoringRep', but I am having difficulties in defining a method for the 'ONE' operation applicable to this new object. gap> p:=Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )); Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )) gap> Monoid(p); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 2nd choice method found for `ONE' on 1 arguments called from OneOp( elm ) called from One( Representative( M ) ) called from One( M ) called from called from called from ... So, I defined this method: InstallMethod( OneOp, "for pairs", true, [ IsPair ], 0, function( el ) return(Pair(One(el!.first), One(el!.second))); end ); but I get the error: Error, required filters [ "IsPair" ] for 1st argument do not match a declaration of ONE called from Looking then at the declaration of ONE I found: basicim.gd:210:DeclareOperation( "ONE", [ IsBasicImageEltRep ] ); I have this definition for pairs: BindGlobal( "PairsType", NewType( PairsFamily, IsPair and IsExtAElement and IsNearAdditiveElement and IsAdditiveElement and IsNearAdditiveElementWithZero and IsAdditiveElementWithZero and IsNearAdditiveElementWithInverse and IsAdditiveElementWithInverse and IsAdditivelyCommutativeElement and CanEasilySortElements and CanEasilySortElements and IsExtRElement and IsExtLElement and IsMultiplicativeElement and IsMultiplicativeElementWithOne and IsMultiplicativeElementWithZero and IsMultiplicativeElementWithInverse and IsAssociativeElement and IsAttributeStoringRep )); but if I add to these filters 'IsBasicImageEltRep', then, when I try to define a pair I get an error: gap> p:=Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )); Record: '.Word' must have an assigned value at return elt!.Word; called from Word( elt ) called from ( ) called from read-eval-loop Entering break read-eval-print loop ... My question is: how can I define a Pair in such a way that it becomes suitable for all the operations applicable to Tuples? Thank you for your attention and patience, Happy New Year, Jose Morais From jjoao at netcabo.pt Wed Dec 31 11:37:03 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute In-Reply-To: <200312310007.hBV07nJT022376@schur.math.colostate.edu> References: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Message-ID: <1072870659.4360.25.camel@localhost.localdomain> Dear GAP Forum, About my last question: My question is: how can I define a Pair in such a way that it becomes suitable for all the operations applicable to Tuples? I would like to tell you that I've solved the problem for the 'ONE' operation by defining the following method: InstallMethod( OneMutable, "for pairs", true, [ IsMultiplicativeElementWithOne and IsPair ], 0, function( el ) local m1, m2; return(Pair(One(el!.first), One(el!.second))); end ); Thank you for your attention and patience, Happy New Year, Jose Morais From hulpke at math.colostate.edu Wed Dec 31 19:18:46 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Fri Apr 8 15:25:38 2005 Subject: [GAP Forum] Tuple attribute In-Reply-To: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Message-ID: <200312311918.hBVJIkpQ023889@schur.math.colostate.edu> Dear GAP Forum, Jose Morais wrote: > While I hadn't your answer, I implemented a new GAP object (Pair) which > is in `IsAttributeStoringRep', but I am having difficulties in defining I still think that keeping tuples and storingthe attribute in the family is the cleaner and more efficient solution and will save you in the end a lot of time recoding methods for tuples. > My question is: how can I define a Pair in such a way that it becomes > suitable for all the operations applicable to Tuples? The easiest is probably to look at the code for tuples (in `tuples.g?') and duplicate what is done there. As it might be of interest anyhow, let me add a few remarks about the error you got: > InstallMethod( OneOp, "for pairs", true, [ IsPair ], 0, > > Error, required filters [ "IsPair" ] > for 1st argument do not match a declaration of ONE called from Method installations have to conform to the declaration of the operation, but one can skip this test by using `InstallOtherMethod' instead (I seem to recall that there was a similar question recently). Operations are typically declared in a `.gd' file, but an operation can be declared several times for different objects (for example the conjugacy classes of a group or of a character table), and one might have to find the right declaration. With `One' (and its derivatives) the situation is complicated further, in that this is an operation that the kernel must know about (for example for calculating x^0). The declaration therefore is a bit mor complicated. (The declaration in basicim.gd you found is a red herring and will only confuse things -- lets forget about it for the moment.) Most arithmetic operations (as also `One') are declared in `arith.gd'. (The comments in this file give much more detail than I can do here.) We find the following declaration: DeclareOperationKernel("OneMutable",[IsMultiplicativeElementWithOne],ONE); This means: The operation is initially created (under the name `ONE') in the kernel. (This is needed to have the kernel know about it. Typically operations that come from the kernel have a kernel name that is all upper case and then get declared with a ``proper'' library name.) In our case, `OneMutable' is the library name, but when you type it into GAP, you still see the kernel name lurking behind: gap> OneMutable; (There are other declarations in `arith.gd' (they have essentially to do with the fact that we might want to store the `One' of a group as an attribute and -- if the group elements are potentially mutable, as for example matrices are -- a stored one should be immutable. They all wrap around `OneMutable'.) `OneMutable' is declared for the category `IsMultiplicativeElementWithOne'. To be able to calculate `One' for your pairs, they have to be declared to be in this category as well. This must happen when you declare `IsPair', it is not sufficient that all pair objects you create are put in this Category. (As the installation only is given `IsPair', the method installation does not know about this fact. You could change the method installation to `IsPair and IsMultiplicativeElementWithOne', however. In your second mail you state that this worked. With this, however you might run into the same problem with other arithmetic operations.) > I have this definition for pairs: BindGlobal( "PairsType", NewType( PairsFamily, IsPair and IsExtAElement and IsNearAdditiveElement and IsAdditiveElement and IsNearAdditiveElementWithZero and IsAdditiveElementWithZero and IsNearAdditiveElementWithInverse and IsAdditiveElementWithInverse and IsAdditivelyCommutativeElement and CanEasilySortElements and CanEasilySortElements and IsExtRElement and IsExtLElement and IsMultiplicativeElement and IsMultiplicativeElementWithOne and IsMultiplicativeElementWithZero and IsMultiplicativeElementWithInverse and IsAssociativeElement and IsAttributeStoringRep )); This is the type, which your objects will get. Personally I would leave out declarations that are anyhow implied (IsMultiplicativeElementWithInverse implies IsMultiplicativeElementWithOne implies IsMultiplicativeElement implies IsAssociativeElement, for example) I also would try to start with only the categories you really need -- for monoid elements that would be: IsMultiplicativeElementWithOne (you might want to use IsMultiplicativeElementWithInverse instead, if you might want to generalize to groups or if some elements are invertible) IsPair, IsAttributeStoringRep, (I suppose `IsPair' implies IsComponentObject') and -- if you have an efficient comparison implemented (this filter essentially makes some methods available that rely on elememt comparison) CanEasilySortElements. I also would have `IsMultiplicativeElementWithInverse' and `IsAssociativeElement' to be implied by `IsPair'. (The reason for leaving out unnecessary declarations is that these might trigger methods for other kinds of objects which might assume further properties. The error you got after changing the declaration: > but if I add to these filters 'IsBasicImageEltRep', then, when I try to > define a pair I get an error: > Record: '.Word' must have an assigned value at is exactly of this kind -- what gets triggered is a `View' method for `IsBasicImageEltRep' that assumes that a !.Word component is stored in the object.) One last remark: If `IsPair' does not imply `IsMultiplicativeElement' and `IsAssociativeElement' by its declaration, I think you might end up that sets of pairs (your monoids) will not know automatically to be `IsMultiplicativeElementCollection' and `IsAssociativeElementCollection' and thus are not recognized to be semigroups or monoids though your objects all will multiply fine. Best wishes and a Happy New Year, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From ms8a017 at math.uni-hamburg.de Tue Dec 9 21:44:34 2003 From: ms8a017 at math.uni-hamburg.de (Hubert Kiechle) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] InstallMethod Message-ID: Hi GAP-forum, I want to invert 2x2 matrices over a (finite) algebra with zero divisors. As there does not seem to be a method available, I tried to provide one, but the following file after *Read*ing into gap leads to the ERROR message below which seems cryptic to me. In fact, after *return*ing from the break loop *Inverse* works perfectly well. How can I get rid of the ERROR message? Why is there no method for *Inverse* in matrix rings over rings with zero divisors? ----- file ---- Inv22:=function(m) local u; if DimensionsMat(m)=[2,2] then u:=Determinant(m); if IsUnit(u) then return Inverse(u)*[[m[2][2],-m[1][2]],[-m[2][1],m[1][1]]]; else return fail; fi; else return fail; fi; end; InstallMethod( Inverse, "Inverse of 2x2 Matrix over any Ring", [IsMatrix and IsRingElementCollColl],Inv22); --------- Error, required filters [ "IS_LIST", "IS_DENSE_LIST", "IS_HOMOG_LIST", "IS_TABLE_LIST", "IsListOrCollection", "IsCollection", "IsExtAElement", "CategoryCollections(IsExtAElement)", "IsNearAdditiveElement", "CategoryCollections(IsNearAdditiveElement)", "CategoryCollections(CategoryCollections(IsNearAdditiveElement))", "IsNearAdditiveElementWithZero", "CategoryCollections(IsNearAdditiveElementWithZero)", "CategoryCollections(CategoryCollections(IsNearAdditiveElementWithZero))", "IsNearAdditiveElementWithInverse", "CategoryCollections(IsNearAdditiveElementWithInverse)", "CategoryCollections(CategoryCollections(IsNearAdditiveElementWithInverse))" , "IsAdditiveElement", "CategoryCollections(IsAdditiveElement)", "CategoryCollections(CategoryCollections(IsAdditiveElement))", "IsExtLElement", "CategoryCollections(IsExtLElement)", "CategoryCollections(CategoryCollections(IsExtLElement))", "IsExtRElement", "CategoryCollections(IsExtRElement)", "CategoryCollections(CategoryCollections(IsExtRElement))", "IsMultiplicativeElement", "CategoryCollections(CategoryCollections(IsMultiplicativeElement))", "IsGeneralizedRowVector" ] for 1st argument do not match a declaration of InverseImmutable called from called from ( ) called from read-eval-loop Thanks for any help, Hubert * Priv. Doz. Dr. Hubert Kiechle * * * * Mathematisches Seminar * * Universität Hamburg * Outside of a dog, * Bundesstr. 55 * a book is man's best friend. * D-20146 Hamburg * Inside of a dog, * Germany * it is too dark to read. * * * Tel.: +49 40 42838 5186 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * http://www.math.uni-hamburg.de/home/kiechle/ From kohl at mathematik.uni-stuttgart.de Wed Dec 10 09:55:02 2003 From: kohl at mathematik.uni-stuttgart.de (Stefan Kohl) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] InstallMethod References: Message-ID: <3FD6ED76.DD513B6F@mathematik.uni-stuttgart.de> Dear Forum, Hubert Kiechle wrote: > I want to invert 2x2 matrices over a (finite) algebra with zero > divisors. As there does not seem to be a method available, I tried to > provide one, but the following file > after *Read*ing into gap leads to the ERROR message below which seems > cryptic to me. In fact, after *return*ing from the break loop > *Inverse* works perfectly well. > > How can I get rid of the ERROR message? > Why is there no method for *Inverse* in matrix rings over rings with > zero divisors? > > ----- file ---- > Inv22:=function(m) > local u; > if DimensionsMat(m)=[2,2] then > u:=Determinant(m); > if IsUnit(u) then > return Inverse(u)*[[m[2][2],-m[1][2]],[-m[2][1],m[1][1]]]; > else > return fail; > fi; > else > return fail; > fi; > end; > > InstallMethod( Inverse, > "Inverse of 2x2 Matrix over any Ring", > [IsMatrix and IsRingElementCollColl],Inv22); > > --------- > Error, required filters [ "IS_LIST", "IS_DENSE_LIST", "IS_HOMOG_LIST", [ ... ] The reason for the error message you got is that `InstallMethod' checks whether the required filters of your method match the declaration of the attribute `InverseImmutable', for which `Inverse' is a synonym. You can find these declarations in lib/arith.gd: DeclareAttribute( "InverseImmutable", IsMultiplicativeElementWithInverse ); DeclareSynonymAttr( "Inverse", InverseImmutable ); In your case, the requirement `IsMatrix and IsRingElementCollColl' does not imply the filter `IsMultiplicativeElementWithInverse' (as there are also non-invertible matrices), although the attribute `InverseImmutable' is only declared for such `multiplicative elements with inverse'. You can circumvent these strict checks by using `InstallOtherMethod' instead of `InstallMethod'. In any case you should issue `TryNextMethod();' instead of returning `fail' in case your matrix is not 2x2 -- otherwise you likely break other functionality, in particular you might run into trouble when trying to invert matrices larger than 2x2 after your method installation. This will happen whenever the method selection ranks your method highest. You might also think about whether you want to get a mutable or an immutable result (see the reference manual for a description of mutability / immutability) -- in the former case you should install your method for `InverseMutable', and in the latter case you should return an immutable object. Hope this helps, Stefan Kohl From costanti at science.unitn.it Fri Dec 12 16:52:29 2003 From: costanti at science.unitn.it (Marco Costantini) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] The GAP interface to the Singular system Message-ID: <1071247949.3fd9f24dcd3a8@www.unitn.it> Dear GAP Forum, With this message we would like to draw your attention to the new version of the GAP interface to the Singular system, which has just become available. Features of this interface include: * fast computation of Groebner bases, * computation of multivariate Gcd, * factorization of multivariate polynomials, * computation of invariant rings of finite groups. The interface can be downloaded from http://www-math.science.unitn.it/~costanti More information on Singular can be found on http://www.singular.uni-kl.de (where the system can also be downloaded for free). If you have any questions please feel free to contact us. Best wishes, Marco Costantini (costanti@science.unitn.it) Willem de Graaf (quagroup@hetnet.nl) From primoz.moravec at fmf.uni-lj.si Tue Dec 16 16:35:00 2003 From: primoz.moravec at fmf.uni-lj.si (Primoz Moravec) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Low index normal subgroups Message-ID: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Dear GAP Forum, what is the best way to compute normal subgroups of low index in a given finitely presented group? Best Regards, Primoz. ------------------------------------ Primoz Moravec Institute of mathematics, physics and mechanics Jadranska 19 SI-1000 Ljubljana Slovenia email: primoz.moravec@fmf.uni-lj.si ------------------------------------ From p.dobcsanyi at designtheory.org Wed Dec 17 11:06:49 2003 From: p.dobcsanyi at designtheory.org (Peter Dobcsanyi) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] 'Releases from DesignTheory.org' Message-ID: Release Announcements from DesignTheory.org =========================================== The EPSRC funded DesignTheory.org project, based at Queen Mary, University of London, is pleased to announce the public releases of its XML-format for block designs and its Design package for GAP. We expect these releases to be of interest to those working in combinatorial or statistical design theory, as well as those interested in the development of standard electronic formats for mathematical objects. 1) The External Representation of Block Designs v1.1, http://designtheory.org/library/extrep/ This is a platform independent XML-format for encoding block designs, and their combinatorial, group-theoretical and statistical properties. Comments, questions, bug reports --> extrep@designtheory.org 2) Design v1.0 Package for GAP v4.3, http://designtheory.org/software/gap_design/ This GAP v4.3 package is for the classification, partitioning and study of block designs (which include but are not restricted to t-designs). This package can also write and read block designs in our External Representation XML-format. Comments, questions, bug reports --> gap-design@designtheory.org Please feel free to forward this announcement to anyone you think may be interested. Enjoy, The Developers From costanti at science.unitn.it Wed Dec 17 14:44:49 2003 From: costanti at science.unitn.it (Marco Costantini) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Low index normal subgroups In-Reply-To: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> References: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Message-ID: <1071672289.3fe06be17b5a6@www.unitn.it> Dear Primoz and dear gap forum, Scrive Primoz Moravec : > what is the best way to compute normal subgroups of low index in a given > finitely presented group? (I don't know the best way but I can suggest a way to try.) Look at the functions in the manual in the paragraph Groups - Sets of Subgroups: maybe the functions MaximalNormalSubgroups or NormalSubgroups are what you need. Such functions may not terminate in the case that your group is not finite... in this case, and if it make sense for your problem, you can consider some finite quotient of your group, and calculate MaximalNormalSubgroups or NormalSubgroups in it. There are package to calculare the p-/nilpotent/polyciclic/solvable quotients of finitely presented groups (see the packages anupq, nq, etc.). the kind of quotient to calculate depends on your problem. If otherwise your finitely presented group G is finite, it could be better to convert it into a polycyclic or permutation group, for efficiency, before doing any other computation. Image(IsomorphismSpecialPcGroup(G)); (if G is solvable) Image(IsomorphismPermGroup(G)); (otherwise) Best Regards, Marco From hulpke at math.colostate.edu Wed Dec 17 22:58:47 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Low index normal subgroups In-Reply-To: <3.0.5.32.20031216173500.00b646e8@fmf.uni-lj.si> Message-ID: <200312172258.hBHMwlmp016877@schur.math.colostate.edu> Dear Gap Forum, Primoz Moravec asked: > what is the best way to compute normal subgroups of low index in a given > finitely presented group? As Marco costatini already pointed out, the methods will be quite different if you know that the group is finite (``finite'' here probably means: order <10^15 ). If the group is finite, the best approach is to convert to a permutation group or pc group and use for example `NormalSubgroups'. If the group is potentially infinite or very large, this might be impossible or infeasible. In this case I would do the following (assuming again that your ``small index'' is really small, say up to n=1000: Using the library of small groups of order <=n (these are the potential factor groups), determine - For all solvable groups of order <= n the orders of chief factors. You can use these as input to the solvable quotient algorithm to obtain a large finite solvable quotient of your group which has all solvable factor groups as factors. - For each nonsolvable group $G$ determine a series of subgroups U1>...>Uk such that the image of the action of G on the cosets of Ui is nonsolvable and that the action on the cosets of Uk is faithful (often only one subgroup suffices, but for groups such as 2.A6 you might want to take a subgroup of inder 6 for U1). Then using `LowIndexSubgroups' determine all subgroups of the finitely presented group of index $[G:U1]$. Check whether the action on the cosets is permutation isomorphic to the action of G on the cosets of U1 (for example using `TransitiveIdentification' if the index is <=30). If U\le F is such a subgroup with [F:U]=[G:U1] determine subgroups of index [U1:U2] in U by the low index algorithm. Again compare the types of factor groups. Iterate until Uk (if not ruled out). Most nonsolvable groups of large order have a small-degree permutation representation or a factror group with a low-degree permutation representation. Thus the second step of this program is probably comparatively little work. Best regards, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From jjoao at netcabo.pt Tue Dec 30 10:24:49 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute Message-ID: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Dear GAP Forum, I have defined an attribute (SemiDirectProductElmAction) for certain tuples (elements of a semidirect product semigroup being constructed) because I need to know this attribute to multiply elements of this new semigroup, but it is not stored when I do Setter(SemiDirectProductElmAction)(t, act); where "t" is the tuple and "act" an action. My question is: how can I store this attribute on each of these tuples? Thank you, Jose Morais From jjoao at netcabo.pt Tue Dec 30 10:53:38 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute Message-ID: <1072781653.4368.10.camel@a213-22-130-67.netcabo.pt> Dear GAP Forum, I have defined an attribute (SemiDirectProductElmAction) for certain tuples (elements of a semidirect product semigroup being constructed) because I need to know this attribute to multiply elements of this new semigroup, but it is not stored when I do Setter(SemiDirectProductElmAction)(t, act); where "t" is the tuple and "act" an action. My question is: how can I store this attribute on each of these tuples? Sorry for using the list's old email address, but I got an "Out of office" reply when sending to the new email address. Thank you, Jose Morais From hulpke at math.colostate.edu Wed Dec 31 00:07:49 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute In-Reply-To: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Message-ID: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Dear GAP Forum, Jose Morais asked: > I have defined an attribute (SemiDirectProductElmAction) for certain >tuples (elements of a semidirect product semigroup being constructed) >because I need to know this attribute to multiply elements of this new >semigroup, but it is not stored when I do Attributes are only stored if the representation is in `IsAttributeStoringRep'. Tuples are not in this representation and thus do not store attributes (which is the behaviour you observed). To get around the problem there are two ways: the first is to create your own tuples that use the `ComponentObject' representation and thus are able to store attributes. In your case however this looks like overkill. What I would do instead (and is the way similar situations are dealt with in the library) is to declare the attribute for the *family* of tuples (which is by default attribute storing): DeclareAttribute("MyAttribute",IsFamily); and set this attribute once you create your initial objects: ... # create generating tuples tups:=.... fam:=FamilyObj(tups[1]); SetMyAttribute(fam,actioninfo); In your multiplication routine (when you need the attribute value) you can then get it from the family: MyMultiplication:=function(a,b) local actioninfo; actioninfo:=MyAttribute(FamilyObj(a)); Setter(SemiDirectProductElmAction)(t, act); (You can see examples of such code in the library file `gprd.gi' that implements generic products for groups.) Best wishes and a Happy New Year, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke From jjoao at netcabo.pt Wed Dec 31 10:47:32 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute In-Reply-To: <200312310007.hBV07nJT022376@schur.math.colostate.edu> References: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Message-ID: <1072867685.4360.20.camel@localhost.localdomain> Dear GAP Forum, Thank you for your reply to my question about a Tuple attribute. While I hadn't your answer, I implemented a new GAP object (Pair) which is in `IsAttributeStoringRep', but I am having difficulties in defining a method for the 'ONE' operation applicable to this new object. gap> p:=Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )); Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )) gap> Monoid(p); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 2nd choice method found for `ONE' on 1 arguments called from OneOp( elm ) called from One( Representative( M ) ) called from One( M ) called from called from called from ... So, I defined this method: InstallMethod( OneOp, "for pairs", true, [ IsPair ], 0, function( el ) return(Pair(One(el!.first), One(el!.second))); end ); but I get the error: Error, required filters [ "IsPair" ] for 1st argument do not match a declaration of ONE called from Looking then at the declaration of ONE I found: basicim.gd:210:DeclareOperation( "ONE", [ IsBasicImageEltRep ] ); I have this definition for pairs: BindGlobal( "PairsType", NewType( PairsFamily, IsPair and IsExtAElement and IsNearAdditiveElement and IsAdditiveElement and IsNearAdditiveElementWithZero and IsAdditiveElementWithZero and IsNearAdditiveElementWithInverse and IsAdditiveElementWithInverse and IsAdditivelyCommutativeElement and CanEasilySortElements and CanEasilySortElements and IsExtRElement and IsExtLElement and IsMultiplicativeElement and IsMultiplicativeElementWithOne and IsMultiplicativeElementWithZero and IsMultiplicativeElementWithInverse and IsAssociativeElement and IsAttributeStoringRep )); but if I add to these filters 'IsBasicImageEltRep', then, when I try to define a pair I get an error: gap> p:=Pair(Transformation( [ 1, 2, 3, 4 ] ), Transformation( [ 2, 3, 4, 4 ] )); Record: '.Word' must have an assigned value at return elt!.Word; called from Word( elt ) called from ( ) called from read-eval-loop Entering break read-eval-print loop ... My question is: how can I define a Pair in such a way that it becomes suitable for all the operations applicable to Tuples? Thank you for your attention and patience, Happy New Year, Jose Morais From jjoao at netcabo.pt Wed Dec 31 11:37:03 2003 From: jjoao at netcabo.pt (Jose Joao Morais) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute In-Reply-To: <200312310007.hBV07nJT022376@schur.math.colostate.edu> References: <200312310007.hBV07nJT022376@schur.math.colostate.edu> Message-ID: <1072870659.4360.25.camel@localhost.localdomain> Dear GAP Forum, About my last question: My question is: how can I define a Pair in such a way that it becomes suitable for all the operations applicable to Tuples? I would like to tell you that I've solved the problem for the 'ONE' operation by defining the following method: InstallMethod( OneMutable, "for pairs", true, [ IsMultiplicativeElementWithOne and IsPair ], 0, function( el ) local m1, m2; return(Pair(One(el!.first), One(el!.second))); end ); Thank you for your attention and patience, Happy New Year, Jose Morais From hulpke at math.colostate.edu Wed Dec 31 19:18:46 2003 From: hulpke at math.colostate.edu (Alexander Hulpke) Date: Thu Jan 5 13:04:15 2006 Subject: [GAP Forum] Tuple attribute In-Reply-To: <1072779925.4368.6.camel@a213-22-130-67.netcabo.pt> Message-ID: <200312311918.hBVJIkpQ023889@schur.math.colostate.edu> Dear GAP Forum, Jose Morais wrote: > While I hadn't your answer, I implemented a new GAP object (Pair) which > is in `IsAttributeStoringRep', but I am having difficulties in defining I still think that keeping tuples and storingthe attribute in the family is the cleaner and more efficient solution and will save you in the end a lot of time recoding methods for tuples. > My question is: how can I define a Pair in such a way that it becomes > suitable for all the operations applicable to Tuples? The easiest is probably to look at the code for tuples (in `tuples.g?') and duplicate what is done there. As it might be of interest anyhow, let me add a few remarks about the error you got: > InstallMethod( OneOp, "for pairs", true, [ IsPair ], 0, > > Error, required filters [ "IsPair" ] > for 1st argument do not match a declaration of ONE called from Method installations have to conform to the declaration of the operation, but one can skip this test by using `InstallOtherMethod' instead (I seem to recall that there was a similar question recently). Operations are typically declared in a `.gd' file, but an operation can be declared several times for different objects (for example the conjugacy classes of a group or of a character table), and one might have to find the right declaration. With `One' (and its derivatives) the situation is complicated further, in that this is an operation that the kernel must know about (for example for calculating x^0). The declaration therefore is a bit mor complicated. (The declaration in basicim.gd you found is a red herring and will only confuse things -- lets forget about it for the moment.) Most arithmetic operations (as also `One') are declared in `arith.gd'. (The comments in this file give much more detail than I can do here.) We find the following declaration: DeclareOperationKernel("OneMutable",[IsMultiplicativeElementWithOne],ONE); This means: The operation is initially created (under the name `ONE') in the kernel. (This is needed to have the kernel know about it. Typically operations that come from the kernel have a kernel name that is all upper case and then get declared with a ``proper'' library name.) In our case, `OneMutable' is the library name, but when you type it into GAP, you still see the kernel name lurking behind: gap> OneMutable; (There are other declarations in `arith.gd' (they have essentially to do with the fact that we might want to store the `One' of a group as an attribute and -- if the group elements are potentially mutable, as for example matrices are -- a stored one should be immutable. They all wrap around `OneMutable'.) `OneMutable' is declared for the category `IsMultiplicativeElementWithOne'. To be able to calculate `One' for your pairs, they have to be declared to be in this category as well. This must happen when you declare `IsPair', it is not sufficient that all pair objects you create are put in this Category. (As the installation only is given `IsPair', the method installation does not know about this fact. You could change the method installation to `IsPair and IsMultiplicativeElementWithOne', however. In your second mail you state that this worked. With this, however you might run into the same problem with other arithmetic operations.) > I have this definition for pairs: BindGlobal( "PairsType", NewType( PairsFamily, IsPair and IsExtAElement and IsNearAdditiveElement and IsAdditiveElement and IsNearAdditiveElementWithZero and IsAdditiveElementWithZero and IsNearAdditiveElementWithInverse and IsAdditiveElementWithInverse and IsAdditivelyCommutativeElement and CanEasilySortElements and CanEasilySortElements and IsExtRElement and IsExtLElement and IsMultiplicativeElement and IsMultiplicativeElementWithOne and IsMultiplicativeElementWithZero and IsMultiplicativeElementWithInverse and IsAssociativeElement and IsAttributeStoringRep )); This is the type, which your objects will get. Personally I would leave out declarations that are anyhow implied (IsMultiplicativeElementWithInverse implies IsMultiplicativeElementWithOne implies IsMultiplicativeElement implies IsAssociativeElement, for example) I also would try to start with only the categories you really need -- for monoid elements that would be: IsMultiplicativeElementWithOne (you might want to use IsMultiplicativeElementWithInverse instead, if you might want to generalize to groups or if some elements are invertible) IsPair, IsAttributeStoringRep, (I suppose `IsPair' implies IsComponentObject') and -- if you have an efficient comparison implemented (this filter essentially makes some methods available that rely on elememt comparison) CanEasilySortElements. I also would have `IsMultiplicativeElementWithInverse' and `IsAssociativeElement' to be implied by `IsPair'. (The reason for leaving out unnecessary declarations is that these might trigger methods for other kinds of objects which might assume further properties. The error you got after changing the declaration: > but if I add to these filters 'IsBasicImageEltRep', then, when I try to > define a pair I get an error: > Record: '.Word' must have an assigned value at is exactly of this kind -- what gets triggered is a `View' method for `IsBasicImageEltRep' that assumes that a !.Word component is stored in the object.) One last remark: If `IsPair' does not imply `IsMultiplicativeElement' and `IsAssociativeElement' by its declaration, I think you might end up that sets of pairs (your monoids) will not know automatically to be `IsMultiplicativeElementCollection' and `IsAssociativeElementCollection' and thus are not recognized to be semigroups or monoids though your objects all will multiply fine. Best wishes and a Happy New Year, Alexander Hulpke -- Colorado State University, Department of Mathematics, Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA email: hulpke@math.colostate.edu, Phone: ++1-970-4914288 http://www.math.colostate.edu/~hulpke