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

wrong show for group algebra #80

Open
kalmarek opened this issue Jul 4, 2024 · 6 comments
Open

wrong show for group algebra #80

kalmarek opened this issue Jul 4, 2024 · 6 comments

Comments

@kalmarek
Copy link
Owner

kalmarek commented Jul 4, 2024

current:

julia> Z
1·Permutation{Perm{UInt16}, PermGroup{Perm{UInt16}, Transversal{UInt16, Perm{UInt16}}}} () + 1·Permutation{Perm{UInt16}, PermGroup{Perm{UInt16}, Transversal{UInt16, Perm{UInt16}}}} (1,2,3)

expected/was

julia> Z
1·() + 1·(1,2,3)

@blegat you touched the show at latest.
If everything seems ok here, what are the show methods one need to implement in PermutationGroups and/or AbstractPermutations.jl?

@blegat
Copy link
Collaborator

blegat commented Jul 4, 2024

It seems that show is the issue:

julia> G = PermGroup(perm"(1,2,3,4,5,6)", perm"(1,2)")
Permutation group on 2 generators generated by
 (1,2,3,4,5,6)
 (1,2)

julia> g = first(G)
()

julia> show(g)
Perm{UInt16} ()0

julia> show(stdout, MIME"text/plain"(), g)
Perm{UInt16} ()

@kalmarek
Copy link
Owner Author

kalmarek commented Jul 4, 2024

No, I guess the issue is that we're loosing io context somehow on the way:

julia> show(IOContext(stdout), MIME"text/plain"(), s1)
Permutation{Perm{UInt16}, PermGroup{Perm{UInt16}, Transversal{UInt16, Perm{UInt16}}}} (1,2,3)
julia> show(IOContext(stdout, :compact => true), MIME"text/plain"(), s1)
(1,2,3)
julia> show(IOContext(stdout, :compact => true), MIME"text/plain"(), Z)
1·Permutation{Perm{UInt16}, PermGroup{Perm{UInt16}, Transversal{UInt16, Perm{UInt16}}}} () + 1·Permutation{Perm{UInt16}, PermGroup{Perm{UInt16}, Transversal{UInt16, Perm{UInt16}}}} (1,2,3)

@blegat
Copy link
Collaborator

blegat commented Jul 4, 2024

This is not what I see

julia> g = collect(G)[3]
(3,4,6)

julia> show(IOContext(stdout, :compact => true), MIME"text/plain"(), g)
Perm{UInt16} (3,4,6)
julia> show(stdout, MIME"text/plain"(), g)
Perm{UInt16} (3,4,6)

@kalmarek
Copy link
Owner Author

kalmarek commented Jul 4, 2024

try with :limit=>true (which is set by repl btw.)
the thing with compact is already on its way in AbstractPermutations ;)

@blegat
Copy link
Collaborator

blegat commented Jul 4, 2024

Indeed, now I get the same, now idea how it gets lost though

julia> show(IOContext(stdout, :compact => true, :limit=>true), MIME"text/plain"(), g)
(3,4,6)

Maybe because showable returns false here
https://github.com/JuliaAlgebra/StarAlgebras.jl/blob/f998c9f7782e1f3a2f2616b544a3901ede0ba9dc/src/show.jl#L61-L65

@kalmarek
Copy link
Owner Author

kalmarek commented Jul 4, 2024

hmm, even then it should print just fine:

julia> show(IOContext(stdout, :limit=>true), g)
(1,3,2)0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants