pub fn factorize_tensor_to_treetn_with<T, V>(
tensor: &T,
topology: &TreeTopology<V, <T::Index as IndexLike>::Id>,
options: FactorizeOptions,
root: &V,
) -> Result<TreeTN<T, V>>Expand description
Factorize a dense tensor into a TreeTN using specified factorization options.
This function takes a dense tensor and a tree topology specification, then recursively decomposes the tensor using the specified algorithm to create a TreeTN.
§Algorithm
- Start from a leaf node, factorize to separate that node’s physical indices
- Contract the right factor with remaining tensor, repeat for next edge
- Continue until all edges are processed
§Arguments
tensor- The dense tensor to decomposetopology- Tree topology specifying nodes, edges, and physical index assignmentsoptions- Factorization options (algorithm, max_rank, rtol, etc.)
§Returns
A TreeTN representing the decomposed tensor.
§Errors
Returns an error if:
- The topology is invalid
- Physical index positions don’t match the tensor
- Factorization fails