Skip to content

Commit

Permalink
use GradedUnitRanges map_blocklabels
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Dec 17, 2024
1 parent 8767c22 commit e0169d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SymmetrySectors"
uuid = "f8a8ad64-adbc-4fce-92f7-ffe2bb36a86e"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.1.0"
version = "0.1.1"

[deps]
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
Expand All @@ -11,7 +11,7 @@ LabelledNumbers = "f856a3a6-4152-4ec4-b2a7-02c1a55d7993"

[compat]
BlockArrays = "1.2.0"
GradedUnitRanges = "0.1.0"
GradedUnitRanges = "0.1.1"
HalfIntegers = "1.6.0"
LabelledNumbers = "0.1.0"
julia = "1.10"
6 changes: 1 addition & 5 deletions src/sector_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using BlockArrays: blocklengths
using LabelledNumbers: LabelledInteger, label, labelled, unlabel
using GradedUnitRanges: GradedUnitRanges, dual
using GradedUnitRanges: GradedUnitRanges, dual, map_blocklabels

# ===================================== Definition =======================================
struct SectorProduct{Sectors} <: AbstractSector
Expand Down Expand Up @@ -232,10 +232,6 @@ end

arguments_diff(nt1::NamedTuple, nt2::NamedTuple) = symdiff_keys(nt1, nt2)

function map_blocklabels(f, r::AbstractUnitRange)
return gradedrange(labelled.(unlabel.(blocklengths(r)), f.(blocklabels(r))))
end

function shared_arguments_fusion_rule(shared1::NT, shared2::NT) where {NT<:NamedTuple}
tuple_fused = shared_arguments_fusion_rule(values(shared1), values(shared2))
return map_blocklabels(SectorProduct NT arguments SectorProduct, tuple_fused)
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.9"
GradedUnitRanges = "0.1.1"
SafeTestsets = "0.1"
Suppressor = "0.2"
Test = "1.10"

0 comments on commit e0169d6

Please sign in to comment.