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 show for RelativeBrauerGroupElem #3373

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions experimental/GModule/GaloisCohomology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Oscar.GrpCoh: CoChain, MultGrpElem, MultGrp, GModule, is_consistent,
Group
import Base: parent
import Oscar: direct_sum
import Oscar: pretty, Lowercase
import Oscar: pretty, Lowercase, Indent, Dedent

export is_coboundary, idel_class_gmodule, relative_brauer_group
export local_invariants, global_fundamental_class, shrink
Expand Down Expand Up @@ -1398,14 +1398,12 @@ end

function Base.show(io::IO, m::MIME"text/plain", a::RelativeBrauerGroupElem)
io = pretty(io)
print(io, "Element of relative Brauer group of $(parent(a).k)\n")
ioC = IOContext(io, :supercompact => true, :compact => true)
print(io, "Element of relative Brauer group of ", Lowercase(), parent(a).k)
io = IOContext(io, :supercompact => true, :compact => true)
print(io, Indent())
for (p,v) = a.data
show(ioC, p)
print(io, " -> ")
show(ioC, v)
print(io, "\n")
data = sort(collect(a.data); by =(x -> first(x) isa AbsSimpleNumFieldEmbedding ? Inf : minimum(first(x))))
for (p,v) in data
print(io, "\n", p, " -> ", v)
end
print(io, Dedent())
end
Expand Down Expand Up @@ -1514,6 +1512,30 @@ an infinite direct sum of the local Brauer groups.

The second return value is a map translating between the local data
and explicit 2-cochains.

```jldoctest
julia> G = SL(2,5)
SL(2,5)

julia> T = character_table(G);

julia> R = gmodule(T[9])
G-module for G acting on vector space of dimension 6 over abelian closure of Q

julia> S = gmodule(CyclotomicField, R)
G-module for G acting on vector space of dimension 6 over cyclotomic field of order 5

julia> B, mB = relative_brauer_group(base_ring(S), character_field(S));

julia> B
Relative Brauer group for cyclotomic field of order 5 over number field of degree 1 over QQ

julia> b = B(S)
Element of relative Brauer group of number field of degree 1 over QQ
<2, 2> -> 1//2 + Z
<5, 5> -> 0 + Z
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems the order in which these three lines are printed is not stable, hence some of the doctest CI jobs fail :/

Copy link
Member

Choose a reason for hiding this comment

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

Is there a canonical way to sort them (for a consistent printing)? If not, you might use a doctest-filter

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see a good way to sort the keys in general, they are ideals in a number field, or field embeddings. But we could make sure that the ideals come first. And perhaps the ideals could be sorted by minimum or norm. That won't give a unique sorting in all cases, but it is good enough for this example and it probably is nice for the user overall. Will do that for now.

@fieker I also wonder if we should print something nicer instead of "Complex embedding of number field"?

Complex embedding of number field -> 1//2 + Z
```
"""
function relative_brauer_group(K::AbsSimpleNumField, k::Union{QQField, AbsSimpleNumField} = QQ)
G, mG = automorphism_group(PermGroup, K)
Expand Down
Loading