Skip to content

Commit 23c7701

Browse files
authored
Add checks if triangle relations are satisfied (#15)
* `triangle_equation` function * necessary exports and usings * triangle equation test * bump version 0.1.7 * update `triangle_equation` to not be dependent on `diagm` * move test * add triangle test for `IsingBimod` * format * format * move `triangle_equation` definition and export location
1 parent 6a66179 commit 23c7701

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorKitSectors"
22
uuid = "13a9c161-d5da-41f0-bcbd-e1a08ae0647f"
33
authors = ["Lukas Devos", "Jutho Haegeman"]
4-
version = "0.1.6"
4+
version = "0.1.7"
55

66
[deps]
77
HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721"

src/TensorKitSectors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export BraidingStyle, NoBraiding, SymmetricBraiding, Bosonic, Fermionic, Anyonic
1515
export SectorSet, SectorValues, findindex
1616
export rightone, leftone
1717

18-
export pentagon_equation, hexagon_equation
18+
export triangle_equation, pentagon_equation, hexagon_equation
1919

2020
export Trivial, Z2Irrep, Z3Irrep, Z4Irrep, ZNIrrep, U1Irrep, SU2Irrep, CU1Irrep
2121
export ProductSector, TimeReversed

src/sectors.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,27 @@ Return the twist of a sector `a`
370370
"""
371371
twist(a::Sector) = sum(dim(b) / dim(a) * tr(Rsymbol(a, a, b)) for b in a a)
372372

373+
# Triangle equation
374+
#-------------------------------------------------------------------------------
375+
# requirement that certain F-moves involving unit objects are trivial
376+
function triangle_equation(a::I, b::I; kwargs...) where {I<:Sector}
377+
for c in (a, b)
378+
F1 = Fsymbol(leftone(a), a, b, c, a, c)
379+
F2 = Fsymbol(a, rightone(a), b, c, a, b)
380+
F3 = Fsymbol(a, b, rightone(b), c, c, b)
381+
382+
isapproxone(F) = isapprox(F, one(F); kwargs...)
383+
if FusionStyle(I) isa MultiplicityFreeFusion
384+
all(isapproxone, (F1, F2, F3)) || return false
385+
else
386+
N = Nsymbol(a, b, c)
387+
tomatrix = Base.Fix2(reshape, (N, N))
388+
all(isapproxone tomatrix, (F1, F2, F3)) || return false
389+
end
390+
end
391+
return true
392+
end
393+
373394
# Pentagon and Hexagon equations
374395
#-------------------------------------------------------------------------------
375396
# Consistency equations for F- and R-symbols

test/multifusion.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ Istr = TensorKitSectors.type_repr(I)
114114
end
115115
end
116116

117+
@testset "$Istr: Triangle equation" begin
118+
for a in smallset(I), b in smallset(I)
119+
@test triangle_equation(a, b; atol=1e-12, rtol=1e-12)
120+
end
121+
end
122+
117123
@testset "$Istr: Pentagon equation" begin
118124
objects = collect(values(I))
119125
for a in objects, b in objects, c in objects, d in objects

test/sectors.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ end
9595
end
9696
end
9797
end
98+
@testset "Sector $Istr: Triangle equation" begin
99+
for a in smallset(I), b in smallset(I)
100+
@test triangle_equation(a, b; atol=1e-12, rtol=1e-12)
101+
end
102+
end
98103
@testset "Sector $Istr: Pentagon equation" begin
99104
for a in smallset(I), b in smallset(I), c in smallset(I), d in smallset(I)
100105
@test pentagon_equation(a, b, c, d; atol=1e-12, rtol=1e-12)

0 commit comments

Comments
 (0)