[−][src]Struct brakets::Ket
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]
DefaultAllocator: Allocator<Complex, D>,
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]
D: DimNameMul<D>,
DefaultAllocator: Allocator<Complex, DimNameProd<D, D>>,
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]
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>,
impl<D: DimName> From<Bra<D>> for Ket<D> where
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>,
[src]
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>,
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]
DefaultAllocator: Allocator<Complex, D>,
impl<D: PartialEq + DimName> PartialEq<Ket<D>> for Ket<D> where
DefaultAllocator: Allocator<Complex, D>,
[src]
DefaultAllocator: Allocator<Complex, D>,
impl<D: Clone + DimName> Clone for Ket<D> where
DefaultAllocator: Allocator<Complex, D>,
[src]
DefaultAllocator: Allocator<Complex, D>,
fn clone(&self) -> Ket<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]
DefaultAllocator: Allocator<Complex, D>,
DefaultAllocator: Allocator<usize, D>,
impl<D: Debug + DimName> Debug for Ket<D> where
DefaultAllocator: Allocator<Complex, D>,
[src]
DefaultAllocator: Allocator<Complex, D>,
impl<D: DimName> Add<Ket<D>> for Ket<D> where
DefaultAllocator: Allocator<Complex, D>,
[src]
DefaultAllocator: Allocator<Complex, D>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Ket<D>) -> Self::Output
[src]
impl<D: DimName> Mul<Ket<D>> for Bra<D> where
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, U1, D>,
[src]
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, U1, D>,
type Output = Complex
The resulting type after applying the *
operator.
fn mul(self, other: Ket<D>) -> Self::Output
[src]
impl<D: DimName> Mul<Bra<D>> for Ket<D> where
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>,
[src]
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D> + Allocator<Complex, U1, D>,
type Output = Outer<D>
The resulting type after applying the *
operator.
fn mul(self, other: Bra<D>) -> Self::Output
[src]
impl<D: DimName> Mul<Complex<f64>> for Ket<D> where
DefaultAllocator: Allocator<Complex, D, U1>,
[src]
DefaultAllocator: Allocator<Complex, D, U1>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Complex) -> Self::Output
[src]
impl<D: DimName> Mul<Ket<D>> for Outer<D> where
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D>,
[src]
DefaultAllocator: Allocator<Complex, D> + Allocator<Complex, D, D>,
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]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,