2018-09-05 08:58:46 +02:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# Laplacians
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
2019-07-05 18:55:25 +02:00
|
|
|
function spLaplacian(RG::GroupRing, S::AbstractVector, T::Type=Float64)
|
2018-09-05 08:58:46 +02:00
|
|
|
result = RG(T)
|
2019-07-05 18:55:25 +02:00
|
|
|
result[one(RG.group)] = T(length(S))
|
2018-09-05 08:58:46 +02:00
|
|
|
for s in S
|
|
|
|
result[s] -= one(T)
|
|
|
|
end
|
|
|
|
return result
|
|
|
|
end
|
|
|
|
|
2019-07-05 18:55:25 +02:00
|
|
|
function Laplacian(S::AbstractVector{REl}, halfradius) where REl<:Union{NCRingElem, GroupElem}
|
2018-09-05 08:58:46 +02:00
|
|
|
G = parent(first(S))
|
2019-06-30 11:56:57 +02:00
|
|
|
@info "Generating metric ball of radius" radius=2halfradius
|
2019-07-05 18:55:25 +02:00
|
|
|
@time E_R, sizes = Groups.generate_balls(S, one(G), radius=2halfradius)
|
2019-02-24 00:17:20 +01:00
|
|
|
@info "Generated balls:" sizes
|
2018-09-05 08:58:46 +02:00
|
|
|
|
2019-02-24 00:17:20 +01:00
|
|
|
@info "Creating product matrix..."
|
2019-01-11 06:37:24 +01:00
|
|
|
rdict = GroupRings.reverse_dict(E_R)
|
2019-06-30 11:56:57 +02:00
|
|
|
@time pm = GroupRings.create_pm(E_R, rdict, sizes[halfradius]; twisted=true)
|
2018-09-05 08:58:46 +02:00
|
|
|
|
2019-07-05 18:55:25 +02:00
|
|
|
RG = GroupRing(G, E_R, rdict, pm)
|
2018-09-05 08:58:46 +02:00
|
|
|
Δ = spLaplacian(RG, S)
|
|
|
|
return Δ
|
|
|
|
end
|
|
|
|
|
2019-01-11 06:33:14 +01:00
|
|
|
function saveGRElem(fname::String, g::GroupRingElem)
|
2018-09-16 18:02:35 +02:00
|
|
|
RG = parent(g)
|
2019-01-11 06:33:14 +01:00
|
|
|
JLD.save(fname, "coeffs", g.coeffs, "pm", RG.pm, "G", RG.group)
|
|
|
|
end
|
|
|
|
|
|
|
|
function loadGRElem(fname::String, RG::GroupRing)
|
|
|
|
coeffs = load(fname, "coeffs")
|
|
|
|
return GroupRingElem(coeffs, RG)
|
2018-09-16 18:02:35 +02:00
|
|
|
end
|
|
|
|
|
2019-06-30 19:05:46 +02:00
|
|
|
function loadGRElem(fname::String, G::Union{Group, NCRing})
|
2019-01-11 06:33:14 +01:00
|
|
|
pm = load(fname, "pm")
|
|
|
|
RG = GroupRing(G, pm)
|
2019-04-12 23:18:48 +02:00
|
|
|
return loadGRElem(fname, RG)
|
2019-01-11 06:33:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function loadGRElem(fname::String)
|
|
|
|
pm, G = load(fname, "pm", "G")
|
|
|
|
RG = GroupRing(G, pm)
|
|
|
|
return loadGRElem(fname, RG)
|
2018-09-05 08:58:46 +02:00
|
|
|
end
|