#[non_exhaustive]pub struct EinsumOptions {
pub optimize: EinsumOptimize,
pub conj: ConjMask,
}Expand description
Options of einsum on every layer.
§Examples
use tenferro_einsum::{ConjMask, EinsumOptimize, EinsumOptions};
use tenferro_tensor::Conj;
let options = EinsumOptions::default()
.optimize(EinsumOptimize::Path(vec![(1, 2), (0, 1)]))
.conj(ConjMask::new([Conj::Yes]));
assert!(matches!(options.optimize, EinsumOptimize::Path(_)));
assert_eq!(options.conj.get(0), Conj::Yes);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.optimize: EinsumOptimizeContraction order: automatic (default), left to right, or an explicit path, nested grouping or tree. An explicit order is always honoured.
conj: ConjMaskPer-operand conjugation; the default conjugates nothing.
Implementations§
Source§impl EinsumOptions
impl EinsumOptions
Sourcepub fn optimize(self, optimize: EinsumOptimize) -> Self
pub fn optimize(self, optimize: EinsumOptimize) -> Self
Return options with the given contraction order.
§Examples
use tenferro_einsum::{EinsumOptimize, EinsumOptions};
let o = EinsumOptions::default().optimize(EinsumOptimize::False);
assert!(matches!(o.optimize, EinsumOptimize::False));Sourcepub fn conj(self, conj: ConjMask) -> Self
pub fn conj(self, conj: ConjMask) -> Self
Return options with the given per-operand conjugation.
§Examples
use tenferro_einsum::{ConjMask, EinsumOptions};
use tenferro_tensor::Conj;
let o = EinsumOptions::default().conj(ConjMask::new([Conj::No, Conj::Yes]));
assert_eq!(o.conj.get(1), Conj::Yes);Trait Implementations§
Source§impl Clone for EinsumOptions
impl Clone for EinsumOptions
Source§impl Debug for EinsumOptions
impl Debug for EinsumOptions
Auto Trait Implementations§
impl Freeze for EinsumOptions
impl RefUnwindSafe for EinsumOptions
impl Send for EinsumOptions
impl Sync for EinsumOptions
impl Unpin for EinsumOptions
impl UnsafeUnpin for EinsumOptions
impl UnwindSafe for EinsumOptions
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,
impl<T, U> Imply<T> for U
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