Expand description
Core tensor operations and types for tensor4all-rs.
This crate provides the foundational types and operations for tensor networks:
- Index types:
DynIndex,Index,DynIdfor tensor indices - Tag sets:
TagSet,TagSetLikefor metadata tagging - Tensors:
TensorDynLenfor dynamic-rank dense tensors - Operations: Contraction, SVD, QR decomposition, factorization
§Example
use tensor4all_core::{Index, DynIndex, TensorDynLen};
// Create indices with dynamic identity
let i = Index::new_dyn(2);
let j = Index::new_dyn(3);
// Create a tensor
let data = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0];
let t = TensorDynLen::from_dense(vec![i.clone(), j.clone()], data).unwrap();Re-exports§
pub use col_major_array::ColMajorArray;pub use col_major_array::ColMajorArrayMut;pub use col_major_array::ColMajorArrayRef;pub use defaults::index;pub use defaults::DefaultIndex;pub use defaults::DefaultTagSet;pub use defaults::DynId;pub use defaults::DynIndex;pub use defaults::Index;pub use defaults::TagSet;pub use index_like::ConjState;pub use index_like::IndexLike;pub use index_ops::check_unique_indices;pub use index_ops::common_ind_positions;pub use index_ops::common_inds;pub use index_ops::hascommoninds;pub use index_ops::hasind;pub use index_ops::hasinds;pub use index_ops::noncommon_inds;pub use index_ops::prepare_contraction;pub use index_ops::prepare_contraction_pairs;pub use index_ops::replaceinds;pub use index_ops::replaceinds_in_place;pub use index_ops::union_inds;pub use index_ops::unique_inds;pub use index_ops::ContractionError;pub use index_ops::ContractionSpec;pub use index_ops::ReplaceIndsError;pub use smallstring::SmallChar;pub use smallstring::SmallString;pub use smallstring::SmallStringError;pub use tagset::Tag;pub use tagset::TagSetError;pub use tagset::TagSetLike;pub use tensor_index::TensorIndex;pub use defaults::tensordynlen as tensor;pub use defaults::tensordynlen::compute_permutation_from_indices;pub use defaults::tensordynlen::diag_tensor_dyn_len;pub use defaults::tensordynlen::unfold_split;pub use defaults::tensordynlen::RandomScalar;pub use defaults::tensordynlen::TensorAccess;pub use defaults::tensordynlen::TensorDynLen;pub use tensor_like::AllowedPairs;pub use tensor_like::Canonical;pub use tensor_like::DirectSumResult;pub use tensor_like::FactorizeAlg;pub use tensor_like::FactorizeError;pub use tensor_like::FactorizeOptions;pub use tensor_like::FactorizeResult;pub use tensor_like::TensorLike;pub use defaults::contract;pub use defaults::contract::contract_connected;pub use defaults::contract::contract_multi;pub use defaults::contract::print_and_reset_contract_profile;pub use defaults::contract::reset_contract_profile;pub use defaults::direct_sum::direct_sum;pub use defaults::factorize::factorize;pub use defaults::qr::default_qr_rtol;pub use defaults::qr::qr;pub use defaults::qr::qr_with;pub use defaults::qr::set_default_qr_rtol;pub use defaults::qr::QrError;pub use defaults::qr::QrOptions;pub use defaults::svd::default_svd_rtol;pub use defaults::svd::set_default_svd_rtol;pub use defaults::svd::svd;pub use defaults::svd::svd_with;pub use defaults::svd::SvdError;pub use defaults::svd::SvdOptions;pub use global_default::GlobalDefault;pub use global_default::InvalidRtolError;pub use truncation::DecompositionAlg;pub use truncation::HasTruncationParams;pub use truncation::TruncationParams;
Modules§
- any_
scalar - Re-export of dynamic scalar utilities.
- block_
tensor - Block tensor type for GMRES with block matrices.
- col_
major_ array - N-dimensional column-major array types.
- defaults
- Default concrete type implementations.
- direct_
sum - Re-export of direct sum operations.
- factorize
- Re-export of factorization operations.
- global_
default - Global default values with atomic access.
- index_
like - IndexLike trait for abstracting index types.
- index_
ops - Index operations (replacement, set operations, contraction preparation).
- krylov
- Krylov subspace methods for solving linear equations with abstract tensors.
- qr
- Re-export of QR decomposition operations.
- scalar
- Common scalar trait for tensor operations.
- smallstring
- Stack-allocated fixed-capacity string types for ITensors.jl compatibility.
- storage
- Re-export of snapshot storage utilities.
- svd
- Re-export of SVD decomposition operations.
- tagset
- Tag set types for tensor metadata.
- tensor_
index - TensorIndex trait for index operations on tensor-like objects.
- tensor_
like - TensorLike trait for unifying tensor types.
- truncation
- Common truncation options and traits.
Structs§
- Storage
- Storage backend for tensor data.
- Structured
Storage - Structured tensor snapshot storage.
Traits§
- Common
Scalar - Common scalar trait for matrix and tensor operations.
- SumFrom
Storage - Types that can be computed as the result of a reduction over
Storage. - Tensor
Element - Public scalar element types supported by tensor4all dense/diag constructors.
Functions§
- make_
mut_ storage - Helper to get a mutable reference to storage, cloning if needed (COW).
- mindim
- Get the minimum dimension from a slice of dimensions. This is used for DiagTensor where all indices must have the same dimension.
- print_
and_ reset_ native_ einsum_ profile - Print and clear the aggregated native einsum profile.
- reset_
native_ einsum_ profile - Reset the aggregated native einsum profile.
Type Aliases§
- AnyScalar
- Backward-compatible scalar type name used across tensor4all APIs.