-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FittingSubgroup or FrattiniSubgroup do not have HasIsNilpotentGroup #398
Comments
The headline problem can, and probably should, be fixed by adding a SetIsNilpotentGroup( ,true) call to the method for FittingSubgroup. I wonder though if there is any merit in introducing a more general mechanism? You could imagine, for instance a call to declare that when an object o has certain filters set, and a is some attribute then Another approach would be to have a single filter
which is set in all objects (for which filters can be set, integers and fail and so on would have to be excluded) and then install implications or immediate methods from this. This doesn't allow you to access the type of the "source" object, but requires less new machinery. |
Actually, I was wondering what are the possible filters, properties, attributes that are more common to consider when one writes a new method computing something. More specifically, I was wondering if there is any kind of filter for a subgroup that is a subgroup of the center of another group (e.g. the socle of a nilpotent group). A method might find the socle in such a way that even the IsAbelian filter is not set, and then it needs to be set by hand. Similarly, if there were some properties about centralness (idk, like IsCentralInParent, if it exists at all), it should be set, as well. I was wondering if there is a list of all existing properties somewhere? |
@stevelinton This sounds related to what the "TODO lists" of the ToolsForHomalg project do. May want to talk to @mohamed-barakat @sebasguts about this (very interesting stuff). @hungaborhorvath There is no way to automatically ensure that e.g. the object returned by As to listing all existing properties: Well, you could type "Is" in the GAP interpreter, then press the TAB key twice to get a rough idea ;-). Of course not all of the these are "properties", but then, you may actually want more than properties anyway. |
While at it, I should also mention the operations Addressing this properly and in general would be very nice. |
BTW, in the case discussed here, one of course also need to take extra care to not forget that there are also infinite groups, and for those, neither the Fitting nor the Frattini group need to be nilpotent. |
Hm, I did try the Is+TAB approach, and it is really hard to navigate there.... BTW, so how will the IsNilpotent property be remedied in practice? Will all corresponding library file maintainers add this to their files, or should someone do this for all library files and put in a pull request? |
The Frattini and Fitting subgroups of finite groups are always nilpotent. See issue gap-system#398.
You can count the globals starting with
Quite a lot. Of course not all are really for properties and other filters... |
I think this produces a list of existing properties for objects in
|
@alex-konovalov Hm, now I really start to wonder.... If one really meticulously wants to properly set these properties, then e.g. after figuring out that a group is abelian or nilpotent, then a lot of these properties should automatically set to false, e.g. IsSimpleGroup, IsSymmetricGroup, IsPSL, etc. (with a possible few exceptions). I am guessing that immediate methods could be written for such cases, but it would be tedious, never ending, and parts of it may already exist somewhere in the code. Not to mention the situations, like when (anywhere, anytime) a nontrivial normal subgroup is computed, and then IsSimpleGroup should be set to false. But I guess nobody can expect the developers to keep track of all these properties.... |
What would (apart from a stab-collecting urge) be the gain of having e.g. |
@hulpke Apart from the urge (which I guess is rather important), I can imagine that a later algorithm called by the user calls for IsSimpleGroup (e.g. for a similar situation: Socle currently calls for IsPrimitiveGroup and exits if its result is false), and this call might be costly (compared to being already set), because the algorithms for IsSimpleGroup will look at something else, not the fact that GAP has already computed a nontrivial normal subgroup. (This might be a wrong example, considering IsSimpleGroup is probably rather fast all the time). Further, setting properties costs only 1 bit of memory, i.e. cheap. I can understand not setting attributes which may use up bigger chunks of memory. About IsNilpotentGroup you are right. I found only 5 instances in the main library files where method selection checks whether this property is set. However, issue #385 is exactly about a situation, where current methods implemented for solvable groups is significantly slower than for nilpotent groups. Finally, considering that (statistically) most groups are p-groups, and therefore nilpotent, GAP probably should try to treat them a bit more favourably, if possible. (However, I would not argue that most interesting groups may not be nilpotent.) |
@hungaborhorvath You'd have to check nontrivial proper for (some? every?) normal subgroup computed, keeping in mind that IsSimpleGroup also covers the abelian case. Probably depends a lot on a person's usage of GAP whether this makes sense. Besides, knowing that a group is not simple, not abelian, not nilpotent, … usually doesn't help during method selection. Essentially, the same is true for enforced finiteness and nilpotency checks – depends very much on the usage scenario whether they will speed up or slow down things. Btw., please keep in mind that methods that seem to be very efficient for small groups may be rather slow when groups get more complicated. The efficiency of "Center", in particular, depends a lot on the group and its representation. If I remember correctly, I decided against computing the socle from the centre of the Fitting subgroup in CRISP because of this problem. (Maybe I should add a method at least for the case when the Fitting subgroup knows its centre.) |
@bh11 This is interesting. Do you have some group examples where it takes a long time to compute the center of the Fitting subgroup? It would be worth looking at. BTW, I am wondering how fast a FittingSubgroup computation is in general? |
I did some checking. The solvable Socle method is unfortunately not enforced, and therefore will only be used when the group knows that it is solvable. Otherwise it falls back rather quickly to some general method of computing all normal subgroups and takes a much longer time. I advise that an IsSolvable check should be enforced. RedispatchOnCondition does not work, because there is a generic (and rather slow) method, so it will never fall back.
I also compared it with the method of computing the FittingSubgroup first, and then either the product of Omega(Center(H)) for H running in a SylowSystem, or simply computing the Center first and then computing the Omega group. They were comparable (226 and 228ms altogether), and about 20% faster than the SolvableSocle method. Of course, this difference is not that much. The difference becomes rather significant with the example explained in #385 There, the CRISP method did not finish in sensible time for me, but I may not have waited enough. Anyway, I would suggest that the CRISP method get a bigger rank and should also enforce an IsSolvable check, otherwise it will not be called in a lot of situations where it really should. Then we could compare which method is faster for which groups and figure out which one to use when. |
@hungaborhorvath The basic setup of the method selection is that only properties that are already known are considered, that is GAP does not try to test for useful properties. This was a deliberate design decision to not try to put in ``clever'' deductions (or go the route of Prolog and similar languages) which have the potential to become expensive. If there is a calculation in which it would be worth to test for a property, the standard way of implementing it is: Install a method that does not require the condition. Rank it higher than the next method (using `ApplicableMethod' will give you ranks and thus give you an idea how much higher it should be. This method then tests the property and calls `TryNextMethod()' to exit if the property is not fulfilled. That way there is no need to manically set properties (or rely on clever implications) to get the better methods to be selected. In the end it is often the representation far more than mathematical properties that allow for better algorithms. E.g. the good methods for solvable groups don't just require solvability but in fact the ability to compute exponents with respect to a polycyclic generating set. |
@hulpke Thanks for the explanation. I still disagree about not setting properties if by some theorem they are known in certain situations, but I also understand that currently setting many (most?) of them do not seem to affect anything. I very much liked the idea of such properties being set, because in 80% of the time in algebra problems the solution presented itself to me after observing some particular thing (e.g. a property) being true or not, and I like that GAP has the same thinking. Anyway, just to sum up: do I understand correctly that you suggest to write some simple code for the generic method (with high enough rank) which tests for solvability and/or nilpotency (whichever seems cheap enough compared to the possible gain) and then exit with TryNextMethod(); ? And maybe do this with checking first the presentation of the group and if such tests are feasible? |
@hungaborhorvath I'm not advocating to never set properties and if you want to do so in your code please do so. My concern is to go into existing code and add such assignments in bulk. Yes, you would install a method that does not require (e.g.) IsNilpotentGroup, but possibly some other filters about representation or capabilities ( |
@hungaborhorvath @hulpke Instead of installing an explicit method with fewer filter requirements, why not rank the RedispatchOnConditions code higher? This has the advantage that all other methods are reconsidered after (e.g.) nilpotency has been discovered, so one need not be so careful about ranking. Anyway, this is what CRISP does for NormalSubgroups, seems to work well. |
@bh11 RedispatchOnCondition was intended to provide fallback tests, avoiding `NoMethodFound' errors and therefore ranks the method by default to be at the very end of the method selection. Using it in the way you describe brings up a number of problems:
|
@hulpke 1) No, the redispatch will only have to be ranked above the method it tries to avoid. Infinite recursion can't happen, regardless of the rank it is given. It's easy to compute the required rank from existing filters which makes the code fairly independent of subsequent ranking changes. Otoh, if you install a method which checks a property, this method usually needs to be re-ranked manually because its formal requirements will place it very low on the method list.
|
The Frattini and Fitting subgroups of finite groups are always nilpotent. See issue gap-system#398.
The Frattini and Fitting subgroups of finite groups are always nilpotent. See issue gap-system#398.
The Frattini and Fitting subgroups of finite groups are always nilpotent. See issue gap-system#398.
#400 takes care of this. |
I just came across the following:
As the Fitting subgroup is, by definition, nilpotent, the method should set the IsNilpotentGroup property to true. TraceMethods says that lib/grp.gi:966 is used, and indeed, IsNilpotentGroup is not set.
The same happens with the FrattiniSubgroup (called from lib/grppcatr.gi:136):
I wonder, in general what kind of properties/attributes should be set by methods?
For example, is it possible to let GAP know that Sylow subgroups of FrattiniSubgroup(G) are normal in G? Or, is it possible to let GAP know that Socle of a nilpotent group is always central?
The text was updated successfully, but these errors were encountered: