Skip to content

[WIP] fix config feature add #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ terms
flavors
get_weights
nflavor
fixedvertices
```

#### Graph Problem Utilities
Expand Down
2 changes: 1 addition & 1 deletion src/GenericTensorNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export line_graph

# Tensor Networks (Graph problems)
export GraphProblem, optimize_code, NoWeight
export flavors, labels, terms, nflavor, get_weights
export flavors, labels, terms, nflavor, get_weights, fixedvertices
export IndependentSet, mis_compactify!, is_independent_set
export MaximalIS, is_maximal_independent_set
export MaxCut, cut_size
Expand Down
14 changes: 9 additions & 5 deletions src/networks/Coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@ struct Coloring{K,CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphProble
code::CT
graph::SimpleGraph{Int}
weights::WT
fixedvertices::Dict{Int,Int}
end
Coloring{K}(code::ET, graph::SimpleGraph, weights::Union{NoWeight, Vector}) where {K,ET<:AbstractEinsum} = Coloring{K,ET,typeof(weights)}(code, graph, weights)
Coloring{K}(code::ET, graph::SimpleGraph, weights::Union{NoWeight, Vector}, fixedvertices::Dict{Int,Int}) where {K,ET<:AbstractEinsum} = Coloring{K,ET,typeof(weights)}(code, graph, weights, fixedvertices)
# same network layout as independent set.
function Coloring{K}(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing) where K
function Coloring{K}(g::SimpleGraph; weights=NoWeight(), openvertices=(), fixedvertices=Dict{Int,Int}(), optimizer=GreedyMethod(), simplifier=nothing) where K
@assert weights isa NoWeight || length(weights) == ne(g)
rawcode = EinCode(([[i] for i in Graphs.vertices(g)]..., # labels for vertex tensors
[[minmax(e.src,e.dst)...] for e in Graphs.edges(g)]...), collect(Int, openvertices)) # labels for edge tensors
code = _optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier)
Coloring{K}(code, g, weights)
code = _optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier)
Coloring{K}(code, g, weights, fixedvertices)
end

flavors(::Type{<:Coloring{K}}) where K = collect(0:K-1)
get_weights(c::Coloring{K}, i::Int) where K = fill(c.weights[i], K)
terms(gp::Coloring) = getixsv(gp.code)[1:nv(gp.graph)]
labels(gp::Coloring) = [1:nv(gp.graph)...]
fixedvertices(gp::Coloring) = gp.fixedvertices

function generate_tensors(x::T, c::Coloring{K}) where {K,T}
ixs = getixsv(c.code)
return vcat(add_labels!([coloringv(T, K) for i=1:nv(c.graph)], ixs[1:nv(c.graph)], labels(c)), [coloringb(x, K) .^ get_weights(c, i) for i=1:ne(c.graph)])
return select_dims(vcat(
add_labels!([coloringv(T, K) for i=1:nv(c.graph)], ixs[1:nv(c.graph)], labels(c)), [coloringb(x, K) .^ get_weights(c, i) for i=1:ne(c.graph)]
), ixs, fixedvertices(c))
end

# coloring bond tensor
Expand Down
10 changes: 6 additions & 4 deletions src/networks/DominatingSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ struct DominatingSet{CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphPro
code::CT
graph::SimpleGraph{Int}
weights::WT
fixedvertices::Dict{Int,Int}
end

function DominatingSet(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function DominatingSet(g::SimpleGraph; weights=NoWeight(), openvertices=(), fixedvertices=Dict{Int,Int}(), optimizer=GreedyMethod(), simplifier=nothing)
@assert weights isa NoWeight || length(weights) == nv(g)
rawcode = EinCode(([[Graphs.neighbors(g, v)..., v] for v in Graphs.vertices(g)]...,), collect(Int, openvertices))
DominatingSet(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), g, weights)
DominatingSet(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), g, weights, fixedvertices)
end

flavors(::Type{<:DominatingSet}) = [0, 1]
get_weights(gp::DominatingSet, i::Int) = [0, gp.weights[i]]
terms(gp::DominatingSet) = getixsv(gp.code)
labels(gp::DominatingSet) = [1:length(getixsv(gp.code))...]
fixedvertices(gp::DominatingSet) = gp.fixedvertices

function generate_tensors(x::T, mi::DominatingSet) where T
ixs = getixsv(mi.code)
isempty(ixs) && return []
return add_labels!(map(enumerate(ixs)) do (i, ix)
return select_dims(add_labels!(map(enumerate(ixs)) do (i, ix)
dominating_set_tensor((Ref(x) .^ get_weights(mi, i))..., length(ix))
end, ixs, labels(mi))
end, ixs, labels(mi)), ixs, fixedvertices(mi))
end
function dominating_set_tensor(a::T, b::T, d::Int) where T
t = zeros(T, fill(2, d)...)
Expand Down
12 changes: 7 additions & 5 deletions src/networks/IndependentSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,31 @@ struct IndependentSet{CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphPr
code::CT
graph::SimpleGraph{Int}
weights::WT
fixedvertices::Dict{Int,Int}
end

function IndependentSet(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function IndependentSet(g::SimpleGraph; weights=NoWeight(), openvertices=(), fixedvertices=Dict{Int,Int}(), optimizer=GreedyMethod(), simplifier=nothing)
@assert weights isa NoWeight || length(weights) == nv(g)
rawcode = EinCode([[[i] for i in Graphs.vertices(g)]..., # labels for vertex tensors
[[minmax(e.src,e.dst)...] for e in Graphs.edges(g)]...], collect(Int, openvertices)) # labels for edge tensors
code = _optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier)
IndependentSet(code, g, weights)
code = _optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier)
IndependentSet(code, g, weights, fixedvertices)
end

flavors(::Type{<:IndependentSet}) = [0, 1]
get_weights(gp::IndependentSet, i::Int) = [0, gp.weights[i]]
terms(gp::IndependentSet) = getixsv(gp.code)[1:nv(gp.graph)]
labels(gp::IndependentSet) = [1:nv(gp.graph)...]
fixedvertices(gp::IndependentSet) = gp.fixedvertices

# generate tensors
function generate_tensors(x::T, gp::IndependentSet) where T
nv(gp.graph) == 0 && return []
ixs = getixsv(gp.code)
# we only add labels at vertex tensors
return vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:nv(gp.graph)], ixs[1:nv(gp.graph)], labels(gp)),
return select_dims(vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:nv(gp.graph)], ixs[1:nv(gp.graph)], labels(gp)),
[misb(T, length(ix)) for ix in ixs[nv(gp.graph)+1:end]] # if n!=2, it corresponds to set packing problem.
)
), ixs, fixedvertices(gp))
end

function misb(::Type{T}, n::Integer=2) where T
Expand Down
8 changes: 5 additions & 3 deletions src/networks/Matching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ struct Matching{CT<:AbstractEinsum, WT<:Union{NoWeight,Vector}} <: GraphProblem
code::CT
graph::SimpleGraph{Int}
weights::WT
fixedvertices::Dict{Int,Int}
end

function Matching(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function Matching(g::SimpleGraph; weights=NoWeight(), openvertices=(),fixedvertices=Dict{Int,Int}(), optimizer=GreedyMethod(), simplifier=nothing)
@assert weights isa NoWeight || length(weights) == ne(g)
edges = [minmax(e.src,e.dst) for e in Graphs.edges(g)]
rawcode = EinCode(vcat([[s] for s in edges], # labels for edge tensors
[[minmax(i,j) for j in neighbors(g, i)] for i in Graphs.vertices(g)]),
collect(Tuple{Int,Int}, openvertices))
Matching(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), g, weights)
Matching(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), g, weights, fixedvertices)
end

flavors(::Type{<:Matching}) = [0, 1]
get_weights(m::Matching, i::Int) = [0, m.weights[i]]
terms(gp::Matching) = getixsv(gp.code)[1:ne(gp.graph)]
labels(gp::Matching) = getindex.(terms(gp))
fixedvertices(gp::Matching) = gp.fixedvertices

function generate_tensors(x::T, m::Matching) where T
ne(m.graph) == 0 && return []
Expand All @@ -40,7 +42,7 @@ function generate_tensors(x::T, m::Matching) where T
end
push!(tensors, t)
end
return add_labels!(tensors, ixs, labels(m))
return select_dims(add_labels!(tensors, ixs, labels(m)), ixs, fixedvertices(m))
end

function match_tensor(::Type{T}, n::Int) where T
Expand Down
12 changes: 8 additions & 4 deletions src/networks/MaxCut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@ struct MaxCut{CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphProblem
code::CT
graph::SimpleGraph{Int}
weights::WT
fixedvertices::Dict{Int,Int}
end
function MaxCut(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function MaxCut(g::SimpleGraph; weights=NoWeight(), openvertices=(), fixedvertices=Dict{Int,Int}(), optimizer=GreedyMethod(), simplifier=nothing)
@assert weights isa NoWeight || length(weights) == ne(g)
rawcode = EinCode([[minmax(e.src,e.dst)...] for e in Graphs.edges(g)], collect(Int, openvertices)) # labels for edge tensors
MaxCut(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), g, weights)
MaxCut(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), g, weights, fixedvertices)
end

flavors(::Type{<:MaxCut}) = [0, 1]
get_weights(gp::MaxCut, i::Int) = [0, gp.weights[i]]
terms(gp::MaxCut) = getixsv(gp.code)
labels(gp::MaxCut) = [1:nv(gp.graph)...]
fixedvertices(gp::MaxCut) = gp.fixedvertices

function generate_tensors(x::T, gp::MaxCut) where T
ixs = getixsv(gp.code)
return add_labels!(map(enumerate(ixs)) do (i, ix)
tensors = map(enumerate(ixs)) do (i, ix)
maxcutb((Ref(x) .^ get_weights(gp, i)) ...)
end, ixs, labels(gp))
end
return select_dims(add_labels!(tensors, ixs, labels(gp)), ixs, fixedvertices(gp))
end

function maxcutb(a, b)
return [a b; b a]
end
Expand Down
10 changes: 6 additions & 4 deletions src/networks/MaximalIS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ struct MaximalIS{CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphProblem
code::CT
graph::SimpleGraph
weights::WT
fixedvertices::Dict{Int,Int}
end

function MaximalIS(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function MaximalIS(g::SimpleGraph; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing, fixedvertices=Dict{Int,Int}())
@assert weights isa NoWeight || length(weights) == nv(g)
rawcode = EinCode(([[Graphs.neighbors(g, v)..., v] for v in Graphs.vertices(g)]...,), collect(Int, openvertices))
MaximalIS(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), g, weights)
MaximalIS(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), g, weights, fixedvertices)
end

flavors(::Type{<:MaximalIS}) = [0, 1]
get_weights(gp::MaximalIS, i::Int) = [0, gp.weights[i]]
terms(gp::MaximalIS) = getixsv(gp.code)
labels(gp::MaximalIS) = [1:length(getixsv(gp.code))...]
fixedvertices(gp::MaximalIS) = gp.fixedvertices

function generate_tensors(x::T, mi::MaximalIS) where T
ixs = getixsv(mi.code)
isempty(ixs) && return []
return add_labels!(map(enumerate(ixs)) do (i, ix)
return select_dims(add_labels!(map(enumerate(ixs)) do (i, ix)
maximal_independent_set_tensor((Ref(x) .^ get_weights(mi, i))..., length(ix))
end, ixs, labels(mi))
end, ixs, labels(mi)), ixs, fixedvertices(mi))
end
function maximal_independent_set_tensor(a::T, b::T, d::Int) where T
t = zeros(T, fill(2, d)...)
Expand Down
12 changes: 7 additions & 5 deletions src/networks/PaintShop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,39 @@ struct PaintShop{CT<:AbstractEinsum,LT} <: GraphProblem
code::CT
sequence::Vector{LT}
isfirst::Vector{Bool}
fixedvertices::Dict{LT,Int}
end

function paintshop_from_pairs(pairs::AbstractVector{Tuple{Int,Int}}; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function paintshop_from_pairs(pairs::AbstractVector{Tuple{Int,Int}}; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing, fixedvertices=Dict{LT,Int}())
n = length(pairs)
@assert sort!(vcat(collect.(pairs)...)) == collect(1:2n)
sequence = zeros(Int, 2*n)
@inbounds for i=1:n
sequence[pairs[i]] .= i
end
return PaintShop(pairs; openvertices, optimizer, simplifier)
return PaintShop(pairs; openvertices, optimizer, simplifier, fixedvertices)
end
function PaintShop(sequence::AbstractVector{T}; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing) where T
function PaintShop(sequence::AbstractVector{T}; openvertices=(), fixedvertices=Dict{T,Int}(), optimizer=GreedyMethod(), simplifier=nothing) where T
@assert all(l->count(==(l), sequence)==2, sequence)
n = length(sequence)
isfirst = [findfirst(==(sequence[i]), sequence) == i for i=1:n]
rawcode = EinCode(vcat(
[[sequence[i], sequence[i+1]] for i=1:n-1], # labels for edge tensors
),
collect(T, openvertices))
PaintShop(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), sequence, isfirst)
PaintShop(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), sequence, isfirst, fixedvertices)
end

flavors(::Type{<:PaintShop}) = [0, 1]
get_weights(::PaintShop, i::Int) = [0, 1]
terms(gp::PaintShop) = getixsv(gp.code)
labels(gp::PaintShop) = unique(gp.sequence)
fixedvertices(gp::PaintShop) = gp.fixedvertices

function generate_tensors(x::T, c::PaintShop) where T
ixs = getixsv(c.code)
tensors = [paintshop_bond_tensor((Ref(x) .^ get_weights(c, i))...) for i=1:length(ixs)]
return add_labels!([flip_labels(tensors[i], c.isfirst[i], c.isfirst[i+1]) for i=1:length(ixs)], ixs, labels(c))
return select_dims(add_labels!([flip_labels(tensors[i], c.isfirst[i], c.isfirst[i+1]) for i=1:length(ixs)], ixs, labels(c)), ixs, fixedvertices(c))
end

function paintshop_bond_tensor(a::T, b::T) where T
Expand Down
17 changes: 12 additions & 5 deletions src/networks/Satisfiability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,19 @@ struct Satisfiability{CT<:AbstractEinsum,T,WT<:Union{NoWeight, Vector}} <: Graph
code::CT
cnf::CNF{T}
weights::WT
fixedvertices::Dict{T,Int}
end

function Satisfiability(cnf::CNF{T}; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing) where T
function Satisfiability(cnf::CNF{T}; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing, fixedvertices=Dict{T,Int}()) where T
rawcode = EinCode([[getfield.(c.vars, :name)...] for c in cnf.clauses], collect(T, openvertices))
Satisfiability(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier), cnf, weights)
Satisfiability(_optimize_code(rawcode, uniformsize_fix(rawcode, 2, fixedvertices), optimizer, simplifier), cnf, weights, fixedvertices)
end

flavors(::Type{<:Satisfiability}) = [0, 1] # false, true
get_weights(s::Satisfiability, i::Int) = [0, s.weights[i]]
terms(gp::Satisfiability) = getixsv(gp.code)
labels(gp::Satisfiability) = unique!(vcat(getixsv(gp.code)...))
fixedvertices(gp::Satisfiability) = gp.fixedvertices

"""
satisfiable(cnf::CNF, config::AbstractDict)
Expand All @@ -152,9 +154,14 @@ function generate_tensors(x::VT, sa::Satisfiability{CT,T}) where {CT,T,VT}
cnf = sa.cnf
ixs = getixsv(sa.code)
isempty(cnf.clauses) && return []
return add_labels!(map(1:length(cnf.clauses)) do i
tensor_for_clause(cnf.clauses[i], (Ref(x) .^ get_weights(sa, i))...)
end, ixs, labels(sa))
return select_dims(
add_labels!(
map(1:length(cnf.clauses)) do i
tensor_for_clause(cnf.clauses[i], (Ref(x) .^ get_weights(sa, i))...)
end,
ixs, labels(sa))
, ixs, fixedvertices(sa)
)
end

function tensor_for_clause(c::CNFClause{T}, a, b) where T
Expand Down
10 changes: 6 additions & 4 deletions src/networks/SetCovering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@ struct SetCovering{ET, CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphP
code::CT
sets::Vector{Vector{ET}}
weights::WT
fixedvertices::Dict{ET,Int}
end

function SetCovering(sets; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing) where ET
function SetCovering(sets::AbstractVector{Vector{ET}}; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing, fixedvertices=Dict{ET,Int}()) where ET
nsets = length(sets)
@assert weights isa NoWeight || length(weights) == nsets
# get constraints
elements, count = cover_count(sets)

code = EinCode([[[i] for i=1:nsets]...,
[count[e] for e in elements]...], collect(Int,openvertices))
SetCovering(_optimize_code(code, uniformsize(code, 2), optimizer, simplifier), sets, weights)
SetCovering(_optimize_code(code, uniformsize_fix(code, 2, fixedvertices), optimizer, simplifier), sets, weights, fixedvertices)
end

function cover_count(sets)
Expand Down Expand Up @@ -69,15 +70,16 @@ flavors(::Type{<:SetCovering}) = [0, 1]
get_weights(gp::SetCovering, i::Int) = [0, gp.weights[i]]
terms(gp::SetCovering) = getixsv(gp.code)[1:length(gp.sets)]
labels(gp::SetCovering) = [1:length(gp.sets)...]
fixedvertices(gp::SetCovering) = gp.fixedvertices

# generate tensors
function generate_tensors(x::T, gp::SetCovering) where T
nsets = length(gp.sets)
nsets == 0 && return []
ixs = getixsv(gp.code)
# we only add labels at vertex tensors
return vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:nsets], ixs[1:nsets], labels(gp)),
[cover_tensor(T, ix) for ix in ixs[nsets+1:end]]
return select_dims(vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:nsets], ixs[1:nsets], labels(gp)),
[cover_tensor(T, ix) for ix in ixs[nsets+1:end]]), ixs, fixedvertices(gp)
)
end

Expand Down
10 changes: 6 additions & 4 deletions src/networks/SetPacking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,29 @@ struct SetPacking{ET, CT<:AbstractEinsum,WT<:Union{NoWeight, Vector}} <: GraphPr
code::CT
sets::Vector{Vector{ET}}
weights::WT
fixedvertices::Dict{ET,Int}
end

function SetPacking(sets; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
function SetPacking(sets::AbstractVector{Vector{ET}}; weights=NoWeight(), openvertices=(), optimizer=GreedyMethod(), simplifier=nothing, fixedvertices=Dict{ET,Int}()) where ET
nsets = length(sets)
@assert weights isa NoWeight || length(weights) == nsets
code = EinCode(vcat([[i] for i=1:nsets], [[i,j] for i=1:nsets,j=1:nsets if j>i && !isempty(sets[i] ∩ sets[j])]), collect(Int,openvertices))
SetPacking(_optimize_code(code, uniformsize(code, 2), optimizer, simplifier), sets, weights)
SetPacking(_optimize_code(code, uniformsize_fix(code, 2, openvertices), optimizer, simplifier), sets, weights, fixedvertices)
end

flavors(::Type{<:SetPacking}) = [0, 1]
get_weights(gp::SetPacking, i::Int) = [0, gp.weights[i]]
terms(gp::SetPacking) = getixsv(gp.code)[1:length(gp.sets)]
labels(gp::SetPacking) = [1:length(gp.sets)...]
fixedvertices(gp::SetPacking) = gp.fixedvertices

# generate tensors
function generate_tensors(x::T, gp::SetPacking) where T
length(gp.sets) == 0 && return []
ixs = getixsv(gp.code)
# we only add labels at vertex tensors
return vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:length(gp.sets)], ixs[1:length(gp.sets)], labels(gp)),
[misb(T, length(ix)) for ix in ixs[length(gp.sets)+1:end]]
return select_dims(vcat(add_labels!([misv(Ref(x) .^ get_weights(gp, i)) for i=1:length(gp.sets)], ixs[1:length(gp.sets)], labels(gp)),
[misb(T, length(ix)) for ix in ixs[length(gp.sets)+1:end]]), ixs, fixedvertices(gp),
)
end

Expand Down
Loading