Skip to content

Commit

Permalink
Merge branch 'Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianMaeurer committed Mar 27, 2024
2 parents a367c49 + 039e2c5 commit adad668
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TensorCategories"
uuid = "258c694e-7338-4d4d-b524-4851272a75cf"
authors = ["Fabian Mäurer"]
version = "0.2.4"
version = "0.2.5"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Expand Down
22 changes: 21 additions & 1 deletion src/CategoryFramework/AbstractMethods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ function direct_sum_decomposition(X::Object, S = simples(parent(X)))
end

function central_primitive_idempotents(H::AbstractHomSpace)
@assert H.X == H.Y "Not an endomorphism algebra"
@assert domain(H) == codomain(H) "Not an endomorphism algebra"

A = endomorphism_ring(H.X, basis(H))
one(A)
A.issemisimple = true
idems = central_primitive_idempotents(A)
[sum(basis(H) .* coefficients(i)) for i idems]
Expand Down Expand Up @@ -304,6 +305,7 @@ function _decompose_by_simple_endomorphism_ring(X::Object, E = End(X))
R = endomorphism_ring(X, E)
CR,_ = center(R)
dR = dim(R)

if !is_square(div(dR,dim(CR))) || dR == 1 || is_commutative(R)
return (X,1)
end
Expand All @@ -313,6 +315,24 @@ function _decompose_by_simple_endomorphism_ring(X::Object, E = End(X))
n,_ = size(matrix(G[1]))
mats = matrix.(G)

for f E
eig = eigenvalues(f)

length(eig) < 1 && continue

Z = collect(values(eig))[1]

length(eig) == 1 && dim(Z) == dim(X) && continue

EZ = End(Z)

k = sqrt(int_dim(E)) - sqrt(int_dim(EZ))

(Z2, k2) = _decompose_by_simple_endomorphism_ring(Z,EZ)

return (Z2, k*k2)
end

for i 1:n
m = matrix(K,n,length(G), hcat([M[i,:] for M mats]...))

Expand Down
1 change: 1 addition & 0 deletions src/TensorCategories.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Oscar: +, @alias, @attributes, AbstractSet, AcbField, StructureConstantAl
using InteractiveUtils
using Memoization
using SparseArrays
using Base.Threads


export -
Expand Down
25 changes: 13 additions & 12 deletions src/TensorCategoryFramework/Center/Center.jl
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,12 @@ function image(f::CenterMorphism)
end


function left_inverse(f::CenterMorphism)
X = domain(f)
Y = codomain(f)
l_inv = central_projection(Y,X,left_inverse(morphsm(f)))
return Morphism(Y,X,l_inv)
end
# function left_inverse(f::CenterMorphism)
# X = domain(f)
# Y = codomain(f)
# l_inv = central_projection(Y,X,left_inverse(morphism(f)))
# return Morphism(Y,X,l_inv)
# end

function quotient(Y::CenterObject, X::Object)
# TODO: Compute quotient
Expand Down Expand Up @@ -1030,20 +1030,21 @@ function hom_by_adjunction(X::CenterObject, Y::CenterObject)
X_Homs = [Hom(object(X),s) for s S]
Y_Homs = [Hom(s,object(Y)) for s S]

candidates = [int_dim(H)*int_dim(H2) > 0 for (s,H,H2) zip(S,X_Homs,Y_Homs)]
candidates = [int_dim(H)*int_dim(H2) > 0 for (H,H2) zip(X_Homs,Y_Homs)]

!any(candidates) && return HomSpace(X,Y, CenterMorphism[])

# Take smalles s for Hom(X,I(s)) -> Hom(I(s), Y)
X_Homs = X_Homs[candidates]
Y_Homs = Y_Homs[candidates]

# X_Homs = X_Homs[candidates]
# Y_Homs = Y_Homs[candidates]


M = zero_matrix(base_ring(C),0,*(size(matrix(zero_morphism(X,Y)))...))

mors = []

