Crate tensor4all_core

Crate tensor4all_core 

Source
Expand description

Core tensor operations and types for tensor4all-rs.

This crate provides the foundational types and operations for tensor networks:

§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.
StructuredStorage
Structured tensor snapshot storage.

Traits§

CommonScalar
Common scalar trait for matrix and tensor operations.
SumFromStorage
Types that can be computed as the result of a reduction over Storage.
TensorElement
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.