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//! - [`TensorDynLen`]: 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
20pub mod index;
21/// Dynamic-length tensor implementation.
22pub mod tensordynlen;
23
24// Contraction
25pub mod contract;
26pub(crate) mod structured_contraction;
27
28// Linear algebra modules
29pub mod direct_sum;
30pub mod factorize;
31pub mod qr;
32pub mod svd;
33
34pub use contract::{
35    build_diag_union, collect_sizes, contract, contract_owned, contract_owned_with_options,
36    contract_pair, contract_pair_with_options, contract_with_options, outer_product,
37    print_and_reset_contract_profile, remap_output_ids, remap_tensor_ids, reset_contract_profile,
38    tensordot, AxisUnionFind, ContractionOptions,
39};
40pub use index::{DefaultIndex, DefaultTagSet, DynId, DynIndex, Index, TagSet};
41pub use tensordynlen::{
42    compute_permutation_from_indices, diag_tensor_dyn_len,
43    print_and_reset_pairwise_contract_profile, reset_pairwise_contract_profile, unfold_split,
44    TensorDynLen,
45};
46
47// Re-export linear algebra functions and types
48pub use direct_sum::direct_sum;
49pub use factorize::{
50    factorize, Canonical, FactorizeAlg, FactorizeError, FactorizeOptions, FactorizeResult,
51};
52pub use qr::{default_qr_rtol, qr, qr_with, set_default_qr_rtol, QrError, QrOptions};
53pub use svd::{svd, svd_with, SvdError, SvdOptions};