Skip to content

Conversation

@simonbrandhorst
Copy link
Collaborator

@simonbrandhorst simonbrandhorst commented Dec 16, 2025

A small speedup for rank 2 subspaces

julia> G = change_base_ring(GF(2),orthogonal_group(root_lattice(:E,8)))
Matrix group of degree 8
  over prime field of characteristic 2

julia> @time orbit_representatives_and_stabilizers(G,2;algorithm=:gset)
  3.178908 seconds (17.17 M allocations: 993.945 MiB, 18.43% gc time, 24.56% compilation time)

julia> @time orbit_representatives_and_stabilizers(G,2;algorithm=:perm);
  1.992775 seconds (4.83 M allocations: 1.516 GiB, 56.67% gc time, 3.23% compilation time: 100% of which was recompilation)

A factor of 8 for larger ones.

julia> @time orbit_representatives_and_stabilizers(G,3;algorithm=:perm)
 16.631597 seconds (69.24 M allocations: 16.612 GiB, 23.58% gc time)

julia> @time orbit_representatives_and_stabilizers(G,3;algorithm=:gset)
138.655206 seconds (181.72 M allocations: 9.750 GiB, 2.63% gc time, 0.42% compilation time)

Magma is still faster by a factor of 10. (using MagmaCall.jl)

julia> @time Oscar.orbit_representatives_and_stabilizers_magma(G,3)
  0.196962 seconds (74.12 k allocations: 4.044 MiB)

julia> @time Oscar.orbit_representatives_and_stabilizers_magma(G,4)
  0.455924 seconds (99.45 k allocations: 6.118 MiB)

And can do stuff that won't terminate in Oscar:

julia> G = change_base_ring(GF(3),orthogonal_group(root_lattice(:E,8)))
Matrix group of degree 8
  over prime field of characteristic 3

julia> @time Oscar.orbit_representatives_and_stabilizers_magma(G,2);
  1.319443 seconds (127.67 k allocations: 11.775 MiB)

julia> @time Oscar.orbit_representatives_and_stabilizers_magma(G,3)
 62.540479 seconds (220.21 k allocations: 24.219 MiB)

julia> @time Oscar.orbit_representatives_and_stabilizers_magma(G,4)
320.437118 seconds (1.06 M allocations: 141.158 MiB, 0.08% gc time, 0.01% compilation time)

If we use a bit of extra knowledge (i.e. a tighter ambient group (GO instead of GL)), we get something usable.
Which is sometimes faster sometimes slower than magma between 1/2 and 120.
But this requires a field of odd prime order because I was lazy (and even characteristic is a nightmare).

julia> G2,_ = image_in_Oq(rescale(root_lattice(:E,8),3));

julia> T = domain(G2); O = orthogonal_group(T);

julia> phi = hom(G2,O,O.(gens(G2));check=false);

julia> @time Oscar._subspaces_representatives_and_stabilizers_elementary_odd(T,phi, 2)
124.235973 seconds (453.92 M allocations: 125.493 GiB, 25.23% gc time)

julia> @time Oscar._subspaces_representatives_and_stabilizers_elementary_odd(T,phi, 3)
118.189768 seconds (373.98 M allocations: 143.048 GiB, 27.61% gc time)

julia> @time Oscar._subspaces_representatives_and_stabilizers_elementary_odd(T,phi, 4; do_stab=true)
165.048095 seconds (467.02 M allocations: 185.208 GiB, 24.27% gc time)

@simonbrandhorst
Copy link
Collaborator Author

@fingolfin @ThomasBreuer

@ThomasBreuer
Copy link
Member

Nice.

The point is that the G-orbits are parametrized by S-G-double cosets in GL, where S is the stabilizer of the representative of the GL-orbit. Taking that the double cosets are working sufficiently well, one avoids computing orbits, and one replaces the computation of stabilizers of representatives by the computation of intersections.
(Since the whole computation makes sense only if there are not too many orbits (double cosets), I do not see in which situation the old approach could be better.)

Currently the tests are failing because of problems with the border case k = 0, and because of a different format of the return values.

@simonbrandhorst simonbrandhorst added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants