pub struct Tensor<'a> { /* private fields */ }Expand description
A tensor: a named object with a list of index slots, an arity, and a slot symmetry.
Implementations§
Source§impl<'a> Tensor<'a>
impl<'a> Tensor<'a>
Sourcepub fn new(name: Symbol, slots: Vec<IndexSlot<'a>>) -> Self
pub fn new(name: Symbol, slots: Vec<IndexSlot<'a>>) -> Self
Create a new tensor with the given slots and no symmetry.
Sourcepub fn with_symmetry(self, symmetry: Symmetry) -> Self
pub fn with_symmetry(self, symmetry: Symmetry) -> Self
Builder: set the slot symmetry.
Sourcepub fn dummy_labels(&self) -> Vec<Atom<'a>>
pub fn dummy_labels(&self) -> Vec<Atom<'a>>
Return the dummy indices (labels occurring exactly twice across all slots, once upper and once lower) — these are the ones that will be contracted in a product.
Trait Implementations§
impl<'a> Eq for Tensor<'a>
impl<'a> StructuralPartialEq for Tensor<'a>
Auto Trait Implementations§
impl<'a> Freeze for Tensor<'a>
impl<'a> RefUnwindSafe for Tensor<'a>
impl<'a> Send for Tensor<'a>
impl<'a> Sync for Tensor<'a>
impl<'a> Unpin for Tensor<'a>
impl<'a> UnsafeUnpin for Tensor<'a>
impl<'a> UnwindSafe for Tensor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more