Expand description
Dynamic-length tensor implementation.
Structs§
- IdxTensor
- Dynamic-rank tensor with structured payload storage – the central data type
of tensor4all.
IdxTensorstores a logical multi-dimensional tensor of supported scalar values (f32,f64,Complex32, orComplex64) together with a list ofDynIndexlabels.f64/Complex64tensors may use compactStoragesnapshots;f32/Complex32tensors retain an eager payload as the authoritative representation because compact storage supports only the 64-bit dtypes. The logical layout may be dense, diagonal, or explicitly structured. The indices carry unique identities (UUIDs) so that contraction, addition, and other binary operations can automatically match legs by identity rather than position. - Tensor
Hermitian Eigendecomposition - Hermitian eigendecomposition of a rank-2
IdxTensor. Eigenvectors are returned as a rank-2 tensor whose first index is the input matrix row index and whose second index labels eigenvector columns. The eigenvalues are detached primal values intended for nonsmooth selection logic such as truncation cutoffs.
Enums§
- IdxTensor
Error - Errors returned by the fallible numerical and comparison methods on
IdxTensor. The enum is intentionally owned bytensor4all-core: callers can match storage, shape, scalar, subtraction, and invalid-value failures without depending on the internalanyhowplumbing. Wrapped backend diagnostics retain their completestd::error::Error::sourcechain. - Structured
Selector Error - Errors returned when constructing a compact copy-selector tensor.
A copy-selector has logical values
scale * delta(left, right) * delta(site, selected_value)and is used to carry a bond through a fixed physical site without dense bond-squared storage. - Tensor
Storage Error - Error returned when
IdxTensor::storageorIdxTensor::to_storagecannot produce a compactf64/Complex64storage snapshot from the authoritative payload. Backend diagnostics remain available throughstd::error::Error::sourceinstead of being erased into a display string. The error is cloneable so a deferred failure can be retained by cloned tensors without rebuilding a detached primal value.
Traits§
- Random
Scalar - Trait for scalar types that can generate random values from a standard
normal distribution.
This enables the generic
IdxTensor::randomconstructor.
Functions§
- compute_
permutation_ from_ indices - Compute the permutation array from original indices to new indices.
This function finds the mapping from new indices to original indices by
matching index IDs. The result is a permutation array
permsuch thatnew_indices[i]corresponds tooriginal_indices[perm[i]]. - diag_
idx_ tensor - Create a diagonal tensor with dynamic rank from diagonal data.
- print_
and_ reset_ pairwise_ contract_ profile - Print and clear the aggregated pairwise
IdxTensorcontraction profile. - reset_
pairwise_ contract_ profile - Reset the aggregated pairwise
IdxTensorcontraction profile. - unfold_
split - Unfold a tensor into a matrix by splitting indices into left and right groups. This function validates the split, permutes the tensor so that left indices come first, and returns a rank-2 native tenferro tensor along with metadata.