use crate::types::causal_tensor_network::truncation::Truncation;
use crate::{CausalTensor, CausalTensorError};
use deep_causality_algebra::ConjugateScalar;
pub trait TensorTrain<T: ConjugateScalar>: Sized {
fn to_dense(&self) -> Result<CausalTensor<T>, CausalTensorError>;
fn eval(&self, index: &[usize]) -> Result<T, CausalTensorError>;
fn left_canonicalize(&self) -> Result<Self, CausalTensorError>;
fn right_canonicalize(&self) -> Result<Self, CausalTensorError>;
fn canonicalize_at(&self, center: usize) -> Result<Self, CausalTensorError>;
fn round(
&self,
trunc: &Truncation<<T as ConjugateScalar>::Real>,
) -> Result<Self, CausalTensorError>;
fn norm(&self) -> Result<T, CausalTensorError>;
fn inner(&self, other: &Self) -> Result<T, CausalTensorError>;
fn add(&self, other: &Self) -> Result<Self, CausalTensorError>;
fn add_rounded(
&self,
other: &Self,
trunc: &Truncation<<T as ConjugateScalar>::Real>,
) -> Result<Self, CausalTensorError>;
fn add_scalar(&self, c: T) -> Result<Self, CausalTensorError>;
fn hadamard(&self, other: &Self) -> Result<Self, CausalTensorError>;
fn hadamard_rounded(
&self,
other: &Self,
trunc: &Truncation<<T as ConjugateScalar>::Real>,
) -> Result<Self, CausalTensorError>;
fn marginalize(&self, sites: &[usize]) -> Result<Self, CausalTensorError>;
fn integrate(&self, weights: &[CausalTensor<T>]) -> Result<T, CausalTensorError>;
}