Skip to content
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

Fix order computation for linear groups GL(n, R) and SL(n, R) #37980

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

S17A05
Copy link
Contributor

@S17A05 S17A05 commented May 10, 2024

#36881 introduced some wrong results for orders of linear groups since it did not check whether the base ring is a field. We add the necessary checks as well as formulas for some further cases, namely $\mathbb{Z}$ and $\mathbb{Z}/q\mathbb{Z}.$ Finally, we add a NotImplementedError for the cases that are not supported.

The formula for the general linear group over $\mathbb{Z}/q\mathbb{Z}$ is taken from https://math.stackexchange.com/a/2044571, and for the order of the special linear group we use the group isomorphism induced by the determinant.

Fixes #37934.

Amend: Fix trailing whitespace
Copy link

github-actions bot commented May 10, 2024

Documentation preview for this PR (built with commit 0be9db8; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@S17A05 S17A05 changed the title Fix order computation of linear groups Fix order computation for linear groups GL(n, R) and SL(n, R) May 13, 2024
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly a bunch of little things. We do not want to return Python ints. We can take advantage of the closure in Python. It would be good to add a test verifying the result:

sage: G = GL(2, Integers(6))
sage: G.order() == len(list(G))
True
sage: G = SL(2, Integers(6))
sage: G.order() == len(list(G))
True

src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
src/sage/groups/matrix_gps/linear.py Outdated Show resolved Hide resolved
@tscrim tscrim removed the v: small label May 14, 2024
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM.

@S17A05
Copy link
Contributor Author

S17A05 commented May 14, 2024

Not sure why the tests failed, but the error makes it seem like a CI issue.

@tscrim
Copy link
Collaborator

tscrim commented May 15, 2024

Indeed, something seems borked with it.

vbraun pushed a commit to vbraun/sage that referenced this pull request May 18, 2024
…d SL(n, R)

    
sagemath#36881 introduced some wrong results for orders of linear groups since
it did not check whether the base ring is a field. We add the necessary
checks as well as formulas for some further cases, namely $\mathbb{Z}$
and $\mathbb{Z}/q\mathbb{Z}.$ Finally, we add a `NotImplementedError`
for the cases that are not supported.

The formula for the general linear group over $\mathbb{Z}/q\mathbb{Z}$
is taken from https://math.stackexchange.com/a/2044571, and for the
order of the special linear group we use the group isomorphism induced
by the determinant.

Fixes sagemath#37934.
    
URL: sagemath#37980
Reported by: Sebastian A. Spindler
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request May 18, 2024
…d SL(n, R)

    
sagemath#36881 introduced some wrong results for orders of linear groups since
it did not check whether the base ring is a field. We add the necessary
checks as well as formulas for some further cases, namely $\mathbb{Z}$
and $\mathbb{Z}/q\mathbb{Z}.$ Finally, we add a `NotImplementedError`
for the cases that are not supported.

The formula for the general linear group over $\mathbb{Z}/q\mathbb{Z}$
is taken from https://math.stackexchange.com/a/2044571, and for the
order of the special linear group we use the group isomorphism induced
by the determinant.

Fixes sagemath#37934.
    
URL: sagemath#37980
Reported by: Sebastian A. Spindler
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request May 24, 2024
…d SL(n, R)

    
sagemath#36881 introduced some wrong results for orders of linear groups since
it did not check whether the base ring is a field. We add the necessary
checks as well as formulas for some further cases, namely $\mathbb{Z}$
and $\mathbb{Z}/q\mathbb{Z}.$ Finally, we add a `NotImplementedError`
for the cases that are not supported.

The formula for the general linear group over $\mathbb{Z}/q\mathbb{Z}$
is taken from https://math.stackexchange.com/a/2044571, and for the
order of the special linear group we use the group isomorphism induced
by the determinant.

Fixes sagemath#37934.
    
URL: sagemath#37980
Reported by: Sebastian A. Spindler
Reviewer(s): Travis Scrimshaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong order of finite matrix groups
2 participants