[ITensorsNamedDimsArraysExt] Convert symmetric tensors #1578
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.
With this PR, we can now use
to_nameddimsarray
to convertITensor
,MPS
, andMPO
objects that contain tensors with the current format for non-fused abelian symmetric ITensors, i.e. anNDTensors.Tensor
withBlockSparse
storage andQN
blocks labels, to the new format we are developing, i.e. aNamedDimsArray
wrapping aBlockSparseArray
withGradedUnitRange
axes. In the current design, the block labels of the graded unit range still use the old format for sector labels, i.e. theITensors.QuantumNumbers.QN
type, but it would be easy to support converting those to the newSymmetrySectors.SectorProduct
format. Interestingly, it only required overloadingGradedAxes.fuse_labels(::QN, ::QN)
to make that work, which I think is a testament to the flexibility of the new code is design!@ogauthe I also fixed a missing overload for
GradedUnitRangeDual
that I hit when contracting ITensors with the new data format (similar to the definitions introduced in #1571).So to be concrete, after this PR you can do the following:
which returns
true
. You can see the data format ofb
is:To-do: