Skip to main content

contract_naive_to_treetn

Function contract_naive_to_treetn 

Source
pub fn contract_naive_to_treetn<T, V>(
    tn_a: &TreeTN<T, V>,
    tn_b: &TreeTN<T, V>,
    center: &V,
    _max_rank: Option<usize>,
    _svd_policy: Option<SvdTruncationPolicy>,
    _qr_rtol: Option<f64>,
) -> Result<TreeTN<T, V>>
where T: TensorLike, <T::Index as IndexLike>::Id: Clone + Hash + Eq + Ord + Debug + Send + Sync, V: Clone + Hash + Eq + Ord + Send + Sync + Debug,
Expand description

Contract two TreeTNs using naive contraction, then decompose back to TreeTN.

This method:

  1. Contracts both networks to full tensors
  2. Contracts the tensors along common (site) indices
  3. Decomposes the result back to a TreeTN using the original topology

This is O(exp(n)) in memory and is primarily useful for debugging and testing.