Skip to content

Commit c253ed7

Browse files
authored
Rename IsingBimod to IsingBimodule (#17)
* rename `IsingBimod` to `IsingBimodule` * Bump v0.2.0 * Fix typo * small fix * format
1 parent 2d1b2c1 commit c253ed7

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
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.7"
4+
version = "0.2.0"
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
@@ -21,7 +21,7 @@ export Trivial, Z2Irrep, Z3Irrep, Z4Irrep, ZNIrrep, U1Irrep, SU2Irrep, CU1Irrep
2121
export ProductSector, TimeReversed
2222
export FermionParity, FermionNumber, FermionSpin
2323
export PlanarTrivial, FibonacciAnyon, IsingAnyon
24-
export IsingBimod
24+
export IsingBimodule
2525

2626
# unicode exports
2727
# ---------------

src/multifusion.jl

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,102 @@
33
# this is mainly meant for testing within TensorKit without relying on MultiTensorKit
44
#------------------------------------------------------------------------------#
55

6-
# 𝒞 ℳ
6+
# 𝒞 ℳ
77
# ℳᵒᵖ 𝒟
8-
struct IsingBimod <: Sector
8+
struct IsingBimodule <: Sector
99
row::Int
1010
col::Int
1111
label::Int
12-
function IsingBimod(row::Int, col::Int, label::Int)
12+
function IsingBimodule(row::Int, col::Int, label::Int)
1313
1 <= row <= 2 && 1 <= col <= 2 ||
1414
throw(DomainError(lazy"Invalid subcategory ($row, $col)"))
1515
0 <= label <= (row == col) ||
16-
throw(ArgumentError(lazy"Invalid label $label for IsingBimod subcategory ($row, $col)"))
16+
throw(ArgumentError(lazy"Invalid label $label for IsingBimodule subcategory ($row, $col)"))
1717
return new(row, col, label)
1818
end
1919
end
2020

21-
const all_isingbimod_objects = (IsingBimod(1, 1, 0), IsingBimod(1, 1, 1),
22-
IsingBimod(2, 1, 0), IsingBimod(1, 2, 0),
23-
IsingBimod(2, 2, 0), IsingBimod(2, 2, 1))
21+
const all_isingbimod_objects = (IsingBimodule(1, 1, 0), IsingBimodule(1, 1, 1),
22+
IsingBimodule(2, 1, 0), IsingBimodule(1, 2, 0),
23+
IsingBimodule(2, 2, 0), IsingBimodule(2, 2, 1))
2424

25-
Base.IteratorSize(::Type{SectorValues{IsingBimod}}) = Base.SizeUnknown()
26-
Base.iterate(::SectorValues{IsingBimod}, i=1) = iterate(all_isingbimod_objects, i)
27-
Base.length(::SectorValues{IsingBimod}) = length(all_isingbimod_objects)
25+
Base.IteratorSize(::Type{SectorValues{IsingBimodule}}) = Base.SizeUnknown()
26+
Base.iterate(::SectorValues{IsingBimodule}, i=1) = iterate(all_isingbimod_objects, i)
27+
Base.length(::SectorValues{IsingBimodule}) = length(all_isingbimod_objects)
2828

29-
(a::IsingBimod, b::IsingBimod) = IsingBimodIterator(a, b)
29+
(a::IsingBimodule, b::IsingBimodule) = IsingBimoduleIterator(a, b)
3030

31-
struct IsingBimodIterator
32-
a::IsingBimod
33-
b::IsingBimod
31+
struct IsingBimoduleIterator
32+
a::IsingBimodule
33+
b::IsingBimodule
3434
end
3535

36-
Base.IteratorSize(::Type{IsingBimodIterator}) = Base.SizeUnknown()
37-
Base.IteratorEltype(::Type{IsingBimodIterator}) = Base.HasEltype()
38-
Base.eltype(::Type{IsingBimodIterator}) = IsingBimod
36+
Base.IteratorSize(::Type{IsingBimoduleIterator}) = Base.SizeUnknown()
37+
Base.IteratorEltype(::Type{IsingBimoduleIterator}) = Base.HasEltype()
38+
Base.eltype(::Type{IsingBimoduleIterator}) = IsingBimodule
3939

40-
function Base.iterate(iter::IsingBimodIterator, state=0)
40+
function Base.iterate(iter::IsingBimoduleIterator, state=0)
4141
a, b = iter.a, iter.b
4242
a.col == b.row || return nothing
4343

4444
_state = (a.row == b.col == a.col) ? mod(a.label + b.label, 2) : state
4545
return state < (1 + (a.row == b.col && a.row != a.col)) ?
46-
(IsingBimod(a.row, b.col, _state), state + 1) : nothing
46+
(IsingBimodule(a.row, b.col, _state), state + 1) : nothing
4747
end
4848

49-
Base.convert(::Type{IsingBimod}, labels::NTuple{3,Int}) = IsingBimod(labels...)
49+
Base.convert(::Type{IsingBimodule}, labels::NTuple{3,Int}) = IsingBimodule(labels...)
5050

51-
function Base.convert(::Type{IsingAnyon}, a::IsingBimod) # identify RepZ2 ⊕ RepZ2 ≅ Ising
51+
function Base.convert(::Type{IsingAnyon}, a::IsingBimodule) # identify RepZ2 ⊕ RepZ2 ≅ Ising
5252
(a.row != a.col) && return IsingAnyon()
5353
return IsingAnyon(a.label == 0 ? :I : )
5454
end
5555

56-
FusionStyle(::Type{IsingBimod}) = SimpleFusion() # no multiplicities
57-
BraidingStyle(::Type{IsingBimod}) = NoBraiding() # because of module categories
56+
FusionStyle(::Type{IsingBimodule}) = SimpleFusion() # no multiplicities
57+
BraidingStyle(::Type{IsingBimodule}) = NoBraiding() # because of module categories
5858

59-
function Nsymbol(a::IsingBimod, b::IsingBimod, c::IsingBimod)
59+
function Nsymbol(a::IsingBimodule, b::IsingBimodule, c::IsingBimodule)
6060
if (a.row != c.row) || (a.col != b.row) || (b.col != c.col)
6161
throw(ArgumentError("invalid fusion channel"))
6262
end
6363
return Nsymbol(convert(IsingAnyon, a), convert(IsingAnyon, b), convert(IsingAnyon, c))
6464
end
6565

66-
function Fsymbol(a::I, b::I, c::I, d::I, e::I, f::I) where {I<:IsingBimod}
66+
function Fsymbol(a::I, b::I, c::I, d::I, e::I, f::I) where {I<:IsingBimodule}
6767
Nsymbol(a, b, e) && Nsymbol(e, c, d) &&
6868
Nsymbol(b, c, f) && Nsymbol(a, f, d) || return 0.0
6969
return Fsymbol(convert(IsingAnyon, a), convert(IsingAnyon, b), convert(IsingAnyon, c),
7070
convert(IsingAnyon, d), convert(IsingAnyon, e), convert(IsingAnyon, f))
7171
end
7272

7373
# ℳ ↔ ℳop when conjugating elements within these
74-
Base.conj(a::IsingBimod) = IsingBimod(a.col, a.row, a.label)
74+
Base.conj(a::IsingBimodule) = IsingBimodule(a.col, a.row, a.label)
7575

76-
rightone(a::IsingBimod) = IsingBimod(a.col, a.col, 0)
77-
leftone(a::IsingBimod) = IsingBimod(a.row, a.row, 0)
76+
rightone(a::IsingBimodule) = IsingBimodule(a.col, a.col, 0)
77+
leftone(a::IsingBimodule) = IsingBimodule(a.row, a.row, 0)
7878

79-
function Base.one(a::IsingBimod)
79+
function Base.one(a::IsingBimodule)
8080
a.row == a.col ||
8181
throw(DomainError("unit of module category ($(a.row), $(a.col)) doesn't exist"))
82-
return IsingBimod(a.row, a.col, 0)
82+
return IsingBimodule(a.row, a.col, 0)
8383
end
8484

85-
Base.one(::Type{IsingBimod}) = throw(ArgumentError("one of Type IsingBimod doesn't exist"))
85+
function Base.one(::Type{IsingBimodule})
86+
throw(ArgumentError("one of Type IsingBimodule doesn't exist"))
87+
end
8688

87-
function Base.isless(a::IsingBimod, b::IsingBimod)
89+
function Base.isless(a::IsingBimodule, b::IsingBimodule)
8890
return isless((a.col, a.row, a.label), (b.col, b.row, b.label))
8991
end
9092

91-
function Base.hash(a::IsingBimod, h::UInt)
93+
function Base.hash(a::IsingBimodule, h::UInt)
9294
return hash(a.label, hash(a.row, hash(a.col, h)))
9395
end
9496

95-
function Base.show(io::IO, a::IsingBimod)
96-
if get(io, :typeinfo, nothing) === IsingBimod
97+
function Base.show(io::IO, a::IsingBimodule)
98+
if get(io, :typeinfo, nothing) === IsingBimodule
9799
print(io, (a.row, a.col, a.label))
98100
else
99-
print(io, "IsingBimod", (a.row, a.col, a.label))
101+
print(io, "IsingBimodule", (a.row, a.col, a.label))
100102
end
101103
return nothing
102104
end

test/multifusion.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
I = IsingBimod
1+
I = IsingBimodule
22
Istr = TensorKitSectors.type_repr(I)
33
@testset "$Istr sector" begin
44
@testset "Basic type properties" begin
55
@test eval(Meta.parse(sprint(show, I))) == I
66
@test eval(Meta.parse(TensorKitSectors.type_repr(I))) == I
77
end
88

9-
M = IsingBimod(1, 2, 0)
10-
Mop = IsingBimod(2, 1, 0)
11-
C0 = IsingBimod(1, 1, 0)
12-
C1 = IsingBimod(1, 1, 1)
13-
D0 = IsingBimod(2, 2, 0)
14-
D1 = IsingBimod(2, 2, 1)
9+
M = IsingBimodule(1, 2, 0)
10+
Mop = IsingBimodule(2, 1, 0)
11+
C0 = IsingBimodule(1, 1, 0)
12+
C1 = IsingBimodule(1, 1, 1)
13+
D0 = IsingBimodule(2, 2, 0)
14+
D1 = IsingBimodule(2, 2, 1)
1515
C = rand([C0, C1])
1616
D = rand([D0, D1])
1717
s = rand((M, Mop, C, D))

0 commit comments

Comments
 (0)