Skip to content

Commit

Permalink
make latest JET happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed Oct 29, 2024
1 parent 362a7d4 commit a1a569a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end
end

@inline localoffset(d, I::Tuple{Int}, sz::Tuple{Int}) = 0
@inline function localoffset(d, I, sz)
@inline function localoffset(d, I::NTuple{N,Int}, sz::Tuple{N,Int}) where {N}
offset = 0
for i in 1:(I[1] - 1)
offset += num_manhattan_points(d - i + 1, Base.tail(sz))
Expand All @@ -55,7 +55,7 @@ end

# inverse mapping
@inline invertlocaloffset(d, offset, sz::Tuple{Int}) = (d + 1,)
@inline function invertlocaloffset(d, offset, sz)
@inline function invertlocaloffset(d, offset, sz::Tuple{Int,Int,Vararg{Int}})
i₁ = 1
while i₁ < sz[1]
jump = num_manhattan_points(d - i₁ + 1, Base.tail(sz))
Expand Down
6 changes: 3 additions & 3 deletions src/irreps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Base.conj(c::U1Irrep) = U1Irrep(-c.charge)
(c1::U1Irrep, c2::U1Irrep) = (U1Irrep(c1.charge + c2.charge),)

Base.IteratorSize(::Type{SectorValues{U1Irrep}}) = IsInfinite()
function Base.iterate(::SectorValues{U1Irrep}, i=0)
function Base.iterate(::SectorValues{U1Irrep}, i::Int=0)
return i <= 0 ? (U1Irrep(half(i)), (-i + 1)) : (U1Irrep(half(i)), -i)
end
function Base.getindex(::SectorValues{U1Irrep}, i::Int)
Expand Down Expand Up @@ -188,7 +188,7 @@ Base.conj(s::SU2Irrep) = s
(s1::SU2Irrep, s2::SU2Irrep) = SectorSet{SU2Irrep}(abs(s1.j - s2.j):(s1.j + s2.j))

Base.IteratorSize(::Type{SectorValues{SU2Irrep}}) = IsInfinite()
Base.iterate(::SectorValues{SU2Irrep}, i=0) = (SU2Irrep(half(i)), i + 1)
Base.iterate(::SectorValues{SU2Irrep}, i::Int=0) = (SU2Irrep(half(i)), i + 1)
function Base.getindex(::SectorValues{SU2Irrep}, i::Int)
return 1 <= i ? SU2Irrep(half(i - 1)) : throw(BoundsError(values(SU2Irrep), i))
end
Expand Down Expand Up @@ -269,7 +269,7 @@ Base.getindex(::IrrepTable, ::Type{CU₁}) = CU1Irrep
Base.convert(::Type{CU1Irrep}, (j, s)::Tuple{Real,Integer}) = CU1Irrep(j, s)

Base.IteratorSize(::Type{SectorValues{CU1Irrep}}) = IsInfinite()
function Base.iterate(::SectorValues{CU1Irrep}, state=(0, 0))
function Base.iterate(::SectorValues{CU1Irrep}, state::Tuple{Int,Int}=(0, 0))
j, s = state
if iszero(j) && s == 0
return CU1Irrep(j, s), (j, 1)
Expand Down

0 comments on commit a1a569a

Please sign in to comment.