Skip to main content

Operator

Trait Operator 

Source
pub trait Operator<T, V>
where T: TensorLike, V: Clone + Hash + Eq + Send + Sync + Debug,
{ // Required methods fn site_indices(&self) -> HashSet<T::Index>; fn site_index_network(&self) -> &SiteIndexNetwork<V, T::Index>; // Provided method fn node_names(&self) -> HashSet<V> { ... } }
Expand description

Trait for operators that can act on tensor network states.

An operator has:

  • A set of site indices it acts on
  • A site index network describing its structure

This trait is used for composing multiple operators into a single operator and for validating operator compatibility.

§Type Parameters

  • T: Tensor type implementing TensorLike
  • V: Node name type

Required Methods§

Source

fn site_indices(&self) -> HashSet<T::Index>

Get all site indices this operator acts on.

Returns the union of site indices across all nodes.

Source

fn site_index_network(&self) -> &SiteIndexNetwork<V, T::Index>

Get the site index network describing this operator’s structure.

The site index network contains:

  • Topology: which nodes connect to which
  • Site space: which site indices belong to each node

Provided Methods§

Source

fn node_names(&self) -> HashSet<V>

Get the set of node names this operator covers.

Default implementation extracts node names from the site index network.

Implementors§

Source§

impl<T, V> Operator<T, V> for TreeTN<T, V>
where T: TensorLike, T::Index: IndexLike + Clone + Hash + Eq, V: Clone + Hash + Eq + Send + Sync + Debug,

Source§

impl<T, V> Operator<T, V> for LinearOperator<T, V>
where T: TensorLike, T::Index: IndexLike + Clone + Hash + Eq, V: Clone + Hash + Eq + Send + Sync + Debug,