Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GradedUnitRanges.map_blocklabels #6

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
mtfishman marked this conversation as resolved.
Show resolved Hide resolved
SafeTestsets = "0.1"
Suppressor = "0.2"
Test = "1.10"
Loading