|
3 | 3 | # this is mainly meant for testing within TensorKit without relying on MultiTensorKit |
4 | 4 | #------------------------------------------------------------------------------# |
5 | 5 |
|
6 | | -# 𝒞 ℳ |
| 6 | +# 𝒞 ℳ |
7 | 7 | # ℳᵒᵖ 𝒟 |
8 | | -struct IsingBimod <: Sector |
| 8 | +struct IsingBimodule <: Sector |
9 | 9 | row::Int |
10 | 10 | col::Int |
11 | 11 | label::Int |
12 | | - function IsingBimod(row::Int, col::Int, label::Int) |
| 12 | + function IsingBimodule(row::Int, col::Int, label::Int) |
13 | 13 | 1 <= row <= 2 && 1 <= col <= 2 || |
14 | 14 | throw(DomainError(lazy"Invalid subcategory ($row, $col)")) |
15 | 15 | 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)")) |
17 | 17 | return new(row, col, label) |
18 | 18 | end |
19 | 19 | end |
20 | 20 |
|
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)) |
24 | 24 |
|
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) |
28 | 28 |
|
29 | | -⊗(a::IsingBimod, b::IsingBimod) = IsingBimodIterator(a, b) |
| 29 | +⊗(a::IsingBimodule, b::IsingBimodule) = IsingBimoduleIterator(a, b) |
30 | 30 |
|
31 | | -struct IsingBimodIterator |
32 | | - a::IsingBimod |
33 | | - b::IsingBimod |
| 31 | +struct IsingBimoduleIterator |
| 32 | + a::IsingBimodule |
| 33 | + b::IsingBimodule |
34 | 34 | end |
35 | 35 |
|
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 |
39 | 39 |
|
40 | | -function Base.iterate(iter::IsingBimodIterator, state=0) |
| 40 | +function Base.iterate(iter::IsingBimoduleIterator, state=0) |
41 | 41 | a, b = iter.a, iter.b |
42 | 42 | a.col == b.row || return nothing |
43 | 43 |
|
44 | 44 | _state = (a.row == b.col == a.col) ? mod(a.label + b.label, 2) : state |
45 | 45 | 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 |
47 | 47 | end |
48 | 48 |
|
49 | | -Base.convert(::Type{IsingBimod}, labels::NTuple{3,Int}) = IsingBimod(labels...) |
| 49 | +Base.convert(::Type{IsingBimodule}, labels::NTuple{3,Int}) = IsingBimodule(labels...) |
50 | 50 |
|
51 | | -function Base.convert(::Type{IsingAnyon}, a::IsingBimod) # identify RepZ2 ⊕ RepZ2 ≅ Ising |
| 51 | +function Base.convert(::Type{IsingAnyon}, a::IsingBimodule) # identify RepZ2 ⊕ RepZ2 ≅ Ising |
52 | 52 | (a.row != a.col) && return IsingAnyon(:σ) |
53 | 53 | return IsingAnyon(a.label == 0 ? :I : :ψ) |
54 | 54 | end |
55 | 55 |
|
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 |
58 | 58 |
|
59 | | -function Nsymbol(a::IsingBimod, b::IsingBimod, c::IsingBimod) |
| 59 | +function Nsymbol(a::IsingBimodule, b::IsingBimodule, c::IsingBimodule) |
60 | 60 | if (a.row != c.row) || (a.col != b.row) || (b.col != c.col) |
61 | 61 | throw(ArgumentError("invalid fusion channel")) |
62 | 62 | end |
63 | 63 | return Nsymbol(convert(IsingAnyon, a), convert(IsingAnyon, b), convert(IsingAnyon, c)) |
64 | 64 | end |
65 | 65 |
|
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} |
67 | 67 | Nsymbol(a, b, e) && Nsymbol(e, c, d) && |
68 | 68 | Nsymbol(b, c, f) && Nsymbol(a, f, d) || return 0.0 |
69 | 69 | return Fsymbol(convert(IsingAnyon, a), convert(IsingAnyon, b), convert(IsingAnyon, c), |
70 | 70 | convert(IsingAnyon, d), convert(IsingAnyon, e), convert(IsingAnyon, f)) |
71 | 71 | end |
72 | 72 |
|
73 | 73 | # ℳ ↔ ℳ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) |
75 | 75 |
|
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) |
78 | 78 |
|
79 | | -function Base.one(a::IsingBimod) |
| 79 | +function Base.one(a::IsingBimodule) |
80 | 80 | a.row == a.col || |
81 | 81 | 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) |
83 | 83 | end |
84 | 84 |
|
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 |
86 | 88 |
|
87 | | -function Base.isless(a::IsingBimod, b::IsingBimod) |
| 89 | +function Base.isless(a::IsingBimodule, b::IsingBimodule) |
88 | 90 | return isless((a.col, a.row, a.label), (b.col, b.row, b.label)) |
89 | 91 | end |
90 | 92 |
|
91 | | -function Base.hash(a::IsingBimod, h::UInt) |
| 93 | +function Base.hash(a::IsingBimodule, h::UInt) |
92 | 94 | return hash(a.label, hash(a.row, hash(a.col, h))) |
93 | 95 | end |
94 | 96 |
|
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 |
97 | 99 | print(io, (a.row, a.col, a.label)) |
98 | 100 | else |
99 | | - print(io, "IsingBimod", (a.row, a.col, a.label)) |
| 101 | + print(io, "IsingBimodule", (a.row, a.col, a.label)) |
100 | 102 | end |
101 | 103 | return nothing |
102 | 104 | end |
0 commit comments