[][src]Struct brakets::Ket

pub struct Ket<D: DimName>(_)
where
    DefaultAllocator: Allocator<Complex, D>
;

Generic ket. You can multiply it by bra to an outer product (or operator).

Methods

impl<D: DimName> Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

pub fn up() -> Ket<U2>[src]

Up 2-dimension ket, [1, 0]

pub fn down() -> Ket<U2>[src]

Down 2-dimension ket, [0, 1]

pub fn right() -> Ket<U2>[src]

Right 2-dimension ket, 1/√2[1, 1]

pub fn left() -> Ket<U2>[src]

Left 2-dimension ket, 1/√2[1, -1]

pub fn inw() -> Ket<U2>[src]

Inward 2-dimension ket, 1/√2[1, i]

pub fn out() -> Ket<U2>[src]

Outward 2-dimension ket, 1/√2[1, -i]

pub fn cross(self, other: Ket<D>) -> Ket<DimNameProd<D, D>> where
    D: DimNameMul<D>,
    DefaultAllocator: Allocator<Complex, DimNameProd<D, D>>, 
[src]

Kronecker (tensor) product of two kets

For qubits, it's possible to produce only 2 qubits state with this product.

pub fn from_bits(number: u16) -> Result<Ket<D>, &'static str>[src]

Cross product of basis (|up> & |down>) qubits picked from a bit string.

Trait Implementations

impl<D: DimName> From<Ket<D>> for Bra<D> where
    DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>, 
[src]

impl<D: DimName> From<Bra<D>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>, 
[src]

impl<D: DimName> From<Matrix<Complex<f64>, D, U1, <DefaultAllocator as Allocator<Complex<f64>, D, U1>>::Buffer>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

impl<D: PartialEq + DimName> PartialEq<Ket<D>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

impl<D: Clone + DimName> Clone for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<D: DimName> Display for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>,
    DefaultAllocator: Allocator<usize, D>, 
[src]

impl<D: Debug + DimName> Debug for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

impl<D: DimName> Add<Ket<D>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<D: DimName> Mul<Ket<D>> for Bra<D> where
    DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, U1, D>, 
[src]

type Output = Complex

The resulting type after applying the * operator.

impl<D: DimName> Mul<Bra<D>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>, 
[src]

type Output = Outer<D>

The resulting type after applying the * operator.

impl<D: DimName> Mul<Complex<f64>> for Ket<D> where
    DefaultAllocator: Allocator<Complex, D, U1>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl<D: DimName> Mul<Ket<D>> for Outer<D> where
    DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D>, 
[src]

type Output = Ket<D>

The resulting type after applying the * operator.

Auto Trait Implementations

impl<D> !Unpin for Ket<D>

impl<D> !Send for Ket<D>

impl<D> !Sync for Ket<D>

impl<D> !UnwindSafe for Ket<D>

impl<D> !RefUnwindSafe for Ket<D>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,