1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//! ariadnetor: tensor network library in Rust.
//!
//! `ariadnetor` is the umbrella tensor library; it re-exports types and
//! functions from the layers listed below into its own namespace.
//! Each layer depends only on the layers listed earlier:
//!
//! - [`ariadnetor_core`] — backend-agnostic abstractions (`Scalar`,
//! `ComputeBackend`, `EinsumExpr`). The `MemoryOrder` layout type
//! is intentionally *not* re-exported: the umbrella's public API
//! hides memory layout from end users.
//! - [`ariadnetor_native`] — `NativeBackend`: faer (+ optional hptt-rs transpose).
//! - [`ariadnetor_tensor`] — user-facing `Tensor`, `DenseTensor`,
//! `BlockSparseTensor`, `Sector`, `QNIndex`.
//! - [`ariadnetor_linalg`] — backend-agnostic linear algebra over
//! `&Tensor` (contract, svd, qr, eigh, expm, …).
//!
//! `ariadnetor_mps` and `ariadnetor_algorithms` are separate consumer crates that
//! depend on the leaf crates directly rather than on this umbrella; they
//! are not re-exported here.
//!
//! # Example
//!
//! ```
//! use ariadnetor::DenseTensor;
//!
//! let a = DenseTensor::<f64>::zeros(vec![2, 3]);
//! let b = DenseTensor::<f64>::zeros(vec![3, 2]);
//!
//! assert_eq!(a.shape(), &[2, 3]);
//! assert_eq!(b.shape(), &[3, 2]);
//! ```
// Main types
pub use ;
// Block-sparse construction and introspection vocabulary: the index /
// sector / direction types an end user writes to build a symmetric tensor,
// plus the block coordinate / metadata types that block introspection
// returns. The storage / layout building blocks (`DenseStorage`,
// `DenseLayout`, the block-sparse counterparts, and the `Storage` /
// `StorageFor` / `TensorLayout` traits) and the joined `TensorData<St, L>`
// type are intentionally not re-exported: the umbrella hides memory layout
// and storage plumbing from end users. Crates that parameterize their own
// generic containers, define a new storage flavor, or perform cross-crate
// kernel access depend on `ariadnetor-tensor` directly rather than the umbrella.
pub use ;
// Backend-capability scaffolding: the `OpsFor<St>` marker and the `Host`
// substrate alias.
pub use ;
// Re-export from ariadnetor-core. `ExecPolicy` is the per-call parallelism
// knob the `expert` layer (re-exported below) takes by argument; without it on
// the umbrella an umbrella-only consumer could name `expert::permute` but not
// construct its policy argument.
pub use ;
// High-level free functions over host-resident dense tensors (no backend).
// `add_all` is intentionally not re-exported: it is `linear_combine` with
// all-unit coefficients, so the umbrella exposes only the general form.
pub use linear_combine;
// Explicit-backend dense free functions (backend supplied at the call site).
// The single-backend ergonomic surface is the `DenseHostOps` /
// `BlockSparseHostOps` extension traits re-exported below, not free functions.
pub use ;
// Tensor-keyed dispatch: the unified `svd` / `trunc_svd` / `qr` / `lq`
// (decomposition), `contract` / `tensordot`, and `diagonal_scale` free fns
// serve both Dense and BlockSparse via [`LinalgDecompose`] / [`LinalgContract`]
// / [`LinalgScale`], so one call site covers both flavors. The policy-explicit
// forms live under `expert`.
pub use ;
// The block-sparse low-level free functions are intentionally not
// re-exported: they are consumer-internal API that `ariadnetor-mps` /
// `ariadnetor-algorithms` reach through a direct `ariadnetor-linalg` dependency, not
// this umbrella. Their result types, by contrast, ARE re-exported below:
// the Host-defaulting `BlockSparseHostOps` methods return them, so an
// umbrella user must be able to name them — mirroring the dense result
// aliases re-exported further down.
pub use ;
// Ergonomic Host-defaulting method surface over the explicit-backend paths.
pub use ;
// Expert layer: the per-call `ExecPolicy` escape hatch over the auto-policy
// default. Re-exported as the `ariadnetor::expert` namespace so an umbrella-only
// consumer can reach `expert::permute`, `expert::contract`,
// `expert::svd`, … — the decomposition policy variants dispatch over the
// tensor type, so `expert::svd` serves both Dense and BlockSparse.
pub use expert;
// `flat_index` is intentionally not re-exported: it takes a `MemoryOrder`
// argument, so exposing it on the umbrella would reintroduce the
// memory-order leak that the rest of this surface closes. End users do not
// need memory-order-aware index math; in-tree code that does (tests) depends
// on `ariadnetor-tensor` directly.
// Linalg-level error type and SVD parameters.
pub use ;
pub use TensorError;
pub use ;
// Re-export the native backend
pub use NativeBackend;