pub struct QuditTensor {
pub indices: Vec<TensorIndex>,
pub expression: ExpressionId,
pub param_info: ParamInfo,
}Fields§
§indices: Vec<TensorIndex>§expression: ExpressionId§param_info: ParamInfoImplementations§
Source§impl QuditTensor
impl QuditTensor
Sourcepub fn new(
indices: Vec<TensorIndex>,
expression: ExpressionId,
param_info: ParamInfo,
) -> Self
pub fn new( indices: Vec<TensorIndex>, expression: ExpressionId, param_info: ParamInfo, ) -> Self
Construct a new tensor object from a tensor expression and param indices.
pub fn num_indices(&self) -> usize
pub fn shape(&self) -> GenerationShape
Sourcepub fn batch_indices(&self) -> Vec<usize>
pub fn batch_indices(&self) -> Vec<usize>
Returns a vector of index IDs for all batch legs of the tensor.
Sourcepub fn output_indices(&self) -> Vec<usize>
pub fn output_indices(&self) -> Vec<usize>
Returns a vector of index IDs for all output legs of the tensor.
Sourcepub fn input_indices(&self) -> Vec<usize>
pub fn input_indices(&self) -> Vec<usize>
Returns a vector of index IDs for all input legs of the tensor.
Sourcepub fn batch_sizes(&self) -> Vec<usize>
pub fn batch_sizes(&self) -> Vec<usize>
Returns a vector of sizes for all batch legs of the tensor.
Sourcepub fn output_sizes(&self) -> Vec<usize>
pub fn output_sizes(&self) -> Vec<usize>
Returns a vector of sizes for all output legs of the tensor.
Sourcepub fn input_sizes(&self) -> Vec<usize>
pub fn input_sizes(&self) -> Vec<usize>
Returns a vector of sizes for all input legs of the tensor.
Trait Implementations§
Source§impl Clone for QuditTensor
impl Clone for QuditTensor
Source§fn clone(&self) -> QuditTensor
fn clone(&self) -> QuditTensor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QuditTensor
impl RefUnwindSafe for QuditTensor
impl Send for QuditTensor
impl Sync for QuditTensor
impl Unpin for QuditTensor
impl UnwindSafe for QuditTensor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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