Skip to content

Add fixed_points for PermGroup and PermGroupElem#5250

Merged
lgoettgens merged 25 commits intooscar-system:masterfrom
varuntrehan7:fixed-points
Oct 8, 2025
Merged

Add fixed_points for PermGroup and PermGroupElem#5250
lgoettgens merged 25 commits intooscar-system:masterfrom
varuntrehan7:fixed-points

Conversation

@varuntrehan7
Copy link
Copy Markdown
Contributor

I was able to write a docstring in the groups/perm.jl and I was also able to write some tests in the tests/ groups.

I was successfully able to add and validate tests for the fixed points in symmetric group but while trying to do it with trivial group or subgroups generated by specific cycles I was facing some issues.

@fieker
Copy link
Copy Markdown
Contributor

fieker commented Aug 29, 2025

your commit is too large, changes to Prohejt.toml should not be there.
Also, as you see here, the tests are failing...

@varuntrehan7
Copy link
Copy Markdown
Contributor Author

varuntrehan7 commented Aug 29, 2025 via email

@fieker
Copy link
Copy Markdown
Contributor

fieker commented Aug 29, 2025

You still have changes to Project.toml in

@varuntrehan7
Copy link
Copy Markdown
Contributor Author

You still have changes to Project.toml in

I think I was able to rectify that , next I will look into the errors that are coming up.

@lgoettgens lgoettgens linked an issue Aug 30, 2025 that may be closed by this pull request
@lgoettgens lgoettgens added topic: groups release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Aug 30, 2025
@lgoettgens lgoettgens changed the title Fixed points Add fixed_points(::PermGroup) Aug 30, 2025
Copy link
Copy Markdown
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I added some more comments regarding code style. The Project.toml changes and the unnecessary testfile are definitely blocking this PR from getting merged (as are the failing test).

