Skip to main content

Crate ariadnetor

Crate ariadnetor 

Source
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). The MemoryOrder layout type is intentionally not re-exported: the umbrella’s public API hides memory layout from end users.
  • ariadnetor_nativeNativeBackend: 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]);

Modules§

expert
Expert layer: per-call ExecPolicy control.

Structs§

BlockCoord
N-dimensional block coordinate.
BlockMeta
Metadata for a single block within a block-sparse tensor.
BlockScalars
Per-sector real scalar values keyed by fused sector.
Complex
A complex number in Cartesian form.
EinsumExpr
Parsed einsum expression with N inputs (indices as ASCII codes)
NativeBackend
Native backend using faer for GEMM and, with the hptt feature, HPTT for transpose (a naive kernel otherwise).
QNIndex
Quantum-number index for one tensor leg.
Tensor
Tensor wrapping a TensorData bundle.
TruncSvdParams
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).
ExecPolicy
Per-call execution policy for a compute backend operation.
LinalgError
Error from a linalg operation.
TensorError
Errors raised by tensor construction and manipulation.

Traits§

BlockSparseHostOps
Host-defaulting method forms of the block-sparse explicit-backend operations.
ComputeBackend
Pluggable compute backend trait
DenseHostOps
Host-defaulting method forms of the dense explicit-backend operations.
LinalgContract
Sealed tensor-keyed dispatch trait for two-operand tensor contraction.
LinalgDecompose
Sealed tensor-keyed dispatch trait for the four tensor decompositions.
LinalgScale
Sealed tensor-keyed dispatch trait for diagonal scaling.
OpsFor
Compile-time marker: backend Self supports operations on storage flavor St. 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 = B via LU, using the supplied backend.
svd
Thin SVD of a tensor reshaped as a matrix, using the supplied backend.
tensordot
Tensordot: contract lhs and rhs over 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 of contract, 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§

BlockSparseEigResult
Result of a block-sparse general (non-Hermitian) eigenvalue decomposition: (eigenvalues, eigenvectors).
BlockSparseEighResult
Result of a block-sparse self-adjoint eigenvalue decomposition: (eigenvalues, eigenvectors).
BlockSparseQrResult
Result of a block-sparse QR or LQ decomposition.
BlockSparseSvdResult
Result of a block-sparse SVD: (U, S, Vt).
BlockSparseTensor
BlockSparse tensor alias.
BlockSparseTruncSvdResult
Result of a truncated block-sparse SVD: (U, S, Vt, trunc_err).
DenseTensor
Dense tensor alias.
EigResult
Result of a general eigenvalue decomposition: (eigenvalues, eigenvectors).
EighResult
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).
TruncSvdResult
Result of a truncated SVD decomposition: (U, S, Vt, trunc_err).