Skip to content

Commit

Permalink
Don't store substitutions in Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
SoongNoonien committed Oct 17, 2024
1 parent b58bb35 commit d99d957
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
6 changes: 4 additions & 2 deletions src/CharTable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function CharTable(order::UPoly, table::Matrix{GenericCyclo}, classinfo::Vector{
ct=CharTable(order, classinfo, classlength, classsums, classparamindex, charparamindex,
classparams, ring, information, chars, importname)
for i in 1:num_chars
ct.chars[i]=GenericCharacter(ct, table[i,:], charinfo[i], chardegree[i], charsums[i], charparams[i])
ct.chars[i]=GenericCharacter(ct, table[i,:], charinfo[i], chardegree[i], charsums[i], charparams[i], ParameterSubstitution[])
end
return ct
end
Expand Down Expand Up @@ -87,6 +87,7 @@ struct GenericCharacter <: AbstractGenericCharacter
degree::UPoly # Degree of the characters in this type
sum::Union{Function, Nothing} # Function to sum a Cyclotomic over all characters in this type
params::Parameters # Info about the parameters in this character type
substitutions::Vector{ParameterSubstitution}
end

eltype(::Type{GenericCharacter}) = GenericCyclo
Expand All @@ -105,7 +106,8 @@ function (t::CharTable)(c::GenericCharacter)
deepcopy(c.info),
deepcopy(c.degree),
deepcopy(c.sum),
deepcopy(c.params)
deepcopy(c.params),
deepcopy(c.substitutions)
)
end

Expand Down
16 changes: 8 additions & 8 deletions src/GenericCharacter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function tensor_product(char1::GenericCharacter, char2::GenericCharacter)
end
param1 = shift_char_parameters(t, char1.params, 4)
param2 = shift_char_parameters(t, char2.params, 5)
new_char_params=Parameters(vcat(param1.params, param2.params), vcat(param1.exceptions, param2.exceptions), ParameterSubstitution[])
return GenericCharacter(t, new_char_values, ["Tensor of type $char1id and $char2id"], new_char_degree, nothing, new_char_params)
new_char_params=Parameters(vcat(param1.params, param2.params), vcat(param1.exceptions, param2.exceptions))
return GenericCharacter(t, new_char_values, ["Tensor of type $char1id and $char2id"], new_char_degree, nothing, new_char_params, ParameterSubstitution[])
end

@doc raw"""
Expand Down Expand Up @@ -114,7 +114,7 @@ function omega(char::GenericCharacter)
for class in 1:number_of_conjugacy_class_types(t)
new_char_values[class]=divexact(t.classlength[class]*char[class], degree(char))
end
return GenericCharacter(t, new_char_values, ["Omega of type $charid"], new_char_degree, nothing, char.params)
return GenericCharacter(t, new_char_values, ["Omega of type $charid"], new_char_degree, nothing, char.params, ParameterSubstitution[])
end

@doc raw"""
Expand Down Expand Up @@ -204,8 +204,8 @@ function linear_combination(coeffs::Vector{Int64}, chars::Vector{<:GenericCharac
for i in 1:n
params[i]=shift_char_parameters(t, chars[i].params, 5+i)
end
new_char_params=Parameters(vcat(map(x -> x.params, params)...), vcat(map(x -> x.exceptions, params)...), ParameterSubstitution[])
return GenericCharacter(t, new_char_values, ["linear_combination $info"], new_char_degree, nothing, new_char_params)
new_char_params=Parameters(vcat(map(x -> x.params, params)...), vcat(map(x -> x.exceptions, params)...))
return GenericCharacter(t, new_char_values, ["linear_combination $info"], new_char_degree, nothing, new_char_params, ParameterSubstitution[])
end

@doc raw"""
Expand Down Expand Up @@ -391,10 +391,10 @@ function specialize(char::GenericCharacter, var::UPoly, expr::RingElement)
for class in 1:number_of_conjugacy_class_types(t)
new_char_values[class]=evaluate(char[class], [var_index(var)], [expr])
end
new_params=deepcopy(char.params)
push!(new_params.substitutions, ParameterSubstitution(var, base_ring(t.ring)(expr)))
substitutions=deepcopy(class.substitutions)
push!(substitutions, ParameterSubstitution(var, base_ring(t.ring)(expr)))
# TODO: What about the sum function here?
return GenericCharacter(t, new_char_values, char.info, degree(char), nothing, new_params)
return GenericCharacter(t, new_char_values, char.info, degree(char), nothing, char.params, substitutions)

end

Expand Down
10 changes: 1 addition & 9 deletions src/Parameter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ Parameters of generic characters and class types. This is used in `GenericCharac
struct Parameters
params::Vector{Parameter}
exceptions::Vector{UPolyFrac}
substitutions::Vector{ParameterSubstitution}
end

function Parameters(p::Vector{Parameter},e::Vector{UPolyFrac})
return Parameters(p,e,ParameterSubstitution[])
end

function Parameters(p::Vector{Parameter})
return Parameters(p,UPolyFrac[],ParameterSubstitution[])
return Parameters(p,UPolyFrac[])
end

# TODO Use OSCAR's expressify system here.
Expand All @@ -57,7 +52,4 @@ function show(io::IO, a::Parameters)
end
end
end
if !isempty(a.substitutions)
print(io, ", substitutions: $(join(a.substitutions, ", "))")
end
end
6 changes: 1 addition & 5 deletions src/Shifts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@ end
function var_shift(a::Parameter, vars::Vector{Int64}, step_size::Int64, steps::Int64)
return Parameter(var_shift(a.var, vars, step_size, steps), a.modulus)
end
function var_shift(a::ParameterSubstitution, vars::Vector{Int64}, step_size::Int64, steps::Int64)
return ParameterSubstitution(var_shift(a.var, vars, step_size, steps), var_shift(a.expression, vars, step_size, steps))
end
function var_shift(a::Parameters, vars::Vector{Int64}, step_size::Int64, steps::Int64)
return Parameters(var_shift.(a.params, Ref(vars),Ref(step_size), Ref(steps)),
var_shift.(a.exceptions, Ref(vars),Ref(step_size), Ref(steps)),
var_shift.(a.substitutions, Ref(vars),Ref(step_size), Ref(steps)))
var_shift.(a.exceptions, Ref(vars),Ref(step_size), Ref(steps)))
end

@doc raw"""
Expand Down
6 changes: 5 additions & 1 deletion src/Show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function show(io::IO, ::MIME"text/plain", c::AbstractGenericCharacter)
println(io, "Generic character of ", parent(c).importname, Indent())
if c isa GenericCharacter && !isempty(c.params.params)
println(io, "with parameters ", Indent())
println(io, c.params, Dedent())
println(io, c.params)
if !isempty(c.substitutions)
print(io, ", substitutions: $(join(c.substitutions, ", "))")
end
println(io, Dedent())
end
println(io, "of degree ", degree(c))
print(io, "with values", Indent())
Expand Down

0 comments on commit d99d957

Please sign in to comment.