Expand description
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). TheMemoryOrderlayout 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-facingTensor,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]);Modules§
- expert
- Expert layer: per-call
ExecPolicycontrol.
Structs§
- Block
Coord - N-dimensional block coordinate.
- Block
Meta - Metadata for a single block within a block-sparse tensor.
- Block
Scalars - Per-sector real scalar values keyed by fused sector.
- Complex
- A complex number in Cartesian form.
- Einsum
Expr - Parsed einsum expression with N inputs (indices as ASCII codes)
- Native
Backend - Native backend using faer for GEMM and, with the
hpttfeature, HPTT for transpose (a naive kernel otherwise). - QNIndex
- Quantum-number index for one tensor leg.
- Tensor
- Tensor wrapping a
TensorDatabundle. - Trunc
SvdParams - Parameters for truncated SVD.
- U1Sector
- U(1) symmetry sector (integer charge).
- Z2Sector
- Z₂ symmetry sector (values 0 or 1).
Enums§
- Direction
- Leg direction for flux computation (see each variant).
- Exec
Policy - Per-call execution policy for a compute backend operation.
- Linalg
Error - Error from a linalg operation.
- Tensor
Error - Errors raised by tensor construction and manipulation.
Traits§
- Block
Sparse Host Ops - Host-defaulting method forms of the block-sparse explicit-backend operations.
- Compute
Backend - Pluggable compute backend trait
- Dense
Host Ops - Host-defaulting method forms of the dense explicit-backend operations.
- Linalg
Contract - Sealed tensor-keyed dispatch trait for two-operand tensor contraction.
- Linalg
Decompose - Sealed tensor-keyed dispatch trait for the four tensor decompositions.
- Linalg
Scale - Sealed tensor-keyed dispatch trait for diagonal scaling.
- OpsFor
- Compile-time marker: backend
Selfsupports operations on storage flavorSt. Implemented selectively per (backend, storage) pair, so a backend that cannot operate on a given storage simply omits the impl. - Scalar
- Scalar type for tensor elements (sealed trait).
- Sector
- Abelian symmetry sector.
Functions§
- contract
- Two-operand contraction over the einsum
notation, using the supplied backend and the auto-selected execution policy. - diag_
with_ backend - Diagonal extraction / construction. The backend argument is accepted for API uniformity with the other twins; this operation needs no kernel, so it is unused here.
- diagonal_
scale - Per-slice diagonal scaling along
axis, using the supplied backend. - eig_
with_ backend - General eigenvalue decomposition, using the supplied backend.
- eigh_
with_ backend - Self-adjoint eigenvalue decomposition, using the supplied backend.
- eigvals_
with_ backend - Eigenvalues-only general decomposition, using the supplied backend.
- eigvalsh_
with_ backend - Eigenvalues-only self-adjoint decomposition, using the supplied backend.
- einsum_
with_ backend - N-input Einstein summation, using the supplied backend.
- expm_
antihermitian_ with_ backend - Anti-Hermitian matrix exponential, using the supplied backend.
- expm_
hermitian_ with_ backend - Hermitian matrix exponential, using the supplied backend.
- expm_
with_ backend - General matrix exponential, using the supplied backend.
- inverse_
with_ backend - Matrix inverse via LU, using the supplied backend.
- linear_
combine - Linear combination of dense tensors:
Σ_i coefs[i] * tensors[i]. - lq
- Thin LQ of a tensor reshaped as a matrix, using the supplied backend.
- permute_
with_ backend - General axis permutation of a dense tensor, using the supplied backend.
- qr
- Thin QR of a tensor reshaped as a matrix, using the supplied backend.
- solve_
with_ backend - Linear solve
AX = Bvia LU, using the supplied backend. - svd
- Thin SVD of a tensor reshaped as a matrix, using the supplied backend.
- tensordot
- Tensordot: contract
lhsandrhsover the given axis pairs, emitting the output legs in their natural order (free left legs then free right legs, each in input axis order). The axis-pair face ofcontract, dispatched through the same tensor-keyed trait, so it serves both Dense and BlockSparse and returns a uniform tensor (rank-0 for a full contraction). - trace_
with_ backend - Partial trace over bond index pairs. The backend argument is accepted for API uniformity with the other twins; the partial trace needs no kernel, so it is unused here.
- trunc_
svd - Truncated SVD of a tensor reshaped as a matrix, using the supplied backend.
Type Aliases§
- Block
Sparse EigResult - Result of a block-sparse general (non-Hermitian) eigenvalue decomposition:
(eigenvalues, eigenvectors). - Block
Sparse Eigh Result - Result of a block-sparse self-adjoint eigenvalue decomposition:
(eigenvalues, eigenvectors). - Block
Sparse QrResult - Result of a block-sparse QR or LQ decomposition.
- Block
Sparse SvdResult - Result of a block-sparse SVD:
(U, S, Vt). - Block
Sparse Tensor - BlockSparse tensor alias.
- Block
Sparse Trunc SvdResult - Result of a truncated block-sparse SVD:
(U, S, Vt, trunc_err). - Dense
Tensor - Dense tensor alias.
- EigResult
- Result of a general eigenvalue decomposition:
(eigenvalues, eigenvectors). - Eigh
Result - Result of a self-adjoint eigenvalue decomposition:
(eigenvalues, eigenvectors). - Host
- The default host compute substrate, aliased so signatures name it through one stable alias rather than spelling the concrete backend type; repointing the substrate is then a one-line change.
- LqResult
- Result of a thin LQ decomposition:
(L, Q). - QrResult
- Result of a thin QR decomposition:
(Q, R). - SvdResult
- Result of a thin SVD decomposition:
(U, S, Vt). - Trunc
SvdResult - Result of a truncated SVD decomposition:
(U, S, Vt, trunc_err).