Comment thread src/Groups/perm.jl
Comment thread src/Groups/perm.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/test_fixed_points.jl Outdated
Comment thread Project.toml Outdated
Comment thread test/Groups/Permutations.jl
Comment thread test/Groups/Permutations.jl Outdated
Comment thread src/Groups/perm.jl Outdated
Comment thread Project.toml Outdated
Comment thread test/Groups/Permutations.jl Outdated
Comment thread experimental/IntersectionTheory/docs/src/BottFormulas.md
Comment thread src/Groups/perm.jl Outdated
4
```
"""
fixed_points(G::PermGroup) = setdiff!(collect(1:degree(G)), moved_points(G))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
fixed_points(G::PermGroup) = setdiff!(collect(1:degree(G)), moved_points(G))
fixed_points(G::PermGroup) = setdiff(1:degree(G), moved_points(G))

I did a small benchmark and it seems as if the original version of this was indeed better than my suggetsion, so this should be changed back.

julia> f1(n, x) = setdiff(1:n, x)
f1 (generic function with 1 method)

julia> f2(n, x) = setdiff(collect(1:n), x)
f2 (generic function with 1 method)

julia> f3(n, x) = setdiff!(1:n, x)
f3 (generic function with 1 method)

julia> f4(n, x) = setdiff!(collect(1:n), x)
f4 (generic function with 1 method)

julia> @b f1($(10), $([1,3,5,6]))
382.658 ns (6 allocs: 448 bytes)

julia> @b f2($(10), $([1,3,5,6]))
416.382 ns (8 allocs: 592 bytes)

julia> @b f3($(10), $([1,3,5,6]))
ERROR: CanonicalIndexError: setindex! not defined for UnitRange{Int64}
[...]

julia> @b f4($(10), $([1,3,5,6]))
398.235 ns (7 allocs: 544 bytes)

@lgoettgens
Copy link
Copy Markdown
Member

Try to add fixed_points to

import ..Oscar: pullback, pushforward, base, OO, product, compose, identity_map, map
this should then get rid of the issues related to intersection theory that you encounter

@varuntrehan7
Copy link
Copy Markdown
Contributor Author

Try to add fixed_points to

import ..Oscar: pullback, pushforward, base, OO, product, compose, identity_map, map

this should then get rid of the issues related to intersection theory that you encounter

Thanks, that's helpful.

@fingolfin
Copy link
Copy Markdown
Member

@varuntrehan7 please also address the other comments @lgoettgens made

@fingolfin
Copy link
Copy Markdown
Member

@varuntrehan7 that means: look over all of #5250 and https://github.com/oscar-system/Oscar.jl/pull/5250/files for the code change suggestions -- you can either apply this with a few clicks via the webinterface (and later use git pull to get them onto your computer) or you need to manually replicate them on your computer and push your changes.

@varuntrehan7
Copy link
Copy Markdown
Contributor Author

@varuntrehan7 that means: look over all of #5250 and https://github.com/oscar-system/Oscar.jl/pull/5250/files for the code change suggestions -- you can either apply this with a few clicks via the webinterface (and later use git pull to get them onto your computer) or you need to manually replicate them on your computer and push your changes.

Thankyou, yes I'll make sure I do all the suggestions made so far and push again after doing so. apologies for the delay, I will do it asap.

@fingolfin
Copy link
Copy Markdown
Member

I am getting a bit tired of repeating this, but here it is one more time: number_of_fixed_points is still missing.

Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
@fingolfin fingolfin changed the title Add fixed_points(::PermGroup) Add fixed_points for PermGroup and PermGroupElem Sep 22, 2025
Copy link
Copy Markdown
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Thanks, it's starting to look a lot better.

Comment thread experimental/IntersectionTheory/src/IntersectionTheory.jl Outdated
Comment thread docs/src/Groups/permgroup.md
Comment thread src/Groups/perm.jl Outdated
Copy link
Copy Markdown
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Please go everything and remove any unicode. Otherwise this seems OK now

Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
Comment thread test/Groups/Permutations.jl Outdated
@fingolfin fingolfin requested a review from lgoettgens October 4, 2025 01:39
@lgoettgens
Copy link
Copy Markdown
Member

@varuntrehan7 If you think this is ready, please mark it as "ready to review" using the github UI.
However, some tests still seem to be failing...

Comment thread src/Groups/perm.jl Outdated
Comment on lines +209 to +210
Return the number of those points in `1:degree(x)` or `1:degree(G)`,
respectively, that are fixed under the action `^`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Return the number of those points in `1:degree(x)` or `1:degree(G)`,
respectively, that are fixed under the action `^`.
Return the number of points in `1:degree(x)` or `1:degree(G)` that are
fixed by all elements (for groups) or by `x` (for elements).

I would find it easier to understand if both docstrings use the same sentence structure

@varuntrehan7
Copy link
Copy Markdown
Contributor Author

@varuntrehan7 If you think this is ready, please mark it as "ready to review" using the github UI. However, some tests still seem to be failing...

yeah, i'm not sure they were not failing before. Let me rectify them and and then mark it "ready for review".

Comment thread test/Groups/Permutations.jl Outdated
@test number_of_fixed_points(y) == 0 # generator (1 2 3 4) fixes nothing

z = g([2, 3, 1, 4]) # permutation (1 2 3)(4)
@test number_of_fixed_points(z) == 0
Copy link
Copy Markdown
Member

@lgoettgens lgoettgens Oct 6, 2025

Choose a reason for hiding this comment

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

Suggested change
@test number_of_fixed_points(z) == 0
@test number_of_fixed_points(z) == 1

as you write in line 463, there is a 1-cycle containing 4, and thus 4 is a fixed point.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.99%. Comparing base (1738e00) to head (6fccfd4).
⚠️ Report is 104 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5250      +/-   ##
==========================================
- Coverage   84.91%   83.99%   -0.92%     
==========================================
  Files         713      721       +8     
  Lines       96340    98483    +2143     
==========================================
+ Hits        81806    82720     +914     
- Misses      14534    15763    +1229     
Files with missing lines Coverage Δ
...ental/IntersectionTheory/src/IntersectionTheory.jl 100.00% <ø> (ø)
src/Groups/perm.jl 95.26% <100.00%> (-0.84%) ⬇️

... and 167 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@varuntrehan7 varuntrehan7 marked this pull request as ready for review October 7, 2025 05:13
Comment thread test/Groups/Permutations.jl Outdated
Copy link
Copy Markdown
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

No more objections from my side

@lgoettgens lgoettgens added the enhancement New feature or request label Oct 7, 2025
@lgoettgens lgoettgens merged commit e2bddb0 into oscar-system:master Oct 8, 2025
38 of 40 checks passed
@lgoettgens lgoettgens removed the triage label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: groups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fixed_points for permutation groups

5 participants