Skip to content

Commit

Permalink
set convention 1. sectors 2. range
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Mar 1, 2024
1 parent d721155 commit 31bc1ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function tensor_product(
return fuse(isdual ? dual(l1) : l1, isdual ? dual(l2) : l2)
end,
)
return gradedrange(a, nondual_sectors_a, isdual)
return gradedrange(nondual_sectors_a, a, isdual)
end

function Base.show(io::IO, mimetype::MIME"text/plain", a::AbstractGradedUnitRange)
Expand Down
6 changes: 3 additions & 3 deletions NDTensors/src/lib/GradedAxes/src/gradedunitrange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function gradedrange(sectors_lengths::Vector{<:Pair{<:Any,Int}}, isdual=false)
return gradedrange(first.(sectors_lengths), last.(sectors_lengths), isdual)
end

function gradedrange(a::BlockedUnitRange, nondual_sectors::Vector, isdual=false)
if length(nondual_sectors) != length(blocks(a))
throw(DomainError("BlockedUnitRange and sectors lengths do not match"))
function gradedrange(nondual_sectors::Vector, a::BlockedUnitRange, isdual=false)
if length(nondual_sectors) != length(blocks(a)) != length(nondual_sectors)
throw(DomainError("Number of sectors and number of blocks do not match"))
end
return GradedUnitRange(a, nondual_sectors, isdual)
end
Expand Down

0 comments on commit 31bc1ba

Please sign in to comment.