diff --git a/experimental/LieAlgebras/src/AbstractRootSystem.jl b/experimental/LieAlgebras/src/AbstractRootSystem.jl index 6cbbe8d33c2a..aefc4c638950 100644 --- a/experimental/LieAlgebras/src/AbstractRootSystem.jl +++ b/experimental/LieAlgebras/src/AbstractRootSystem.jl @@ -127,6 +127,16 @@ function Base.:(-)(w::WeightLatticeElem) return WeightLatticeElem(w.root_system, -w.vec) end +function Base.deepcopy_internal(w::WeightLatticeElem, dict::IdDict) + if haskey(dict, w) + return dict[w] + end + + y = WeylGroupElem(w.root_system, deepcopy_internal(w.vec, dict)) + dict[w] = y + return y +end + function expressify(w::WeightLatticeElem, s=:w; context=nothing) sum = Expr(:call, :+) for i in 1:length(w.vec) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index bbb6bda45d22..3fc17510d69e 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -30,8 +30,8 @@ function Base.IteratorSize(::WeylGroup) return Base.SizeUnkown() end -function Base.one(G::WeylGroup) - WeylGroupElem(G, []) +function Base.one(W::WeylGroup) + WeylGroupElem(W, []) end function Base.show(io::IO, W::WeylGroup) @@ -125,6 +125,16 @@ function Base.:(==)(x::WeylGroupElem, y::WeylGroupElem) return x.parent === y.parent && x.word == y.word end +function Base.deepcopy_internal(x::WeylGroupElem, dict::IdDict) + if haskey(dict, x) + return dict[x] + end + + y = WeylGroupElem(x.parent, deepcopy_internal(x.word, dict)) + dict[x] = y + return y +end + function Base.hash(x::WeylGroupElem, h::UInt) b = 0x80f0abce1c544784 % UInt h = hash(x.parent, h)