for (s, X_s, s_Y) zip(S[candidates], X_Homs, Y_Homs)
@threads for i findall(==(true), candidates)
s, X_s, s_Y = S[i], X_Homs[i], Y_Homs[i]
Is = induction(s, parent_category = Z)
B = induction_right_adjunction(X_s, X, Is)
B2 = induction_adjunction(s_Y, Y, Is)
Expand Down Expand Up @@ -1147,7 +1148,7 @@ function smatrix(C::CenterCategory)
n = length(simpls)
K = base_ring(C)
S = [zero_morphism(category(C)) for _ 1:n, _ 1:n]
for i 1:n
@threads for i 1:n
for j i:n
S[i,j] = S[j,i] = tr(half_braiding(simpls[i], object(simpls[j])) half_braiding(simpls[j], object(simpls[i])))
end
Expand Down
79 changes: 59 additions & 20 deletions src/TensorCategoryFramework/Center/Induction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function induction(X::Object, simples::Vector = simples(parent(X)); parent_categ

C = parent(X)

for i 1:length(simples)
@threads for i 1:length(simples)
W = simples[i]
γ[i] = zero_morphism(zero(parent(X)), direct_sum([W((sX)dual(s)) for s simples])[1])

for S simples
dom_i = ((SX)dual(S))simples[i]
dom_i = ((SX)dual(S))W
γ_i_temp = zero_morphism(dom_i, zero(parent(X)))
for T simples
#@show S,T,W
Expand Down Expand Up @@ -74,7 +74,7 @@ function induction(X::Object, simples::Vector = simples(parent(X)); parent_categ
# factor out such that the left and right tensor product coincide.
r = direct_sum([horizontal_direct_sum([image(fid(X)id(dual(b)) - id(b)id(X)dual(f))[2] for f in End(b)]) for b in simples])

@show Z,r = cokernel(r)
Z,r = cokernel(r)
ir = right_inverse(r)

γ = [(id(b)r) γᵢ (ir id(b)) for (γᵢ,b) zip(γ, simples)]
Expand Down Expand Up @@ -124,11 +124,17 @@ function end_of_induction(X::Object, IX = induction(X))
B = basis(Hom(X,object(IX)))
simpls = simples(parent(X))

m = [(dim(xi))*compose(
inv(half_braiding(IX, xi)) id(dual(xi)),
m = [zero_morphism(X,X) for _ in 1:length(simpls)]

@threads for i 1:length(simpls)
xi = simpls[i]
dxi = dual(xi)
m[i] = (dim(xi))*compose(
inv(half_braiding(IX, xi)) id(dxi),
associator(object(IX), xi, dual(xi)),
id(object(IX)) (ev(dual(xi)) (spherical(xi) id(dual(xi))))
) for xi simpls]
id(object(IX)) (ev(dxi) (spherical(xi) id(dxi)))
)
end

m = horizontal_direct_sum(m)

Expand Down Expand Up @@ -368,39 +374,62 @@ function adjusted_dual_basis(V::Vector{<:Morphism}, U::Vector{<:Morphism}, S::Ob
return V, dual_basis
end

function partial_induction(X::Object, ind_simples::Vector, simples::Vector = simples(parent(X)); parent_category::CenterCategory = Center(parent(X)))
function relative_induction(X::Object, ind_simples::Vector{<:Object}, simples::Vector = simples(parent(X)); parent_category::CenterCategory = Center(parent(X)))

if isdefined(parent_category, :inductions) && X collect(keys(parent_category.inductions))
return parent_category.inductions[X]
end

@assert is_semisimple(parent(X)) "Requires semisimplicity"
Z = direct_sum([sXdual(s) for s ind_simples])[1]
a = associator
γ = Vector{Morphism}(undef, length(simples))
γ = Vector{Morphism}(undef, length(ind_simples))

C = parent(X)
for i 1:length(simples)
W = simples[i]

for i 1:length(ind_simples)
W = ind_simples[i]
γ[i] = zero_morphism(zero(parent(X)), direct_sum([W((sX)dual(s)) for s ind_simples])[1])

for S ind_simples
dom_i = ((SX)dual(S))simples[i]
dom_i = ((SX)dual(S))W
γ_i_temp = zero_morphism(dom_i, zero(parent(X)))
for T ind_simples
#@show S,T,W
# Set up basis and dual basis

#basis, basis_dual = dual_basis(Hom(S, W⊗T), Hom(dual(S), dual(W⊗T)))
_basis, basis_dual = basis(Hom(S, WT)), basis(Hom(dual(S)W, dual(T)))
#_basis, basis_dual = dual_basis(Hom(S, W⊗T), Hom(dual(S), dual(W⊗T)))

#_basis, basis_dual = adjusted_dual_basis(Hom(S, W⊗T), Hom(dual(S)⊗W, dual(T)), S, W, T)

_,_,ic,p = direct_sum_decomposition(WT, simples)
_basis = [f for f ic if domain(f) == S]
dual_basis = [f for f p if codomain(f) == S]
#_,_,_,p = direct_sum_decomposition(dual(S)⊗W, dual.(simples))

basis_dual = transform_dual_basis(dual_basis, S,W,T)

if length(_basis) == 0
γ_i_temp = vertical_direct_sum(γ_i_temp, zero_morphism(dom_i, W((TX)dual(T))))
continue
end

corrections = base_ring(X).([(id(W)ev(dual(T))) (id(W)(spherical(T)id(dual(T)))) a(W,T,dual(T)) (fg) a(S,dual(S),W) (coev(S)id(W)) for (f,g) zip(_basis,basis_dual)])

#_basis, basis_dual = adjusted_dual_basis(_basis, basis_dual, S, W, T)


#corrections = base_ring(X).([(id(W)⊗ev(dual(T))) ∘ (id(W)⊗(spherical(T)⊗id(dual(T)))) ∘ a(W,T,dual(T)) ∘ (f⊗g) ∘ a(S,dual(S),W) ∘ (coev(S)⊗id(W)) for (f,g) ∈ zip(_basis,basis_dual)])


#@show "component_iso"
component_iso = sum([a(W,TX,dual(T)) (a(W,T,X)id(dual(T))) ((fid(X))(inv(dim(W))*inv(k)*g)) a(SX,dual(S),W) for (k,f,g) zip(corrections,_basis, basis_dual)])
#component_iso = sum([a(W,T⊗X,dual(T)) ∘ (a(W,T,X)⊗id(dual(T))) ∘ ((f⊗id(X))⊗(inv(dim(W))*inv(k)*g)) ∘ a(S⊗X,dual(S),W) for (k,f,g) ∈ zip(corrections,_basis, basis_dual)])

component_iso = sum([a(W,TX,dual(T)) (a(W,T,X)id(dual(T))) ((fid(X))(g)) a(SX,dual(S),W) for (f,g) zip(_basis, basis_dual)])

#@show "sum"
γ_i_temp = vertical_direct_sum(γ_i_temp, (component_iso))
end
γ[i] = horizontal_direct_sum(γ[i], dim(S)*γ_i_temp)
γ[i] = horizontal_direct_sum(γ[i], γ_i_temp)
end


Expand All @@ -412,9 +441,19 @@ function partial_induction(X::Object, ind_simples::Vector, simples::Vector = sim
γ[i] = inv(distr_after) γ[i] distr_before
end

return CenterObject(parent_category,Z,γ)
end
if !is_split_semisimple(C)
# factor out such that the left and right tensor product coincide.
r = direct_sum([horizontal_direct_sum([image(fid(X)id(dual(b)) - id(b)id(X)dual(f))[2] for f in End(b)]) for b in simples])

@show Z,r = cokernel(r)
ir = right_inverse(r)

γ = [(id(b)r) γᵢ (ir id(b)) for (γᵢ,b) zip(γ, simples)]
end

IX = CenterObject(parent_category,Z,γ)

add_induction!(parent_category, X, IX)


return IX
end

0 comments on commit adad668

Please sign in to comment.