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:
IdxTensorfor dynamic-rank dense tensors - Operations: Contraction, SVD, QR decomposition, factorization
§Example
use tensor4all_core::{Index, DynIndex, IdxTensor};
// 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 = IdxTensor::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 self::matrixluci::MatrixLuciScalar;pub use cached_function::cache_key::CacheKey;pub use cached_function::error::CacheKeyError;pub use cached_function::index_int::IndexInt;pub use cached_function::CachedFunction;pub use error::MatrixCIError;pub use error::Result;pub use floating_zone::floating_zone_walk;pub use indexset::IndexSet;pub use indexset::LocalIndex;pub use indexset::MultiIndex;pub use matrixaca::MatrixACA;pub use matrixlu::rrlu;pub use matrixlu::rrlu_mut;pub use matrixlu::RrLU;pub use matrixlu::RrLUOptions;pub use scalar::Scalar;pub use traits::AbstractMatrixCI;pub use scalar::Scalar as CommonScalar;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::sort_indices_deterministic;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::has_common_inds;pub use index_ops::has_inds;pub use index_ops::hasind;pub use index_ops::noncommon_inds;pub use index_ops::replace_indices;pub use index_ops::replace_indices_mut;pub use index_ops::union_inds;pub use index_ops::unique_inds;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::idx_tensor as tensor;pub use any_scalar::AnyScalar;pub use any_scalar::AnyScalarError;pub use defaults::idx_tensor::compute_permutation_from_indices;pub use defaults::idx_tensor::diag_idx_tensor;pub use defaults::idx_tensor::unfold_split;pub use defaults::idx_tensor::IdxTensor;pub use defaults::idx_tensor::IdxTensorError;pub use defaults::idx_tensor::StructuredSelectorError;pub use defaults::idx_tensor::TensorStorageError;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::LinearizationOrder;pub use tensor_like::TensorConstructionLike;pub use tensor_like::TensorContractionLike;pub use tensor_like::TensorFactorizationLike;pub use tensor_like::TensorLike;pub use tensor_like::TensorVectorSpace;pub use tensor_like::TensorVectorSpaceError;pub use defaults::contract::contract;pub use defaults::contract::contract_owned;pub use defaults::contract::contract_owned_with_options;pub use defaults::contract::contract_pair;pub use defaults::contract::contract_pair_with_operand_options;pub use defaults::contract::contract_pair_with_options;pub use defaults::contract::contract_with_options;pub use defaults::contract::outer_product;pub use defaults::contract::print_and_reset_contract_profile;pub use defaults::contract::reset_contract_profile;pub use defaults::contract::tensordot;pub use defaults::contract::ContractionOptions;pub use defaults::contract::PairwiseContractionOptions;pub use defaults::idx_tensor::print_and_reset_pairwise_contract_profile;pub use defaults::idx_tensor::reset_pairwise_contract_profile;pub use defaults::direct_sum::direct_sum;pub use defaults::factorize::factorize;pub use defaults::factorize::factorize_full_rank;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_truncation_policy;pub use defaults::svd::set_default_svd_truncation_policy;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::validate_svd_truncation_options;pub use truncation::DecompositionAlg;pub use truncation::InvalidThresholdError;pub use truncation::SingularValueMeasure;pub use truncation::SvdTruncationOptionsError;pub use truncation::SvdTruncationPolicy;pub use truncation::ThresholdScale;pub use truncation::TruncationRule;
Modules§
- any_
scalar - Dynamic scalar compatibility wrapper built on rank-0
IdxTensor. - block_
tensor - Block tensor type for GMRES with block matrices.
- cached_
function - Cached function wrapper for expensive function evaluations.
- col_
major_ array - N-dimensional column-major array types.
- defaults
- Default concrete type implementations.
- direct_
sum - Re-export of direct sum operations.
- error
- Error types for tensor4all-core.
- factorize
- Re-export of factorization operations.
- floating_
zone - Greedy coordinate-descent (floating-zone) search for high-error points.
- global_
default - Global default values with atomic access.
- index_
key - Bit-packed integer keys for multi-index maps. Bit-packed integer keys for multi-index maps.
- index_
like - IndexLike trait for abstracting index types.
- index_
ops - Index operations (replacement, set operations, contraction preparation).
- indexset
- Index set for managing ordered collections with bidirectional lookup.
- krylov
- Krylov subspace methods for solving linear equations with abstract tensors.
- matrixaca
- Adaptive Cross Approximation (ACA) implementation.
- matrixlu
- Rank-Revealing LU decomposition (rrLU) implementation.
- matrixluci
- Low-level LUCI / rrLU substrate.
- prelude
- Commonly used traits, types, and functions for tensor construction, contraction, and factorization.
- qr
- Re-export of QR decomposition operations.
- scalar
- Common scalar trait for matrix and tensor operations.
- smallstring
- Stack-allocated fixed-capacity string types for ITensors.jl compatibility.
- 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.
- traits
- Abstract traits for matrix cross interpolation.
- truncation
- Truncation policy types for decomposition algorithms.
Macros§
- scalar_
tests - Macro to generate f64 and Complex64 test variants from a generic test function.
Structs§
- MatrixLUCI
- Matrix LU-based Cross Interpolation.
- Matrix
Luci Factors - High-level factors produced by MatrixLUCI.
Traits§
- Tensor
Element - Public scalar element types supported by tensor4all dense/diag constructors.
Functions§
- matrix_
luci_ factors_ from_ blocks - Factorize a lazily supplied matrix with MatrixLUCI block-rook search.
- matrix_
luci_ factors_ from_ matrix - Factorize a dense matrix with MatrixLUCI.
- matrix_
luci_ factors_ from_ matrix_ owned - Factorize a dense matrix with MatrixLUCI while consuming the input matrix.
- print_
and_ reset_ native_ einsum_ profile - Print and clear the aggregated native einsum profile.
- reset_
native_ einsum_ profile - Reset the aggregated native einsum profile.