-
Notifications
You must be signed in to change notification settings - Fork 160
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
Inconsistent behavior observed when computing over a list of orbits #5058
Comments
A quick remark: I'd suggest to replace orbs := Orbits(ugrp,Concatenation([0..3675785],[3675786]),act); by orbs := OrbitsDomain(ugrp,[0..3675786],act); as the warning message also recommends. The message As to the timing difference: I did not yet have a chance to look at your example here or from you email in detail. But note that many of the underlying algorithms are randomized. So you could try and use |
The command
runs into the same problem as PR 5056. The bit with concatenation was to get a list that Orbits or OrbitsDomain would accept without error. (I can make another PR if you want for OrbitsDomain.) The question is not about orbs. Rather I want to iterate over them (a list of list of integers) and apply a numerical filter to each of them. (Essentially compute the stabilizer for a representative of each orbit.) At this point I want to avoid invoking anything group theoretic because even with a nice monomorphism computing the stabilizer of an element takes a very long time. And probably rightly so no complaint .
Why does the following even invoke stabilizer code the first time it is run in a GAP session?
And the second time in the same session it is doing what I expect and apply the numerical filter to integer values of the elements of ugrp?
Lastly other variants do not change the inconsistency for instance making ugrp a list of integers exhibits the same behavior.
|
That's weird, it works perfectly fine for me in GAP 4.12.0, producing 359 orbits.
Yes, I understand why you used that workaround; and I posted on your issue #5056, a fix for this bug is in my PR (pull request) #5057.
No, I merely took the liberty to also comment on another part of your example code to point out a possible improvement :-).
Sure, I understand (and understood) all of that :-). But you are not actually avoiding to compute the nice monomorphism here because iterating over
It is computing a stabilizer chain for the image of ...
There are many reasons why this could happen; I can't be bothered to dig into the code right now, but I already pointed out that difference in a random number generator (RNG) seed can lead to wildly varying timings. Hence my suggestion to try varying the RNG state manually via There is a second explanation, more likely here:
You are still iterating over You could simply avoid using n:=3671136;
ugrp_int:=Filtered([0..n], k -> GcdInt(k,n)=1);
stabs := List(orbs, y->Filtered(ugrp_int,x->PowerModInt(y[1],x,3675787)=y[1]));; |
Thank you for the analysis. It all really boils down to iterating over So the issue (question) is this
However
Wouldn't one expect the first to complete in a time similar (within some small order of magnitude) to the second? |
Perhaps in an ideal world. But in reality, there are many ways to compute something, and which one is most efficient is generally speaking undecidable / not computable. Here it turns out it is a good idea to first compute a nice object and then go on; but in other cases this is not true. As it is, it is fairly normal for GAP to perform quite differently depending on what information is already known about an object. The only way I know to prevent this effect is to remove the ability to select better algorithms based on prior knowledge -- but that's obviously out of the question. |
Fair enough. Every command's performance is confined to it current context. And indeed this is the case above.
Calls the Enumerator "use nice monomorphism" which computes the NiceMonomorphism and also computes the enumeration of the NiceObject, a permutation group on 1047168 points, which is basically hopeless. On the other hand computing the NiceObject (or NiceMonomorphism) explicitly sets the group attributes Enumerator, EnumeratorSorted, AsList, and AsSSortedList (I believe via ActionHomomorphismConstructor). Hence the immediate response to Thank you for helping me sort this out. |
I believe this is resolved (not optimal, but anyway) and hence closed this. Please feel free to reopen and/or comment if you think I am mistaken and there is something left to be done. |
Observed behaviour
These commands were developed in an interactive session. I got the result I was looking for and then put them in a file to run in a new GAP session. But the commands from the file ran for a vary long time (unexpected from the interactive session). So I stopped the computation and run the commands again in the same session and it completed in the time seen in the interactive session.
Expected behaviour
The following runs with the expected runtime the first time in the session
Copy and paste GAP banner (to tell us about your setup)
The text was updated successfully, but these errors were encountered: