Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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 = "QuantumOperatorDefinitions"
uuid = "826dd319-6fd5-459a-a990-3a4f214664bf"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.2.9"
version = "0.2.10"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -19,7 +19,7 @@ QuantumOperatorDefinitionsITensorBaseExt = ["ITensorBase", "GradedArrays", "Name

[compat]
BlockArrays = "1.3.0"
GradedArrays = "0.4"
GradedArrays = "0.4, 0.5"
ITensorBase = "0.2, 0.3"
LinearAlgebra = "1.10"
NamedDimsArrays = "0.7, 0.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module QuantumOperatorDefinitionsGradedArraysExt

using BlockArrays: blocklasts, blocklength, blocklengths
using GradedArrays:
AbstractGradedUnitRange, GradedOneTo, SectorProduct, U1, Z, ×, dual, gradedrange, sectors
AbstractGradedUnitRange, GradedOneTo, U1, Z, ×, dual, gradedrange, sectorproduct, sectors
using QuantumOperatorDefinitions:
QuantumOperatorDefinitions,
@GradingType_str,
Expand Down Expand Up @@ -34,21 +34,21 @@ QuantumOperatorDefinitions.combine_axes(a::GradedOneTo, b::Base.OneTo) = a
QuantumOperatorDefinitions.combine_axes(a::Base.OneTo, b::GradedOneTo) = b

function Base.AbstractUnitRange(::GradingType"N", t::SiteType)
return gradedrange(map(i -> SectorProduct((; N = U1(i - 1))) => 1, 1:length(t)))
return gradedrange(map(i -> sectorproduct((; N = U1(i - 1))) => 1, 1:length(t)))
end
function Base.AbstractUnitRange(::GradingType"Sz", t::SiteType)
return gradedrange(map(i -> SectorProduct((; Sz = U1(i - 1))) => 1, 1:length(t)))
return gradedrange(map(i -> sectorproduct((; Sz = U1(i - 1))) => 1, 1:length(t)))
end
function Base.AbstractUnitRange(::GradingType"Sz↑", t::SiteType)
return AbstractUnitRange(GradingType"Sz"(), t)
end
function Base.AbstractUnitRange(::GradingType"Sz↓", t::SiteType)
return gradedrange(map(i -> SectorProduct((; Sz = U1(-(i - 1)))) => 1, 1:length(t)))
return gradedrange(map(i -> sectorproduct((; Sz = U1(-(i - 1)))) => 1, 1:length(t)))
end

function sector(gradingtype::GradingType, sec)
sectorname = Symbol(get(gradingtype, :name, name(gradingtype)))
return SectorProduct(NamedTuple{(sectorname,)}((sec,)))
return sectorproduct(NamedTuple{(sectorname,)}((sec,)))
end

function Base.AbstractUnitRange(s::GradingType"Nf", t::SiteType"Fermion")
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Aqua = "0.8.9"
BlockArrays = "1"
BlockSparseArrays = "0.8, 0.9, 0.10"
GradedArrays = "0.4"
GradedArrays = "0.5"
ITensorBase = "0.2, 0.3"
NamedDimsArrays = "0.7, 0.8"
QuantumOperatorDefinitions = "0.2"
Expand Down
Loading