Expand description
N-ary Einstein summation with nested contraction notation.
This crate provides an einsum frontend that parses nested string
notation (e.g. "(ij,jk),kl->il"), supports mixed f64 / Complex64
operands, and delegates pairwise contractions to strided_einsum2.
For three or more tensors in a single contraction node the
[omeco] greedy optimizer is used to find an efficient pairwise order.
§Quick start
ⓘ
use strided_opteinsum::{einsum, EinsumOperand};
let result = einsum("(ij,jk),kl->il", vec![a.into(), b.into(), c.into()], None)?;Structs§
- Buffer
Pool - Reusable buffer pool for intermediate tensor allocations.
- Einsum
Code - Parsed einsum code: contraction tree + final output indices.
Enums§
- Einsum
Error - Errors that can occur during einsum parsing or evaluation.
- Einsum
Node - Parsed contraction tree node (no operands, just structure).
- Einsum
Operand - A type-erased einsum operand holding either f64 or Complex64 strided data.
- Strided
Data - Type-erased strided data that can be either owned or borrowed.
- Typed
Tensor - A type-erased tensor that dispatches over f64 and Complex64 at runtime.
Traits§
- Einsum
Scalar - Scalar types that can be used as the output element type for
einsum_into.
Functions§
- einsum
- Parse and evaluate an einsum expression in one call.
- einsum_
into - Parse and evaluate an einsum expression, writing the result into a pre-allocated output buffer with alpha/beta scaling.
- einsum_
into_ with_ pool - Parse and evaluate an einsum expression into an output buffer with optional buffer pool reuse.
- einsum_
with_ pool - Parse and evaluate an einsum expression with optional buffer pool reuse.
- needs_
c64_ promotion - Returns true if any input is Complex64 (triggering promotion for all).
- parse_
einsum - Parse an einsum string like “(ij,jk),kl->il” into an EinsumCode.
Type Aliases§
- Result
- Convenience alias for
Result<T, EinsumError>.