Skip to main content

ContractableNetwork

Trait ContractableNetwork 

Source
pub trait ContractableNetwork {
    // Required methods
    fn contract_tensors(
        &mut self,
        tensor_id1: usize,
        tensor_id2: usize,
    ) -> QuantRS2Result<usize>;
    fn optimize_contraction_order(&mut self) -> QuantRS2Result<()>;
}
Expand description

Trait for a network of tensors that can be contracted

Required Methods§

Source

fn contract_tensors( &mut self, tensor_id1: usize, tensor_id2: usize, ) -> QuantRS2Result<usize>

Contract two tensors in the network, returning the ID of the resulting tensor

Source

fn optimize_contraction_order(&mut self) -> QuantRS2Result<()>

Optimize the contraction order of the network

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§