Skip to content

Commit

Permalink
Add anyon wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianMaeurer committed Feb 24, 2025
1 parent 1ac4017 commit eadc50f
Show file tree
Hide file tree
Showing 13 changed files with 232 additions and 28 deletions.
139 changes: 139 additions & 0 deletions src/AnyonWiki/AnyonWiki.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#=----------------------------------------------------------
Load fusion categories from the Anyon Wiki by
Gert Vercleyen.
----------------------------------------------------------=#

associator_path = joinpath(@__DIR__, "MultFreeCenters/6jSymbols/")
pivotal_path = joinpath(@__DIR__, "MultFreeCenters/PivotalStructures/")

@doc raw"""
anyonewiki(n::Int64)
Load the n-th fusion category from the list of multiplicity free fusion categories of rank ≤ 7.
"""
function anyonwiki(n::Int)

data = []
CC = AcbField(512)
Q = QQBarField()
K = load_anyon_number_field(n::Int)
deg = degree(K)
e = complex_embeddings(K)[1]

# Open File n and extract data
open(joinpath(associator_path, "cat_$n")) do f

while ! eof(f)

s = readline(f)
s = filter(!=('\"'), s)
s = split(s, " ")

indices = Int[eval(Meta.parse(a)) for a s[1:end-3]]
x_real = CC(s[end-2] * " +/- 1e-512")
x_imag = CC(s[end][1:end-2] * "+/- 1e-512") * CC(im)

x = guess(Q, x_real + x_imag, deg)

append!(data, [Any[indices; preimage(e,x)]])
end
end
N = maximum([a[1] for a data])

# Construct multiplication table from associators
mult = zeros(Int,N,N,N)

for (_,a,b,c) filter(e -> e[1] == 1, data)

mult[a,b,c] = 1
end

C = six_j_category(K, mult)
set_name!(C, "Fusion category number $n from AnyonWiki List")

# Build matrices for 6j-Symbols
for a 1:N, b 1:N, c 1:N, d 1:N
abc_d = filter(e -> e[[1,2,3,4]] == [a,b,c,d], data)
l = Int(sqrt(length(abc_d)))
M = matrix(K,l,l, [v[7] for v abc_d])
set_associator!(C,a,b,c,d,M)
end
set_one!(C, 1)

set_pivotal!(C, load_anyon_pivotal(n, K, e))

C
end

function load_anyon_number_field(n::Int)
line = 1
open(joinpath(associator_path, "Polynomials")) do f

while ! eof(f)

s = readline(f)

if line == n
global _,x = QQ[:x]
min_pol = eval(Meta.parse(s))

global K1 = min_pol == 1 ? QQ : number_field(min_pol)[1]
break
end

line += 1
end
end

line = 1
open(joinpath(pivotal_path, "Polynomials")) do f

while ! eof(f)

s = readline(f)

if line == n
global _,x = QQ[:x]
min_pol = eval(Meta.parse(s))

global K2 = min_pol == 1 ? QQ : number_field(min_pol)[1]
break
end

line += 1
end
end

K1 == K2 && return K1
K1 == QQ && return K2
K2 == QQ && return K1

simplify(splitting_field([defining_polynomial(K1), defining_polynomial(K2)]))[1]
end

function load_anyon_pivotal(n::Int, K = load_anyon_number_field(n), e = complex_embeddings(K)[1])

CC = AcbField(512)
Q = QQBarField()
deg = degree(K)

piv = elem_type(K)[]
open(joinpath(pivotal_path, "pivots_cat_$n")) do f

while ! eof(f)

s = readline(f)
s = filter(!=('\"'), s)
s = split(s, " ")

x_real = CC(s[2] * " +/- 1e-512")
x_imag = CC(s[4][1:end-2] * "+/- 1e-512") * CC(im)

x = guess(Q, x_real + x_imag, deg)

append!(piv, [preimage(e, x)])
end
end
return piv
end
2 changes: 2 additions & 0 deletions src/CategoryFramework/AbstractMethods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ end
# end


rank(C::Category) = length(simples(C))

is_isomorphic_simples(X::Object, Y::Object) = is_isomorphic(X,Y)


Expand Down
4 changes: 2 additions & 2 deletions src/Examples/TambaraYamagami/TambaraYamagami.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function tambara_yamagami(K::Ring, A::Group, τ::RingElem, χ::BilinearForm)
end
set_associator!(TY, n+1, n+1, n+1, [[zero_mat for _ 1:n]; inv(a)*matrix(K,[inv(χ(els[i],els[j])) for i 1:n, j 1:n])])
set_one!(TY, [1; [0 for _ 1:n]])
set_spherical!(TY, [K(1) for _ 1:n+1])
set_pivotal!(TY, [K(1) for _ 1:n+1])

set_attribute!(TY, :classification, ["Tambara-Yamagami"])

Expand Down Expand Up @@ -262,7 +262,7 @@ function Ising(F::Ring, sqrt_2::RingElem, q::Int)

set_one!(C,[1,0,0])

set_spherical!(C, [F(1) for s simples(C)])
set_pivotal!(C, [F(1) for s simples(C)])

set_attribute!(C, :classification, ["Ising", "Tambara-Yamagami"])

Expand Down
2 changes: 1 addition & 1 deletion src/Examples/VercleyenSingerland/FR_9143/fr_9143.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ function cat_fr_9143()
end
end
set_one!(C,[1,0,0,0,0,0,0,0,0])
TensorCategories.set_spherical!(C, [K(1) for s simples(C)])
TensorCategories.set_pivotal!(C, [K(1) for s simples(C)])
return C
end
2 changes: 1 addition & 1 deletion src/Examples/Verlinde/I2-fusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function I2subcategory(m, F::Ring = cyclotomic_field(2*m)[1])
A=[0 for s in simples(C)]::Vector{Int64}
A[1]=1
set_one!(C,A)
set_spherical!(C, [F(1) for s simples(C)])
set_pivotal!(C, [F(1) for s simples(C)])
set_name!(C, "Fusion subcategory of I₂($m)")
return C
end
7 changes: 4 additions & 3 deletions src/SixJCategoryDatabase/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ function load_fusion_category(name::String)
load(joinpath(@__DIR__, name * ".mrdi"))
end

