Skip to main content

get_boundary_edges

Function get_boundary_edges 

Source
pub fn get_boundary_edges<T, V>(
    treetn: &TreeTN<T, V>,
    region: &[V],
) -> Result<Vec<BoundaryEdge<T, V>>>
where T: TensorLike, T::Index: IndexLike, V: Clone + Hash + Eq + Send + Sync + Debug,
Expand description

Get all boundary edges for a given region in a TreeTN.

Returns edges connecting nodes inside the region to neighbors outside the region. This is useful for maintaining stable bond IDs across updates (e.g., for environment cache consistency).

§Arguments

  • treetn - The TreeTN to analyze
  • region - Nodes that are inside the region

§Returns

Vector of boundary edges, each containing the node in region, neighbor outside, and bond index.