Skip to content

Commit a4803f1

Browse files
committed
explicit import HalfInteger
1 parent 8aeb097 commit a4803f1

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

NDTensors/src/lib/Sectors/src/Sectors.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Sectors
22

33
using BlockArrays: blocklengths
4+
using HalfIntegers: Half, HalfInteger, twice
45

56
using NDTensors.LabelledNumbers:
67
LabelledInteger, label, label_type, labelled, unlabel, unlabel_type

NDTensors/src/lib/Sectors/src/category_definitions/ising.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
using HalfIntegers: HalfIntegers
2-
31
#
42
# Ising category
53
#
64
# (same fusion rules as su2{2})
75
#
86

97
struct Ising <: AbstractCategory
10-
l::HalfIntegers.Half{Int}
8+
l::Half{Int}
119
end
1210

1311
# TODO: Use `Val` dispatch here?
@@ -32,7 +30,7 @@ quantum_dimension(::NonGroupCategory, i::Ising) = (category_label(i) == 1//2) ?
3230
label_fusion_rule(::Type{Ising}, l1, l2) = label_fusion_rule(su2{2}, l1, l2)
3331

3432
# TODO: Use `Val` dispatch here?
35-
label_to_str(i::Ising) = ("1", "σ", "ψ")[HalfIntegers.twice(category_label(i)) + 1]
33+
label_to_str(i::Ising) = ("1", "σ", "ψ")[twice(category_label(i)) + 1]
3634

3735
function Base.show(io::IO, f::Ising)
3836
return print(io, "Ising(", label_to_str(f), ")")

NDTensors/src/lib/Sectors/src/category_definitions/o2.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# - l=-1 for zero odd
1515
# - l=+|m| for Sz=±|m|
1616
struct O2 <: AbstractCategory
17-
l::HalfIntegers.Half{Int}
17+
l::Half{Int}
1818
end
1919

2020
SymmetryStyle(::O2) = NonAbelianGroup()
@@ -28,9 +28,9 @@ _iszero(s::O2) = _iszero(category_label(s)) # matches both 0e and 0o
2828
_iszero_even(s::O2) = _iszero_even(category_label(s))
2929
_iszero_odd(s::O2) = _iszero_odd(category_label(s))
3030

31-
_iszero(l::HalfIntegers.HalfInteger) = _iszero_even(l) || _iszero_odd(l)
32-
_iszero_even(l::HalfIntegers.HalfInteger) = l == category_label(trivial(O2))
33-
_iszero_odd(l::HalfIntegers.HalfInteger) = l == category_label(zero_odd(O2))
31+
_iszero(l::HalfInteger) = _iszero_even(l) || _iszero_odd(l)
32+
_iszero_even(l::HalfInteger) = l == category_label(trivial(O2))
33+
_iszero_odd(l::HalfInteger) = l == category_label(zero_odd(O2))
3434

3535
quantum_dimension(::NonAbelianGroup, s::O2) = 2 - _iszero(s)
3636

NDTensors/src/lib/Sectors/src/category_definitions/su.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ function label_fusion_rule(::Type{<:SU{2}}, s1, s2)
9595
end
9696

9797
# define angular momentum-like interface using half-integers
98-
SU2(h::Number) = SU{2}((HalfIntegers.twice(HalfIntegers.HalfInteger(h)),))
98+
SU2(h::Number) = SU{2}((twice(HalfInteger(h)),))
9999

100100
# display SU2 using half-integers
101101
function Base.show(io::IO, s::SU{2})
102-
return print(io, "SU(2)[S=", HalfIntegers.half(quantum_dimension(s) - 1), "]")
102+
return print(io, "SU(2)[S=", half(quantum_dimension(s) - 1), "]")
103103
end
104104

105105
function Base.show(io::IO, ::MIME"text/plain", s::SU{2})
106-
return print(io, "S = ", HalfIntegers.half(quantum_dimension(s) - 1))
106+
return print(io, "S = ", half(quantum_dimension(s) - 1))
107107
end
108108

109109
#

NDTensors/src/lib/Sectors/src/category_definitions/su2k.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
struct su2{k} <: AbstractCategory
6-
j::HalfIntegers.Half{Int}
6+
j::Half{Int}
77
end
88

99
SymmetryStyle(::su2) = NonGroupCategory()

0 commit comments

Comments
 (0)