-
Notifications
You must be signed in to change notification settings - Fork 19
WIP: Classical groups. Express elements in LGO (nice) generators. #293
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
base: master
Are you sure you want to change the base?
WIP: Classical groups. Express elements in LGO (nice) generators. #293
Conversation
faa0ab0 to
893c388
Compare
fingolfin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not keen on adding binaries like PDFs into this repository. There is also the copyright issue (I have not yet looked at them). Also .DS_Store files should not be in there (perhaps add those to a global .gitignore list, on Mac's they can otherwise creep in quite easily.
| Print("The element g is not an element of one of the classical groups in their natural representation. \n"); | ||
| Print("Abort."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why not an error?
| Print("The element g is not an element of one of the classical groups in their natural representation. \n"); | |
| Print("Abort."); | |
| Error("The element g is not an element of one of the classical groups in their natural representation"); |
| # Originally implemented subfunctions | ||
| #################### | ||
|
|
||
| InfoBruhat := NewInfoClass("InfoBruhat");; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| InfoBruhat := NewInfoClass("InfoBruhat");; | |
| DeclareInfoClass("InfoBruhat"); |
As a general rule of thumb: a regular GAP file should never include double semicolons; if it does, something is wrong :-)
| a := 0; | ||
| while res mod 2 = 0 do | ||
| a := a + 1; | ||
| res := Int(res*0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another rule of thumb: if you use floating point in GAp other than for printing some statistics, something is wrong.
Here, you should have used either
| res := Int(res*0.5); | |
| res := res / 2; |
which works since you know res is divisible by 2; or in situations where you also want to divde odd numbers by 2 and round down, use QuoInt.
But actually, do neither, and instead replace that whole loop by a := PValuation(n-1, 2);.
| Error("LGOStandardGens: d has to be at least 6\n"); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never end an Error message with newline. And don't follow it by areturn(the control flow ends here. Well, technically the user can try to edit values and resume execution, but then let them; doing areturnwill break that case. If you really want to prevent it, useErrorNoReturn`, although personally, I see no need for that).
| Error("LGOStandardGens: d has to be at least 6\n"); | |
| return; | |
| Error("LGOStandardGens: d has to be at least 6"); |
| return __LGOStandardGensSOCircle(d,q); | ||
| fi; | ||
|
|
||
| Error("e has to be 1, -1 or 0."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, don't end error messages with a period
| Error("e has to be 1, -1 or 0."); | |
| Error("e has to be 1, -1 or 0"); |
| w := PrimitiveElement(fld); | ||
|
|
||
| s := IdentityMat( d, fld ); | ||
| s[1][1] := Zero(fld); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideall use the new syntax for element access everywhere:
| s[1][1] := Zero(fld); | |
| s[1,1] := Zero(fld); |
5c9ede7 to
1b638f6
Compare
Include functions to express arbitrary elements in terms of LGO generators. We use the LGO generators as "nice" generators for the constructive recognition of classical groups.