From 1ec650daaa26ed17da5b1769b7637798cde1d33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 22 Feb 2024 17:10:31 +0100 Subject: [PATCH] Adapt to Lie algebra module changes --- src/DeformationBases/ArcDiagDeformBasis.jl | 170 ++++++++-------- .../PseudographDeformBasis.jl | 5 +- src/ModuleSimpleStructure.jl | 111 +++++----- src/OscarPatches.jl | 21 ++ src/PBWDeformations.jl | 5 + test/DeformationBases-test.jl | 14 +- test/ModuleSimpleStructure-test.jl | 192 +++++++++--------- test/SmashProductLie-test.jl | 2 +- test/SmashProductLieDeform-test.jl | 8 +- test/SmashProductPBWDeformLie-test.jl | 4 +- 10 files changed, 266 insertions(+), 266 deletions(-) create mode 100644 src/OscarPatches.jl diff --git a/src/DeformationBases/ArcDiagDeformBasis.jl b/src/DeformationBases/ArcDiagDeformBasis.jl index 2d37b91..8a7d97a 100644 --- a/src/DeformationBases/ArcDiagDeformBasis.jl +++ b/src/DeformationBases/ArcDiagDeformBasis.jl @@ -32,22 +32,24 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C} V = base_module(sp) V_nice, h = isomorphic_module_with_simple_structure(V) - if !is_direct_sum(V_nice) + fl, V_nice_summands = is_direct_sum_with_data(V_nice) + if !fl temp = direct_sum(V_nice) h = compose(h, hom(V_nice, temp, identity_matrix(coefficient_ring(temp), dim(temp)))) + V_nice_summands = [V_nice] V_nice = temp end extra_data = Dict{DeformationMap{C}, Set{ArcDiagram}}() normalize = no_normalize ? identity : normalize_default - n_cases = div(length(base_modules(V_nice)) * (length(base_modules(V_nice)) + 1), 2) + n_cases = div(length(V_nice_summands) * (length(V_nice_summands) + 1), 2) lens = [] iters = [] for d in degs case = 0 - for (i_l, V_nice_summand_i_l) in enumerate(base_modules(V_nice)), - (i_r, V_nice_summand_i_r) in enumerate(base_modules(V_nice)) + for (i_l, V_nice_summand_i_l) in enumerate(V_nice_summands), + (i_r, V_nice_summand_i_r) in enumerate(V_nice_summands) if i_l > i_r continue @@ -59,7 +61,7 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C} proj_to_summand_r = compose(h, canonical_projection(V_nice, i_r)) W = if i_l == i_r - exterior_power(V_nice_summand_i_l, 2) + exterior_power_obj(V_nice_summand_i_l, 2) else tensor_product(V_nice_summand_i_l, V_nice_summand_i_r) end @@ -136,17 +138,21 @@ function is_tensor_generator(::SO, V::LieAlgebraModule) end function is_tensor_generator(::GL, V::LieAlgebraModule) - return is_standard_module(V) || (is_dual(V) && is_standard_module(base_module(V))) + if is_standard_module(V) + return true + end + fl, base = is_dual_with_data(V) + return fl && is_standard_module(base) end function arc_diagram_upper_points(T::SO, V::LieAlgebraModule) if is_standard_module(V) return 1 - elseif is_tensor_product(V) - return sum(arc_diagram_upper_points(T, W) for W in base_modules(V)) - elseif is_exterior_power(V) || is_symmetric_power(V) || is_tensor_power(V) - return arc_diagram_upper_points(T, base_module(V)) * get_attribute(V, :power) + elseif ((fl, Ws) = is_tensor_product_with_data(V); fl) + return sum(arc_diagram_upper_points(T, W) for W in Ws) + elseif ((fl, W, k) = is_power_with_data(V); fl) + return arc_diagram_upper_points(T, W) * k else error("Not implemented.") end @@ -155,12 +161,12 @@ end function arc_diagram_upper_points(T::GL, V::LieAlgebraModule) if is_standard_module(V) return 1 - elseif is_dual(V) && is_standard_module(base_module(V)) + elseif ((fl, W) = is_dual_with_data(V); fl) && is_standard_module(W) return 0 - elseif is_tensor_product(V) - return reduce(vcat, arc_diagram_upper_points(T, W) for W in base_modules(V)) - elseif is_exterior_power(V) || is_symmetric_power(V) || is_tensor_power(V) - return reduce(vcat, [arc_diagram_upper_points(T, base_module(V)) for _ in 1:get_attribute(V, :power)]) + elseif ((fl, Ws) = is_tensor_product_with_data(V); fl) + return reduce(vcat, arc_diagram_upper_points(T, W) for W in Ws) + elseif ((fl, W, k) = is_power_with_data(V); fl) + return reduce(vcat, [arc_diagram_upper_points(T, W) for _ in 1:k]) else error("Not implemented.") end @@ -178,8 +184,7 @@ end function arc_diagram_upper_iss(T::Union{SO, GL}, V::LieAlgebraModule) if is_tensor_generator(T, V) return Vector{Int}[] - elseif is_tensor_product(V) - inner_mods = base_modules(V) + elseif ((fl, inner_mods) = is_tensor_product_with_data(V); fl) offset = 0 iss = Vector{Int}[] for mod in inner_mods @@ -187,11 +192,9 @@ function arc_diagram_upper_iss(T::Union{SO, GL}, V::LieAlgebraModule) offset += arc_diagram_num_upper_points(T, mod) end return iss - elseif is_exterior_power(V) || is_symmetric_power(V) || is_tensor_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_power_with_data(V); fl) if is_tensor_generator(T, inner_mod) - if is_exterior_power(V) + if is_exterior_power_with_data(V)[1] return [collect(1:power)] else return Vector{Int}[] @@ -267,29 +270,22 @@ end function arc_diagram_label_iterator(T::Union{SO, GL}, V::LieAlgebraModule, base_labels::AbstractVector{Int}) if is_tensor_generator(T, V) return [[l] for l in base_labels] - elseif is_tensor_product(V) - inner_mods = base_modules(V) + elseif ((fl, inner_mods) = is_tensor_product_with_data(V); fl) return ProductIterator([ arc_diagram_label_iterator(T, inner_mod, base_labels) for inner_mod in reverse(inner_mods) ]) .|> reverse .|> Iterators.flatten .|> collect - elseif is_exterior_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_exterior_power_with_data(V); fl) return combinations(collect(arc_diagram_label_iterator(T, inner_mod, base_labels)), power) .|> Iterators.flatten .|> collect - elseif is_symmetric_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_symmetric_power_with_data(V); fl) return multicombinations(collect(arc_diagram_label_iterator(T, inner_mod, base_labels)), power) .|> Iterators.flatten .|> collect - elseif is_tensor_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_tensor_power_with_data(V); fl) return ProductIterator(arc_diagram_label_iterator(T, inner_mod, base_labels), power) .|> reverse .|> Iterators.flatten .|> @@ -301,20 +297,13 @@ end function basis_index_mapping(V::LieAlgebraModule) - if is_tensor_product(V) - inner_mods = base_modules(V) + if ((fl, inner_mods) = is_tensor_product_with_data(V); fl) return ProductIterator([1:dim(inner_mod) for inner_mod in reverse(inner_mods)]) .|> reverse .|> collect - elseif is_exterior_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_exterior_power_with_data(V); fl) return combinations(dim(inner_mod), power) .|> collect - elseif is_symmetric_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_symmetric_power_with_data(V); fl) return multicombinations(dim(inner_mod), power) .|> collect - elseif is_tensor_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_tensor_power_with_data(V); fl) return ProductIterator(1:dim(inner_mod), power) .|> reverse .|> collect else error("Not implemented.") @@ -326,8 +315,7 @@ function arc_diagram_label_permutations(T::Union{SO, GL}, V::LieAlgebraModule, l if is_tensor_generator(T, V) @req length(label) == 1 "Number of labels mismatch." return [(label, 1)] - elseif is_tensor_product(V) - inner_mods = base_modules(V) + elseif ((fl, inner_mods) = is_tensor_product_with_data(V); fl) @req length(label) == sum(mod -> arc_diagram_num_upper_points(T, mod), inner_mods) "Number of labels mismatch." return [ begin @@ -346,45 +334,43 @@ function arc_diagram_label_permutations(T::Union{SO, GL}, V::LieAlgebraModule, l ) for (i, inner_mod) in enumerate(inner_mods) ]) ] - elseif is_exterior_power(V) || is_symmetric_power(V) || is_tensor_power(V) - inner_mod = base_module(V) - power = get_attribute(V, :power) + elseif ((fl, inner_mod, power) = is_exterior_power_with_data(V); fl) m = arc_diagram_num_upper_points(T, inner_mod) @req length(label) == m * power "Number of labels mismatch." - if is_exterior_power(V) - return [ - begin - inner_label = reduce(vcat, first.(inner_iter)) - inner_sign = prod(last.(inner_iter)) - (inner_label, inner_sign * outer_sign) - end for (outer_perm, outer_sign) in permutations_with_sign(1:power) for inner_iter in ProductIterator([ - arc_diagram_label_permutations(T, inner_mod, label[(outer_perm[i]-1)*m+1:outer_perm[i]*m]) for - i in 1:power - ]) - ] - elseif is_symmetric_power(V) - return [ - begin - inner_label = reduce(vcat, first.(inner_iter)) - inner_sign = prod(last.(inner_iter)) - (inner_label, inner_sign) - end for outer_perm in permutations(1:power) for inner_iter in ProductIterator([ - arc_diagram_label_permutations(T, inner_mod, label[(outer_perm[i]-1)*m+1:outer_perm[i]*m]) for - i in 1:power - ]) - ] - elseif is_tensor_power(V) - return [ - begin - inner_label = reduce(vcat, first.(inner_iter)) - inner_sign = prod(last.(inner_iter)) - (inner_label, inner_sign) - end for inner_iter in - ProductIterator([arc_diagram_label_permutations(T, inner_mod, label[(i-1)*m+1:i*m]) for i in 1:power]) - ] - else - error("Unreachable.") - end + return [ + begin + inner_label = reduce(vcat, first.(inner_iter)) + inner_sign = prod(last.(inner_iter)) + (inner_label, inner_sign * outer_sign) + end for (outer_perm, outer_sign) in permutations_with_sign(1:power) for inner_iter in ProductIterator([ + arc_diagram_label_permutations(T, inner_mod, label[(outer_perm[i]-1)*m+1:outer_perm[i]*m]) for + i in 1:power + ]) + ] + elseif ((fl, inner_mod, power) = is_symmetric_power_with_data(V); fl) + m = arc_diagram_num_upper_points(T, inner_mod) + @req length(label) == m * power "Number of labels mismatch." + return [ + begin + inner_label = reduce(vcat, first.(inner_iter)) + inner_sign = prod(last.(inner_iter)) + (inner_label, inner_sign) + end for outer_perm in permutations(1:power) for inner_iter in ProductIterator([ + arc_diagram_label_permutations(T, inner_mod, label[(outer_perm[i]-1)*m+1:outer_perm[i]*m]) for + i in 1:power + ]) + ] + elseif ((fl, inner_mod, power) = is_tensor_power_with_data(V); fl) + m = arc_diagram_num_upper_points(T, inner_mod) + @req length(label) == m * power "Number of labels mismatch." + return [ + begin + inner_label = reduce(vcat, first.(inner_iter)) + inner_sign = prod(last.(inner_iter)) + (inner_label, inner_sign) + end for inner_iter in + ProductIterator([arc_diagram_label_permutations(T, inner_mod, label[(i-1)*m+1:i*m]) for i in 1:power]) + ] else error("Not implemented.") end @@ -404,7 +390,7 @@ function arcdiag_to_deformationmap( T::GL, diag::ArcDiagramDirected, sp::SmashProductLie{C}, - W::LieAlgebraModule=exterior_power(base_module(sp), 2), + W::LieAlgebraModule=exterior_power_obj(base_module(sp), 2), ) where {C <: RingElem} return arcdiag_to_deformationmap(T, arc_diagram(Undirected, diag), sp, W) end @@ -413,20 +399,24 @@ function arcdiag_to_deformationmap( T::Union{SO, GL}, diag::ArcDiagramUndirected, sp::SmashProductLie{C}, - W::LieAlgebraModule=exterior_power(base_module(sp), 2), + W::LieAlgebraModule=exterior_power_obj(base_module(sp), 2), ) where {C <: RingElem} - @req !is_direct_sum(W) "Not permitted for direct sums." + @req !is_direct_sum_with_data(W)[1] "Not permitted for direct sums." ind_map = basis_index_mapping(W) dim_stdmod_V = base_lie_algebra(sp).n iso_pair_to_L = arc_diagram_lower_pair_to_L(T, dim_stdmod_V) + case = :unknown - if is_exterior_power(W) - nrows_kappa = ncols_kappa = dim(base_module(W)) - elseif is_tensor_product(W) - nrows_kappa, ncols_kappa = dim.(base_modules(W)) + if ((fl, Wbase, k) = is_exterior_power_with_data(W); fl) + @assert k == 2 + nrows_kappa = ncols_kappa = dim(Wbase) + case = :exterior_power + elseif ((fl, W_factors) = is_tensor_product_with_data(W); fl) + nrows_kappa, ncols_kappa = dim.(W_factors) + case = :tensor_product end kappa = zero_matrix(underlying_algebra(sp), nrows_kappa, ncols_kappa) @@ -447,7 +437,7 @@ function arcdiag_to_deformationmap( entry = _normal_form(entry, sp.rels) kappa[i, j] += entry - if is_exterior_power(W) + if case == :exterior_power kappa[j, i] -= entry end end diff --git a/src/DeformationBases/PseudographDeformBasis.jl b/src/DeformationBases/PseudographDeformBasis.jl index 44260b9..28422d8 100644 --- a/src/DeformationBases/PseudographDeformBasis.jl +++ b/src/DeformationBases/PseudographDeformBasis.jl @@ -27,9 +27,8 @@ struct PseudographDeformBasis{C <: RingElem} <: DeformBasis{C} degs::AbstractVector{Int}; no_normalize::Bool=false, ) where {C <: RingElem} - @req is_exterior_power(base_module(sp)) && is_standard_module(base_module(base_module(sp))) "Only works for exterior powers of the standard module." - - e = get_attribute(base_module(sp), :power) + fl, Vbase, e = is_exterior_power_with_data(base_module(sp)) + @req fl && is_standard_module(Vbase) "Only works for exterior powers of the standard module." extra_data = Dict{DeformationMap{C}, Set{Tuple{PseudographLabelled{Int}, Partition{Int}}}}() normalize = no_normalize ? identity : normalize_default diff --git a/src/ModuleSimpleStructure.jl b/src/ModuleSimpleStructure.jl index cad6610..40de26d 100644 --- a/src/ModuleSimpleStructure.jl +++ b/src/ModuleSimpleStructure.jl @@ -1,30 +1,24 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) if is_standard_module(V) return V, identity_map(V) - elseif is_dual(V) - B = base_module(V) + elseif ((fl, B) = is_dual_with_data(V); fl) if is_standard_module(B) return V, identity_map(V) end - if is_dual(B) - U = base_module(B) + if ((fl, U) = is_dual_with_data(B); fl) V_to_U = hom(V, U, identity_matrix(coefficient_ring(V), dim(V)); check=false) - elseif is_direct_sum(B) - U = direct_sum(dual.(base_modules(B))...) + elseif ((fl, Cs) = is_direct_sum_with_data(B); fl) + U = direct_sum(dual.(Cs)...) V_to_U = hom(V, U, identity_matrix(coefficient_ring(V), dim(V)); check=false) - elseif is_tensor_product(B) - U = tensor_product(dual.(base_modules(B))...) + elseif ((fl, Cs) = is_tensor_product_with_data(B); fl) + U = tensor_product(dual.(Cs)...) V_to_U = hom(V, U, identity_matrix(coefficient_ring(V), dim(V)); check=false) - elseif is_exterior_power(B) - C = base_module(B) - k = get_attribute(B, :power) - U = exterior_power(dual(base_module(B)), k) + elseif ((fl, C, k) = is_exterior_power_with_data(B); fl) + U = exterior_power_obj(dual(C), k) V_to_U = hom(V, U, identity_matrix(coefficient_ring(V), dim(V)); check=false) - elseif is_symmetric_power(B) - C = base_module(B) - k = get_attribute(B, :power) - inv_pure = get_attribute(B, :symmetric_pure_preimage_function) - U = symmetric_power(dual(base_module(B)), k) + elseif ((fl, C, k) = is_symmetric_power_with_data(B); fl) + inv_pure = inv(get_attribute(B, :mult_pure_function)) + U = symmetric_power_obj(dual(C), k) mat = zero_matrix(coefficient_ring(V), dim(V), dim(V)) for i in 1:dim(B) pure_factors = inv_pure(basis(B, i)) @@ -32,24 +26,21 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) div(factorial(k), prod(factorial(count(==(xj), pure_factors)) for xj in unique(pure_factors))) end V_to_U = hom(V, U, mat; check=false) - elseif is_tensor_power(B) - C = base_module(B) - k = get_attribute(B, :power) - U = tensor_power(dual(base_module(B)), k) + elseif ((fl, C, k) = is_tensor_power_with_data(B); fl) + U = tensor_power_obj(dual(C), k) V_to_U = hom(V, U, identity_matrix(coefficient_ring(V), dim(V)); check=false) end W, U_to_W = isomorphic_module_with_simple_structure(U) V_to_W = compose(V_to_U, U_to_W) return W, V_to_W - elseif is_direct_sum(V) - Bs = base_modules(V) + elseif ((fl, Bs) = is_direct_sum_with_data(V); fl) Cs_with_hom = [isomorphic_module_with_simple_structure(B) for B in Bs] Csum = direct_sum([C for (C, _) in Cs_with_hom]...) V_to_Csum = hom_direct_sum(V, Csum, [B_to_C for (_, B_to_C) in Cs_with_hom]) Ds = [] for (C, _) in Cs_with_hom - if is_direct_sum(C) - push!(Ds, base_modules(C)...) + if ((fl, C_summands) = is_direct_sum_with_data(C); fl) + push!(Ds, C_summands...) else push!(Ds, C) end @@ -64,15 +55,14 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) Csum_to_W = hom(Csum, W, identity_matrix(coefficient_ring(V), dim(Csum)); check=false) V_to_W = compose(V_to_Csum, Csum_to_W) return W, V_to_W - elseif is_tensor_product(V) - Bs = base_modules(V) + elseif ((fl, Bs) = is_tensor_product_with_data(V); fl) Cs_with_hom = [isomorphic_module_with_simple_structure(B) for B in Bs] Cprod = tensor_product([C for (C, _) in Cs_with_hom]...) V_to_Cprod = hom_tensor(V, Cprod, [B_to_C for (_, B_to_C) in Cs_with_hom]) Ds = [] for (C, _) in Cs_with_hom - if is_tensor_product(C) - push!(Ds, base_modules(C)...) + if ((fl, C_factors) = is_tensor_product_with_data(C); fl) + push!(Ds, C_factors...) else push!(Ds, C) end @@ -90,25 +80,29 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) if length(Ds) == 1 return U, V_to_U end - if all(!is_direct_sum, Ds) + if all(D -> !is_direct_sum_with_data(D)[1], Ds) W = U U_to_W = identity_map(U) else - Es = [is_direct_sum(D) ? D : direct_sum(D) for D in Ds] + Es_with_summands = [ + ((fl, D_summands) = is_direct_sum_with_data(D); fl) ? (D, D_summands) : (direct_sum(D), [D]) for D in Ds + ] Fs = [] - inv_pure = get_attribute(U, :tensor_pure_preimage_function) + inv_pure = inv(get_attribute(U, :tensor_pure_function)) mat = zero_matrix(coefficient_ring(U), dim(U), dim(U)) dim_accum = 0 - for summ_comb in reverse.(ProductIterator(reverse([1:length(base_modules(E)) for E in Es]))) - F = tensor_product([base_modules(E)[i] for (E, i) in zip(Es, summ_comb)]...) + for summ_comb in + reverse.(ProductIterator(reverse([1:length(E_summands) for (_, E_summands) in Es_with_summands]))) + F = tensor_product([E_summands[i] for ((_, E_summands), i) in zip(Es_with_summands, summ_comb)]...) for (i, bi) in enumerate(basis(U)) pure_factors = inv_pure(bi) dsmap = [ begin local j, pr_f - projs = canonical_projections(Es[i]) - if parent(f) !== Es[i] - f = Es[i]([f]) + Ei = Es_with_summands[i][1] + projs = canonical_projections(Ei) + if parent(f) !== Ei + f = Ei([f]) end for outer j in 1:length(projs) pr_f = projs[j](f) @@ -119,8 +113,8 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) (j, pr_f) end for (i, f) in enumerate(pure_factors) ] - if [dsmap[l][1] for l in 1:length(Es)] == summ_comb - img = F([dsmap[j][2] for (j, E) in enumerate(Es)]) + if [dsmap[l][1] for l in 1:length(Es_with_summands)] == summ_comb + img = F([dsmap[j][2] for j in 1:length(Es_with_summands)]) mat[i, dim_accum+1:dim_accum+dim(F)] = Oscar.LieAlgebras._matrix(img) end end @@ -132,9 +126,7 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) end V_to_W = compose(V_to_U, U_to_W) return W, V_to_W - elseif is_exterior_power(V) - B = base_module(V) - k = get_attribute(V, :power) + elseif ((fl, B, k) = is_exterior_power_with_data(V); fl) C, B_to_C = isomorphic_module_with_simple_structure(B) if k == 1 U = C @@ -142,19 +134,18 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) V_to_U = compose(V_to_B, B_to_C) return U, V_to_U end - U = exterior_power(C, k) + U = exterior_power_obj(C, k) V_to_U = hom(V, U, B_to_C) - if is_direct_sum(C) - Ds = base_modules(C) + if ((fl, Ds) = is_direct_sum_with_data(C); fl) m = length(Ds) Es = [] - inv_pure = get_attribute(U, :exterior_pure_preimage_function) + inv_pure = inv(get_attribute(U, :wedge_pure_function)) projs = canonical_projections(C) mat = zero_matrix(coefficient_ring(U), dim(U), dim(U)) dim_accum = 0 for summ_comb in multicombinations(m, k) lambda = [count(==(i), summ_comb) for i in 1:m] - factors = [lambda[i] != 0 ? exterior_power(Ds[i], lambda[i]) : nothing for i in 1:m] + factors = [lambda[i] != 0 ? exterior_power_obj(Ds[i], lambda[i]) : nothing for i in 1:m] factors_cleaned = filter(!isnothing, factors) E = tensor_product(factors_cleaned...) for (i, bi) in enumerate(basis(U)) @@ -192,9 +183,7 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) end V_to_W = compose(V_to_U, U_to_W) return W, V_to_W - elseif is_symmetric_power(V) - B = base_module(V) - k = get_attribute(V, :power) + elseif ((fl, B, k) = is_symmetric_power_with_data(V); fl) C, B_to_C = isomorphic_module_with_simple_structure(B) if k == 1 U = C @@ -202,19 +191,18 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) V_to_U = compose(V_to_B, B_to_C) return U, V_to_U end - U = symmetric_power(C, k) + U = symmetric_power_obj(C, k) V_to_U = hom(V, U, B_to_C) - if is_direct_sum(C) - Ds = base_modules(C) + if ((fl, Ds) = is_direct_sum_with_data(C); fl) m = length(Ds) Es = [] - inv_pure = get_attribute(U, :symmetric_pure_preimage_function) + inv_pure = inv(get_attribute(U, :mult_pure_function)) projs = canonical_projections(C) mat = zero_matrix(coefficient_ring(U), dim(U), dim(U)) dim_accum = 0 for summ_comb in multicombinations(m, k) lambda = [count(==(i), summ_comb) for i in 1:m] - factors = [lambda[i] != 0 ? symmetric_power(Ds[i], lambda[i]) : nothing for i in 1:m] + factors = [lambda[i] != 0 ? symmetric_power_obj(Ds[i], lambda[i]) : nothing for i in 1:m] factors_cleaned = filter(!isnothing, factors) E = tensor_product(factors_cleaned...) for (i, bi) in enumerate(basis(U)) @@ -252,9 +240,7 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) end V_to_W = compose(V_to_U, U_to_W) return W, V_to_W - elseif is_tensor_power(V) - B = base_module(V) - k = get_attribute(V, :power) + elseif ((fl, B, k) = is_tensor_power_with_data(V); fl) C, B_to_C = isomorphic_module_with_simple_structure(B) if k == 1 U = C @@ -262,19 +248,18 @@ function isomorphic_module_with_simple_structure(V::LieAlgebraModule) V_to_U = compose(V_to_B, B_to_C) return U, V_to_U end - U = tensor_power(C, k) + U = tensor_power_obj(C, k) V_to_U = hom(V, U, B_to_C) - if is_direct_sum(C) - Ds = base_modules(C) + if ((fl, Ds) = is_direct_sum_with_data(C); fl) m = length(Ds) Es = [] - inv_pure = get_attribute(U, :tensor_pure_preimage_function) + inv_pure = inv(get_attribute(U, :tensor_pure_function)) projs = canonical_projections(C) mat = zero_matrix(coefficient_ring(U), dim(U), dim(U)) dim_accum = 0 for summ_comb in ProductIterator(1:m, k) lambda = [count(==(i), summ_comb) for i in 1:m] - factors = [lambda[i] != 0 ? tensor_power(Ds[i], lambda[i]) : nothing for i in 1:m] + factors = [lambda[i] != 0 ? tensor_power_obj(Ds[i], lambda[i]) : nothing for i in 1:m] factors_cleaned = filter(!isnothing, factors) E = tensor_product(factors_cleaned...) for (i, bi) in enumerate(basis(U)) diff --git a/src/OscarPatches.jl b/src/OscarPatches.jl new file mode 100644 index 0000000..63416af --- /dev/null +++ b/src/OscarPatches.jl @@ -0,0 +1,21 @@ +function is_power_with_data(V::LieAlgebraModule) + data = is_exterior_power_with_data(V) + data[1] && return data + data = is_symmetric_power_with_data(V) + data[1] && return data + data = is_tensor_power_with_data(V) + return data +end + + +function exterior_power_obj(V::LieAlgebraModule, k::Int) + return exterior_power(V, k)[1] +end + +function symmetric_power_obj(V::LieAlgebraModule, k::Int) + return symmetric_power(V, k)[1] +end + +function tensor_power_obj(V::LieAlgebraModule, k::Int) + return tensor_power(V, k)[1] +end diff --git a/src/PBWDeformations.jl b/src/PBWDeformations.jl index e04bfff..70a5524 100644 --- a/src/PBWDeformations.jl +++ b/src/PBWDeformations.jl @@ -76,6 +76,7 @@ export deform export edge_labels export edges export exterior_power +export exterior_power_obj export general_linear_lie_algebra export inneighbor export inneighbors @@ -100,7 +101,9 @@ export special_orthogonal_lie_algebra export standard_module export symmetric_deformation export symmetric_power +export symmetric_power_obj export tensor_power +export tensor_power_obj export to_arcdiag export underlying_algebra export upper_vertex, is_upper_vertex @@ -112,6 +115,8 @@ function __init__() add_verbose_scope(:PBWDeformations) end +include("OscarPatches.jl") + include("ModuleSimpleStructure.jl") include("DeformationBases/DeformBasis.jl") diff --git a/test/DeformationBases-test.jl b/test/DeformationBases-test.jl index c96ff5d..b595ad1 100644 --- a/test/DeformationBases-test.jl +++ b/test/DeformationBases-test.jl @@ -3,7 +3,7 @@ @testset "arcdiag_to_deformationmap(:special_orthogonal, :exterior)" begin L = special_orthogonal_lie_algebra(QQ, 4) T = Val(:special_orthogonal) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @testset "not all specialisations are zero" begin @@ -24,7 +24,7 @@ @testset "correctness regression" begin @testset "SO_4, ⋀²V" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, ArcDiagDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == @@ -58,7 +58,7 @@ @testset "SO_5, ⋀²V" begin L = special_orthogonal_lie_algebra(QQ, 5) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, ArcDiagDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == @@ -81,7 +81,7 @@ @testset "SO_4, S²V" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = symmetric_power(standard_module(L), 2) + V = symmetric_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, ArcDiagDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == @@ -97,7 +97,7 @@ @testset "SO_5, S²V" begin L = special_orthogonal_lie_algebra(QQ, 5) - V = symmetric_power(standard_module(L), 2) + V = symmetric_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, ArcDiagDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == @@ -118,7 +118,7 @@ @testset "correctness regression" begin @testset "SO_4, ⋀²V" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, PseudographDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == @@ -152,7 +152,7 @@ @testset "SO_5, ⋀²V" begin L = special_orthogonal_lie_algebra(QQ, 5) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @test all_pbwdeformations(sp, PseudographDeformBasis{QQFieldElem}(sp, 0:0); special_return=SMat)[1] == diff --git a/test/ModuleSimpleStructure-test.jl b/test/ModuleSimpleStructure-test.jl index 2461891..1e5e051 100644 --- a/test/ModuleSimpleStructure-test.jl +++ b/test/ModuleSimpleStructure-test.jl @@ -47,11 +47,11 @@ end @testset "Duality, exterior power, k = $k" for k in 2:3 - V = dual(exterior_power(stdV, k)) + V = dual(exterior_power_obj(stdV, k)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == exterior_power(dual(stdV), k) + @test W == exterior_power_obj(dual(stdV), k) if k == 2 @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1 ∧ v_2)*, (v_1 ∧ v_3)*, (v_2 ∧ v_3)*]" @@ -61,11 +61,11 @@ end @testset "Duality, symmetric power, k = $k" for k in 2:5 - V = dual(symmetric_power(stdV, k)) + V = dual(symmetric_power_obj(stdV, k)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == symmetric_power(dual(stdV), k) + @test W == symmetric_power_obj_obj(dual(stdV), k) if k == 2 @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1^2)*, (v_1*v_2)*, (v_1*v_3)*, (v_2^2)*, (v_2*v_3)*, (v_3^2)*]" @@ -75,11 +75,11 @@ end @testset "Duality, tensor power, k = $k" for k in 2:5 - V = dual(tensor_power(stdV, k)) + V = dual(tensor_power_obj(stdV, k)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == tensor_power(dual(stdV), k) + @test W == tensor_power_obj_obj(dual(stdV), k) if k == 2 @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1 ⊗ v_1)*, (v_1 ⊗ v_2)*, (v_1 ⊗ v_3)*, (v_2 ⊗ v_1)*, (v_2 ⊗ v_2)*, (v_2 ⊗ v_3)*, (v_3 ⊗ v_1)*, (v_3 ⊗ v_2)*, (v_3 ⊗ v_3)*]" @@ -89,19 +89,19 @@ end @testset "Direct sum: one summand" begin - V = direct_sum(exterior_power(stdV, 2)) + V = direct_sum(exterior_power_obj(stdV, 2)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == exterior_power(stdV, 2) + @test W == exterior_power_obj(stdV, 2) @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]" @test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]" end @testset "Direct sum: 0-dim summand" begin V1 = dual(stdV) - V3 = exterior_power(stdV, 2) - for V2 in [exterior_power(stdV, dim(stdV) + 1)] + V3 = exterior_power_obj(stdV, 2) + for V2 in [exterior_power_obj(stdV, dim(stdV) + 1)] V = direct_sum(V1, V2, V3) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @@ -115,11 +115,11 @@ end @testset "Direct sum: nested" begin - V = direct_sum(direct_sum(stdV, exterior_power(stdV, 2)), dual(stdV)) + V = direct_sum(direct_sum(stdV, exterior_power_obj(stdV, 2)), dual(stdV)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == direct_sum(stdV, exterior_power(stdV, 2), dual(stdV)) + @test W == direct_sum(stdV, exterior_power_obj(stdV, 2), dual(stdV)) @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1^(1))^(1), (v_2^(1))^(1), (v_3^(1))^(1), ((v_1 ∧ v_2)^(2))^(1), ((v_1 ∧ v_3)^(2))^(1), ((v_2 ∧ v_3)^(2))^(1), (v_1*)^(2), (v_2*)^(2), (v_3*)^(2)]" @test sprint(show, h.(basis(V))) == @@ -127,19 +127,19 @@ end @testset "Tensor product: one factor" begin - V = tensor_product(exterior_power(stdV, 2)) + V = tensor_product(exterior_power_obj(stdV, 2)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == exterior_power(stdV, 2) + @test W == exterior_power_obj(stdV, 2) @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]" @test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]" end @testset "Tensor product: trivial 1-dim factor" begin V1 = dual(stdV) - V3 = exterior_power(stdV, 2) - for V2 in [tensor_power(stdV, 0), exterior_power(stdV, 0), symmetric_power(stdV, 0)] + V3 = exterior_power_obj(stdV, 2) + for V2 in [tensor_power_obj(stdV, 0), exterior_power_obj(stdV, 0), symmetric_power_obj(stdV, 0)] V = tensor_product(V1, V2, V3) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @@ -149,11 +149,11 @@ end @testset "Tensor product: nested" begin - V = tensor_product(tensor_product(stdV, exterior_power(stdV, 2)), dual(stdV)) + V = tensor_product(tensor_product(stdV, exterior_power_obj(stdV, 2)), dual(stdV)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) - @test W == tensor_product(stdV, exterior_power(stdV, 2), dual(stdV)) + @test W == tensor_product(stdV, exterior_power_obj(stdV, 2), dual(stdV)) @test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1 ⊗ (v_1 ∧ v_2)) ⊗ (v_1*), (v_1 ⊗ (v_1 ∧ v_2)) ⊗ (v_2*), (v_1 ⊗ (v_1 ∧ v_2)) ⊗ (v_3*), (v_1 ⊗ (v_1 ∧ v_3)) ⊗ (v_1*), (v_1 ⊗ (v_1 ∧ v_3)) ⊗ (v_2*), (v_1 ⊗ (v_1 ∧ v_3)) ⊗ (v_3*), (v_1 ⊗ (v_2 ∧ v_3)) ⊗ (v_1*), (v_1 ⊗ (v_2 ∧ v_3)) ⊗ (v_2*), (v_1 ⊗ (v_2 ∧ v_3)) ⊗ (v_3*), (v_2 ⊗ (v_1 ∧ v_2)) ⊗ (v_1*), (v_2 ⊗ (v_1 ∧ v_2)) ⊗ (v_2*), (v_2 ⊗ (v_1 ∧ v_2)) ⊗ (v_3*), (v_2 ⊗ (v_1 ∧ v_3)) ⊗ (v_1*), (v_2 ⊗ (v_1 ∧ v_3)) ⊗ (v_2*), (v_2 ⊗ (v_1 ∧ v_3)) ⊗ (v_3*), (v_2 ⊗ (v_2 ∧ v_3)) ⊗ (v_1*), (v_2 ⊗ (v_2 ∧ v_3)) ⊗ (v_2*), (v_2 ⊗ (v_2 ∧ v_3)) ⊗ (v_3*), (v_3 ⊗ (v_1 ∧ v_2)) ⊗ (v_1*), (v_3 ⊗ (v_1 ∧ v_2)) ⊗ (v_2*), (v_3 ⊗ (v_1 ∧ v_2)) ⊗ (v_3*), (v_3 ⊗ (v_1 ∧ v_3)) ⊗ (v_1*), (v_3 ⊗ (v_1 ∧ v_3)) ⊗ (v_2*), (v_3 ⊗ (v_1 ∧ v_3)) ⊗ (v_3*), (v_3 ⊗ (v_2 ∧ v_3)) ⊗ (v_1*), (v_3 ⊗ (v_2 ∧ v_3)) ⊗ (v_2*), (v_3 ⊗ (v_2 ∧ v_3)) ⊗ (v_3*)]" @test sprint(show, h.(basis(V))) == @@ -161,23 +161,23 @@ end @testset "Tensor product, direct sum" begin - V = tensor_product(direct_sum(stdV, symmetric_power(stdV, 2)), direct_sum(dual(stdV), stdV)) + V = tensor_product(direct_sum(stdV, symmetric_power_obj(stdV, 2)), direct_sum(dual(stdV), stdV)) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @test W == direct_sum( tensor_product(stdV, dual(stdV)), tensor_product(stdV, stdV), - tensor_product(symmetric_power(stdV, 2), dual(stdV)), - tensor_product(symmetric_power(stdV, 2), stdV), + tensor_product(symmetric_power_obj(stdV, 2), dual(stdV)), + tensor_product(symmetric_power_obj(stdV, 2), stdV), ) - V1 = exterior_power(stdV, 2) + V1 = exterior_power_obj(stdV, 2) V2 = dual(stdV) - V3 = symmetric_power(stdV, 2) + V3 = symmetric_power_obj(stdV, 2) V4 = dual(stdV) V5 = stdV - V6 = symmetric_power(stdV, 2) + V6 = symmetric_power_obj(stdV, 2) V = tensor_product(V1, direct_sum(V2, V3, V4), direct_sum(V5, V6)) W, h = isomorphic_module_with_simple_structure(V) # @test is_welldefined(h) @@ -194,7 +194,7 @@ @testset "Exterior power: 1st power" begin V1 = stdV - V = exterior_power(V1, 1) + V = exterior_power_obj(V1, 1) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @@ -204,28 +204,28 @@ @testset "Exterior power, direct sum" begin V1 = stdV V2 = dual(stdV) - V3 = exterior_power(stdV, 2) - V = exterior_power(direct_sum(V1, V2, V3), 3) + V3 = exterior_power_obj(stdV, 2) + V = exterior_power_obj(direct_sum(V1, V2, V3), 3) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @test W == direct_sum( - exterior_power(V1, 3), - tensor_product(exterior_power(V1, 2), V2), - tensor_product(exterior_power(V1, 2), V3), - tensor_product(V1, exterior_power(V2, 2)), + exterior_power_obj(V1, 3), + tensor_product(exterior_power_obj(V1, 2), V2), + tensor_product(exterior_power_obj(V1, 2), V3), + tensor_product(V1, exterior_power_obj(V2, 2)), tensor_product(V1, V2, V3), - tensor_product(V1, exterior_power(V3, 2)), - exterior_power(V2, 3), - tensor_product(exterior_power(V2, 2), V3), - tensor_product(V2, exterior_power(V3, 2)), - exterior_power(V3, 3), + tensor_product(V1, exterior_power_obj(V3, 2)), + exterior_power_obj(V2, 3), + tensor_product(exterior_power_obj(V2, 2), V3), + tensor_product(V2, exterior_power_obj(V3, 2)), + exterior_power_obj(V3, 3), ) end @testset "Symmetric power: 1st power" begin V1 = stdV - V = symmetric_power(V1, 1) + V = symmetric_power_obj(V1, 1) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @@ -235,28 +235,28 @@ @testset "Symmetric power, direct sum" begin V1 = stdV V2 = dual(stdV) - V3 = exterior_power(stdV, 2) - V = symmetric_power(direct_sum(V1, V2, V3), 3) + V3 = exterior_power_obj(stdV, 2) + V = symmetric_power_obj(direct_sum(V1, V2, V3), 3) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @test W == direct_sum( - symmetric_power(V1, 3), - tensor_product(symmetric_power(V1, 2), V2), - tensor_product(symmetric_power(V1, 2), V3), - tensor_product(V1, symmetric_power(V2, 2)), + symmetric_power_obj(V1, 3), + tensor_product(symmetric_power_obj(V1, 2), V2), + tensor_product(symmetric_power_obj(V1, 2), V3), + tensor_product(V1, symmetric_power_obj(V2, 2)), tensor_product(V1, V2, V3), - tensor_product(V1, symmetric_power(V3, 2)), - symmetric_power(V2, 3), - tensor_product(symmetric_power(V2, 2), V3), - tensor_product(V2, symmetric_power(V3, 2)), - symmetric_power(V3, 3), + tensor_product(V1, symmetric_power_obj(V3, 2)), + symmetric_power_obj(V2, 3), + tensor_product(symmetric_power_obj(V2, 2), V3), + tensor_product(V2, symmetric_power_obj(V3, 2)), + symmetric_power_obj(V3, 3), ) end @testset "Tensor power: 1st power" begin V1 = stdV - V = tensor_power(V1, 1) + V = tensor_power_obj(V1, 1) W, h = isomorphic_module_with_simple_structure(V) @test is_welldefined(h) @test is_isomorphism(h) @@ -265,40 +265,40 @@ @testset "Tensor power, direct sum" begin V1 = stdV - V2 = exterior_power(dual(stdV), 2) - V3 = exterior_power(stdV, 2) - V = tensor_power(direct_sum(V1, V2, V3), 3) + V2 = exterior_power_obj(dual(stdV), 2) + V3 = exterior_power_obj(stdV, 2) + V = tensor_power_obj(direct_sum(V1, V2, V3), 3) W, h = isomorphic_module_with_simple_structure(V) # @test is_welldefined(h) # needs 3 minutes @test is_isomorphism(h) @test W == direct_sum( - tensor_power(V1, 3), # 111 - tensor_product(tensor_power(V1, 2), V2), # 112 - tensor_product(tensor_power(V1, 2), V3), # 113 - tensor_product(tensor_power(V1, 2), V2), # 121 - tensor_product(V1, tensor_power(V2, 2)), # 122 + tensor_power_obj(V1, 3), # 111 + tensor_product(tensor_power_obj(V1, 2), V2), # 112 + tensor_product(tensor_power_obj(V1, 2), V3), # 113 + tensor_product(tensor_power_obj(V1, 2), V2), # 121 + tensor_product(V1, tensor_power_obj(V2, 2)), # 122 tensor_product(V1, V2, V3), # 123 - tensor_product(tensor_power(V1, 2), V3), # 131 + tensor_product(tensor_power_obj(V1, 2), V3), # 131 tensor_product(V1, V2, V3), # 132 - tensor_product(V1, tensor_power(V3, 2)), # 133 - tensor_product(tensor_power(V1, 2), V2), # 211 - tensor_product(V1, tensor_power(V2, 2)), # 212 + tensor_product(V1, tensor_power_obj(V3, 2)), # 133 + tensor_product(tensor_power_obj(V1, 2), V2), # 211 + tensor_product(V1, tensor_power_obj(V2, 2)), # 212 tensor_product(V1, V2, V3), # 213 - tensor_product(V1, tensor_power(V2, 2)), # 221 - tensor_power(V2, 3), # 222 - tensor_product(tensor_power(V2, 2), V3), # 223 + tensor_product(V1, tensor_power_obj(V2, 2)), # 221 + tensor_power_obj(V2, 3), # 222 + tensor_product(tensor_power_obj(V2, 2), V3), # 223 tensor_product(V1, V2, V3), # 231 - tensor_product(tensor_power(V2, 2), V3), # 232 - tensor_product(V2, tensor_power(V3, 2)), # 233 - tensor_product(tensor_power(V1, 2), V3), # 311 + tensor_product(tensor_power_obj(V2, 2), V3), # 232 + tensor_product(V2, tensor_power_obj(V3, 2)), # 233 + tensor_product(tensor_power_obj(V1, 2), V3), # 311 tensor_product(V1, V2, V3), # 312 - tensor_product(V1, tensor_power(V3, 2)), # 313 + tensor_product(V1, tensor_power_obj(V3, 2)), # 313 tensor_product(V1, V2, V3), # 321 - tensor_product(tensor_power(V2, 2), V3), # 322 - tensor_product(V2, tensor_power(V3, 2)), # 323 - tensor_product(V1, tensor_power(V3, 2)), # 331 - tensor_product(V2, tensor_power(V3, 2)), # 332 - tensor_power(V3, 3), # 333 + tensor_product(tensor_power_obj(V2, 2), V3), # 322 + tensor_product(V2, tensor_power_obj(V3, 2)), # 323 + tensor_product(V1, tensor_power_obj(V3, 2)), # 331 + tensor_product(V2, tensor_power_obj(V3, 2)), # 332 + tensor_power_obj(V3, 3), # 333 ) end @@ -307,41 +307,41 @@ V2 = dual(V1) V3 = direct_sum(V1, V2) - V_1 = exterior_power(V3, 1) + V_1 = exterior_power_obj(V3, 1) W_1, h = isomorphic_module_with_simple_structure(V_1) @test is_welldefined(h) @test is_isomorphism(h) @test W_1 == V3 - V_2 = exterior_power(V3, 2) + V_2 = exterior_power_obj(V3, 2) W_2, h = isomorphic_module_with_simple_structure(V_2) @test is_welldefined(h) @test is_isomorphism(h) - @test W_2 == direct_sum(exterior_power(V1, 2), tensor_product(V1, V2), exterior_power(V2, 2)) + @test W_2 == direct_sum(exterior_power_obj(V1, 2), tensor_product(V1, V2), exterior_power_obj(V2, 2)) - V_3 = exterior_power(V3, 3) + V_3 = exterior_power_obj(V3, 3) W_3, h = isomorphic_module_with_simple_structure(V_3) @test is_welldefined(h) @test is_isomorphism(h) @test W_3 == direct_sum( - exterior_power(V1, 3), - tensor_product(exterior_power(V1, 2), V2), - tensor_product(V1, exterior_power(V2, 2)), - exterior_power(V2, 3), + exterior_power_obj(V1, 3), + tensor_product(exterior_power_obj(V1, 2), V2), + tensor_product(V1, exterior_power_obj(V2, 2)), + exterior_power_obj(V2, 3), ) # TODO: handle zero-dim modules (e.g. 4th exterior power of 3-dim module) - V_4 = exterior_power(V3, 4) + V_4 = exterior_power_obj(V3, 4) W_4a, ha = isomorphic_module_with_simple_structure(V_4) @test is_welldefined(ha) @test is_isomorphism(ha) W_4b, hb = isomorphic_module_with_simple_structure( direct_sum( - exterior_power(V1, 4), - tensor_product(exterior_power(V1, 3), V2), - tensor_product(exterior_power(V1, 2), exterior_power(V2, 2)), - tensor_product(V1, exterior_power(V2, 3)), - exterior_power(V2, 4), + exterior_power_obj(V1, 4), + tensor_product(exterior_power_obj(V1, 3), V2), + tensor_product(exterior_power_obj(V1, 2), exterior_power_obj(V2, 2)), + tensor_product(V1, exterior_power_obj(V2, 3)), + exterior_power_obj(V2, 4), ), ) @test is_welldefined(hb) @@ -350,31 +350,31 @@ end @testset "Complex cases 2" begin - V1 = symmetric_power(stdV, 3) + V1 = symmetric_power_obj(stdV, 3) - Ve2 = dual(exterior_power(dual(V1), 2)) + Ve2 = dual(exterior_power_obj(dual(V1), 2)) We2, h = isomorphic_module_with_simple_structure(Ve2) @test is_welldefined(h) @test is_isomorphism(h) - @test We2 == exterior_power(V1, 2) + @test We2 == exterior_power_obj(V1, 2) - Ve3 = dual(exterior_power(dual(V1), 3)) + Ve3 = dual(exterior_power_obj(dual(V1), 3)) We3, h = isomorphic_module_with_simple_structure(Ve3) @test is_welldefined(h) @test is_isomorphism(h) - @test We3 == exterior_power(V1, 3) + @test We3 == exterior_power_obj(V1, 3) - Vs2 = dual(symmetric_power(dual(V1), 2)) + Vs2 = dual(symmetric_power_obj(dual(V1), 2)) Ws2, h = isomorphic_module_with_simple_structure(Vs2) @test is_welldefined(h) @test is_isomorphism(h) - @test Ws2 == symmetric_power(V1, 2) + @test Ws2 == symmetric_power_obj(V1, 2) - Vt2 = dual(tensor_power(dual(V1), 2)) + Vt2 = dual(tensor_power_obj(dual(V1), 2)) Wt2, h = isomorphic_module_with_simple_structure(Vt2) @test is_welldefined(h) @test is_isomorphism(h) - @test Wt2 == tensor_power(V1, 2) + @test Wt2 == tensor_power_obj(V1, 2) end end end diff --git a/test/SmashProductLie-test.jl b/test/SmashProductLie-test.jl index 28cb423..f1d6a39 100644 --- a/test/SmashProductLie-test.jl +++ b/test/SmashProductLie-test.jl @@ -50,7 +50,7 @@ @testset "so_4(QQ) ⋉ ⋀^2 V" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(R, L, V) diff --git a/test/SmashProductLieDeform-test.jl b/test/SmashProductLieDeform-test.jl index 8a5ade6..e4915eb 100644 --- a/test/SmashProductLieDeform-test.jl +++ b/test/SmashProductLieDeform-test.jl @@ -3,7 +3,7 @@ @testset "SmashProductLieDeform constructor" begin @testset "R = $R" for R in [QQ, cyclotomic_field(4)[1]] L = special_orthogonal_lie_algebra(R, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) kappa = zero_matrix(underlying_algebra(sp), dim(base_module(sp)), dim(base_module(sp))) @@ -59,12 +59,12 @@ for (sp, dimL, dimV) in [begin L = special_orthogonal_lie_algebra(R, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) return (sp, 6, 6) end, begin L = general_linear_lie_algebra(R, 4) - V = symmetric_power(standard_module(L), 2) + V = symmetric_power_obj(standard_module(L), 2) sp = smash_product(L, V) return (sp, 16, 10) end] @@ -101,7 +101,7 @@ @testset "R = $R" for R in [QQ, cyclotomic_field(4)[1]] L = special_orthogonal_lie_algebra(R, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) @testset "check dimensions of kappa" begin diff --git a/test/SmashProductPBWDeformLie-test.jl b/test/SmashProductPBWDeformLie-test.jl index d450e51..389978e 100644 --- a/test/SmashProductPBWDeformLie-test.jl +++ b/test/SmashProductPBWDeformLie-test.jl @@ -2,7 +2,7 @@ @testset "is_pbwdeformation" begin @testset "symmetric deformation of so_4(QQ) ⋉ ⋀^2 V" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) d = symmetric_deformation(sp) @@ -11,7 +11,7 @@ @testset "non-PBW deformations" begin L = special_orthogonal_lie_algebra(QQ, 4) - V = exterior_power(standard_module(L), 2) + V = exterior_power_obj(standard_module(L), 2) sp = smash_product(L, V) kappa = zero_matrix(underlying_algebra(sp), 6, 6)