pub trait Operator<T, V>{
// 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 implementingTensorLikeV: Node name type
Required Methods§
Sourcefn site_indices(&self) -> HashSet<T::Index>
fn site_indices(&self) -> HashSet<T::Index>
Get all site indices this operator acts on.
Returns the union of site indices across all nodes.
Sourcefn site_index_network(&self) -> &SiteIndexNetwork<V, T::Index>
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§
Sourcefn node_names(&self) -> HashSet<V>
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.