pub struct Tensor {
pub data: Vec<Complex64>,
pub shape: (usize, usize),
}
Fields§
§data: Vec<Complex64>
§shape: (usize, usize)
Implementations§
Source§impl Tensor
impl Tensor
pub fn new(data: Vec<Complex64>, shape: (usize, usize)) -> Tensor
pub fn eye(n: usize) -> Tensor
pub fn item(&self) -> Option<Complex64>
pub fn norm_sqr(&self) -> f64
pub fn norm(&self) -> f64
pub fn unit(&self) -> Tensor
pub fn dag(&self) -> Tensor
pub fn proj(&self) -> Tensor
pub fn prod(&self, rhs: &Tensor) -> Tensor
pub fn expand(&self, n: usize, i: usize) -> Tensor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnwindSafe for Tensor
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