Skip to main content

tensor4all_core/defaults/
mod.rs

1//! Default concrete type implementations.
2//!
3//! This module provides the default concrete types for tensor network operations:
4//!
5//! - [`DynId`]: Runtime identity (UUID-based unique identifier)
6//! - [`TagSet`]: Tag set for metadata (Arc-wrapped for cheap cloning)
7//! - [`Index`]: Generic index type (`Index<Id, Tags>`)
8//! - [`DynIndex`]: Default index type (`Index<DynId, TagSet>`)
9//! - [`IdxTensor`]: Dense tensor with dynamic rank
10//!
11//! Linear algebra operations:
12//! - [`svd::svd`]: Singular Value Decomposition
13//! - [`qr::qr`]: QR decomposition
14//! - [`factorize::factorize`]: Unified factorization interface
15//! - [`direct_sum::direct_sum`]: Direct sum of tensors
16//!
17//! These types are suitable for most tensor network applications and provide
18//! a good balance of flexibility and performance.
19
20#[cfg(feature = "tenferro-cuda")]
21mod cuda;
22/// Dynamic-length tensor implementation.
23pub mod idx_tensor;
24pub mod index;
25
26// Contraction
27pub mod contract;
28pub(crate) mod structured_contraction;
29
30// Linear algebra modules
31pub mod direct_sum;
32pub mod factorize;
33pub mod qr;
34pub mod svd;
35
36pub use contract::{
37    contract, contract_owned, contract_owned_with_options, contract_pair,
38    contract_pair_with_options, contract_with_options, outer_product,
39    print_and_reset_contract_profile, reset_contract_profile, tensordot, ContractionOptions,
40};
41#[cfg(feature = "tenferro-cuda")]
42pub use cuda::IdxTensorCudaError;
43pub use idx_tensor::{
44    compute_permutation_from_indices, diag_idx_tensor, print_and_reset_pairwise_contract_profile,
45    reset_pairwise_contract_profile, unfold_split, IdxTensor, IdxTensorError, TensorStorageError,
46};
47pub use index::{DefaultIndex, DefaultTagSet, DynId, DynIndex, Index, TagSet};
48
49// Re-export linear algebra functions and types
50pub use direct_sum::direct_sum;
51pub use factorize::{
52    factorize, Canonical, FactorizeAlg, FactorizeError, FactorizeOptions, FactorizeResult,
53};
54pub use qr::{default_qr_rtol, qr, qr_with, set_default_qr_rtol, QrError, QrOptions};
55pub use svd::{svd, svd_with, SvdError, SvdOptions};