function add_to_local_database(C::SixJCategory, name::String)
files = readdir(joinpath(@__DIR__))
function add_to_local_database(C::SixJCategory, name::String, path::String = @__DIR__)

files = readdir(joinpath(path))

if name * ".mrdi" files
println("File already existent. Do you want to overwrite? [y/n]")
Expand All @@ -20,5 +21,5 @@ function add_to_local_database(C::SixJCategory, name::String)
return
end
end
save(joinpath(@__DIR__, name * ".mrdi"), C)
save(joinpath(path, name * ".mrdi"), C)
end
1 change: 1 addition & 0 deletions src/SixJCategoryDatabase/test.mrdi

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/TensorCategories.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Oscar: +, @alias, @attributes, AbstractSet, AcbField, StructureConstantAl
Hecke.AbstractAssociativeAlgebraElem, Ideal, MPolyRingElem, MPolyIdeal, Map, MatElem, MatrixElem,
MatrixGroup, matrix_space, ModuleIsomorphism, number_field, PcGroup, PolyRingElem,
polynomial_ring, QQ, QQBarField, QQField, QQFieldElem, QQMPolyRingElem, Ring, RingElem, ZZ, QQBarFieldElem,
ZZRingElem, abelian_closure, abelian_group, absolute_simple_field, action, base_field,
ZZRingElem, abelian_closure, abelian_group, absolute_simple_field, action, base_field, defining_polynomial,
base_ring, basis, central_primitive_idempotents, change_base_ring,
characteristic,
charpoly, codomain, coeff, coefficients, cokernel, complex_embeddings, compose, centralizer, embedding,
Expand Down Expand Up @@ -86,6 +86,7 @@ export algebras
export algebra_structures
export AlgebraObject
export AlgebraMorphism
export anyonwiki
export ArrowCategory
export ArrowObject
export ArrowMorphism
Expand Down Expand Up @@ -325,6 +326,7 @@ export pairing
export parent
export pentagon_axiom
export pentagon_equations
export pivotal
export preimage
export print_multiplication_table
export print_multiplication_table
Expand Down Expand Up @@ -378,7 +380,8 @@ export set_braiding!
export set_canonical_spherical!
export set_name!
export set_one!
export set_spherical!
export set_pivotal!
export set_spherical!
export set_tensor_product!
export set_trivial_spherical!
export SetHomSet
Expand Down Expand Up @@ -515,7 +518,7 @@ include("Examples/Haagerup/ExtendedHaagerup.jl")

include("Serialization/SixJSerialization.jl")
include("SixJCategoryDatabase/main.jl")

include("AnyonWiki/AnyonWiki.jl")



Expand Down
4 changes: 3 additions & 1 deletion src/TensorCategoryFramework/AbstractTensorMethods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ spherical of a morphism ``X → X``.
"""
tr(f::Morphism) = left_trace(f)

pivotal(X::Object) = spherical(X::Object)

"""
left_trace(f::Morphism)
Expand All @@ -169,7 +171,7 @@ function left_trace(f::Morphism)
if V == zero(C) || W == zero(C) return zero_morphism(one(C),one(C)) end

if V == W
return ev(left_dual(V)) ((spherical(V)f) id(left_dual(V))) coev(V)
return ev(left_dual(V)) ((pivotal(V)f) id(left_dual(V))) coev(V)
end
return ev(left_dual(V)) (f id(left_dual(V))) coev(V)
end
Expand Down
29 changes: 27 additions & 2 deletions src/TensorCategoryFramework/Center/Center.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Return the image under the forgetful functor.
"""
morphism(f::CenterMorphism) = f.m

is_weakly_fusion(C::CenterCategory) = true
is_weakly_fusion(C::CenterCategory) = dim(category(C)) != 0
is_fusion(C::CenterCategory) = all([int_dim(End(s)) == 1 for s simples(C)])
is_abelian(C::CenterCategory) = true
is_linear(C::CenterCategory) = true
Expand Down Expand Up @@ -1022,7 +1022,13 @@ function add_induction!(C::CenterCategory, X::Object, IX::CenterObject)
end

function simples_by_induction!(C::CenterCategory, log = true)
S = CenterObject[]
S = CenterObject[one(C)]

if rank(category(C)) == 1
C.simples = S
return S
end

d = dim(C.category)^2
C.induction_gens = induction_generators(C)
simpls = simples(C.category)
Expand Down Expand Up @@ -1147,6 +1153,25 @@ function split(X::CenterObject, E = End(X))
collect(values(eigenvalues(f L)))
end

function split(C::CenterCategory)
ends = End.(simples(C))

non_split = filter(e -> int_dim(e) > 1, ends)

length(non_split) == 0 && return C

minpolys = [minpoly.(basis(e)) for e non_split]

K = base_ring(C)
_,x = K[:x]
minpolys = [B[findfirst(f -> degree(f) == length(B), B)](x) for B minpolys]

L = simplify(absolute_simple_field(splitting_field(minpolys))[1])[1]

incl = K == QQ ? L : is_subfield(K,L)[2]
extension_of_scalars(C, L, incl)
end


#=----------------------------------------------------------
Hom Spaces 2.0
Expand Down
Loading

0 comments on commit eadc50f

Please sign in to comment.