Skip to content

Commit

Permalink
Move some checks to arc diag creation iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Dec 5, 2024
1 parent 8a1cbbc commit c5a8b04
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/DeformationBases/ArcDiagDeformBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct ArcDiagDeformBasis{T <: SmashProductLieElem} <: DeformBasis{T}
case = :tensor_product

Check warning on line 72 in src/DeformationBases/ArcDiagDeformBasis.jl

View check run for this annotation

Codecov / codecov/patch

src/DeformationBases/ArcDiagDeformBasis.jl#L71-L72

Added lines #L71 - L72 were not covered by tests
end

diag_iter = pbw_arc_diagrams(LieType, W, d)
diag_iter = pbw_arc_diagrams(LieType, W, d; case, check_all_diagrams)
len = length(diag_iter)
iter = (
begin
Expand Down Expand Up @@ -127,12 +127,22 @@ end
Base.length(basis::ArcDiagDeformBasis) = basis.len


function pbw_arc_diagrams(T::Union{SO, GL}, V::LieAlgebraModule, d::Int)
function pbw_arc_diagrams(T::Union{SO, GL}, V::LieAlgebraModule, d::Int; case::Symbol=:unknown, check_all_diagrams::Bool=false)
upper_verts = arc_diagram_upper_points(T, V)
lower_verts = arc_diagram_lower_points(T, V, d)
upper_iss = arc_diagram_upper_iss(T, V)
lower_iss = arc_diagram_lower_iss(T, V, d)
indep_sets = Vector{Int}[[(-1) .* is for is in upper_iss]; [is for is in lower_iss]]
if !check_all_diagrams
### if first arc goes from upper to lower, it goes to the first lower vertex
for i in 2:arc_diagram_num_lower_points(T, V, d)
push!(indep_sets, [-1, i])
end
if case == :exterior_power && d > 0
### first arc from upper right part may not got to the first lower vertex -> swap upper parts instead
push!(indep_sets, [-(div(arc_diagram_num_upper_points(T, V), 2) + 1), 1])
end
end
return all_arc_diagrams(arc_diagram_type(T), upper_verts, lower_verts; indep_sets)
end

Expand Down Expand Up @@ -549,6 +559,7 @@ function is_in_canonical_form_for_deformation(A::ArcDiagramDirected; case::Symbo
end
###
if case == :exterior_power

Check warning on line 561 in src/DeformationBases/ArcDiagDeformBasis.jl

View check run for this annotation

Codecov / codecov/patch

src/DeformationBases/ArcDiagDeformBasis.jl#L561

Added line #L561 was not covered by tests
# first arc from upper right part may not got to the first lower vertex -> swap upper parts instead
first_neigh_right = outneighbor(A, upper_vertex(A, div(n_upper_vertices(A), 2) + 1))
if is_lower_vertex(first_neigh_right) && vertex_index(first_neigh_right) == 1
return false

Check warning on line 565 in src/DeformationBases/ArcDiagDeformBasis.jl

View check run for this annotation

Codecov / codecov/patch

src/DeformationBases/ArcDiagDeformBasis.jl#L563-L565

Added lines #L563 - L565 were not covered by tests
Expand Down Expand Up @@ -600,6 +611,7 @@ function is_in_canonical_form_for_deformation(A::ArcDiagramUndirected; case::Sym
end
###
if case == :exterior_power
# first arc from upper right part may not got to the first lower vertex -> swap upper parts instead
first_neigh_right = neighbor(A, upper_vertex(A, div(n_upper_vertices(A), 2) + 1))
if is_lower_vertex(first_neigh_right) && vertex_index(first_neigh_right) == 1
return false

Check warning on line 617 in src/DeformationBases/ArcDiagDeformBasis.jl

View check run for this annotation

Codecov / codecov/patch

src/DeformationBases/ArcDiagDeformBasis.jl#L617

Added line #L617 was not covered by tests
Expand Down

0 comments on commit c5a8b04

Please sign in to comment.