Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress for a new design of
GradedUnitRanges
.We are not satisfied with the current design as we want to enforce
length(g::GradedUnitRange) == quantum_dimension(g)
. Consequently, we cannot use the genericLabelledUnitRange
- and more generally theLabelledNumbers.jl
interface - as the range of a single block.The new design we settled on pushes more information at the level of the block, and the resulting
GradedUnitRange
is mostly a mortar of these block unit ranges. We want to use this new type to index arrays that would have an explicit Kronecker product structure and would like our axes to share this Kronecker product structure. However, most array types, includingBlockSparseArray
, imposeAbstractUnitRange
as axes. Therefore we cannot use a genericKroneckerProduct{A,B} <: AbstractKroneckerProduct
as axis type because it cannot be aAbstractUnitRange
.In this PR, I define a custom
SectorUnitRange <: AbstractUnitRange
type to index a single sector, while preserving theBlockArrays.jl
interface. I use it as the building block for a new design of graded axis currently namedNewGradedUnitRange <: AbstractGradedUnitRange
. The implementation and structure fields may change, however a large part of the new behavior is already made explicit in the tests.Todo:
BlockSparseArray
is possibleKroneckerProduct
type and replacegetindex(g, ::Tuple{Colon,Any})
withgetindex(g, ::KroneckerProduct(Colon,Any)
NewGradedUnitRange
tensor_product
interface forNewGradedUnitRange
GradedUnitRange
,GradedOneTo
,GradedUnitRangeDual
,LabelledUnitRangeDual