jonathanfishbein1/elm-quantum/6.1.0

NOTE: the latest version is 6.1.1

Ket

Ket Module

Types

type Ket a
= Ket (ColumnVector a)

Ket Type

type alias VectorSpace a =
{ abelianGroup : AbelianGroup (Ket a)
, vectorScalarMultiplication : a -> Ket a -> Ket a
, field : Field a
}

Type to represent a Vector Space

type alias InnerProductSpace a =
{ vectorSpace : VectorSpace a
, innerProduct : Ket a -> Ket a -> a
, length : Ket a -> Real Float
, distance : Ket a -> Ket a -> Real Float
}

Type to represent an Inner Product Space

Values

ket0 : Ket (Real Float)

Ket representing zero state

ket1 : Ket (Real Float)

Ket representing one state

ketPlus : Ket (Real Float)

Ket representing + state

ketMinus : Ket (Real Float)

Ket representing + state

ketComplex0 : Ket (ComplexNumber Float)

Ket representing zero state with complex numbers

ketComplex1 : Ket (ComplexNumber Float)

Ket representing one state with complex numbers

ketComplexPlus : Ket (ComplexNumber Float)

Ket representing + state with complex numbers

ketComplexMinus : Ket (ComplexNumber Float)

Ket representing + state with complex numbers

Empty ket

Unitary Operations

scalarMultiplication : Field a -> a -> Ket a -> Ket a

Multiply a Ket by a Scalar

dimension : Ket a -> Int

Count of number of elements in a Ket

sum : Monoid a -> Ket a -> a

Calculate the sum of a Ket

foldl : (a -> b -> b) -> b -> Ket a -> b

Left fold over a Ket

map : (a -> b) -> Ket a -> Ket b

Map over a vector

lengthReal : Ket (Real Float) -> Real Float

Calculate the length of a Real valued Vector

lengthComplex : Ket (ComplexNumber Float) -> Real Float

Calculate the length of a Complex valued Vector

normaliseReal : Ket (Real Float) -> Ket (Real Float)

Adjust a real valued column vector so that its length is exactly one

normaliseComplex : Ket (ComplexNumber Float) -> Ket (ComplexNumber Float)

Adjust a complex valued column vector so that its length is exactly one

conjugate : Ket (ComplexNumber number) -> Ket (ComplexNumber number)

Take the complex conjugate of a Complex Numbered Vector

Binary Operations

add : Field a -> Ket a -> Ket a -> Ket a

Add two Kets

Equality

equal : (a -> a -> Bool) -> Ket a -> Ket a -> Bool

Compare two vectors for equality using a comparator

Manipulation

getAt : Int -> Ket a -> Maybe a

Get the value in a Ket at the specified index

setAt : Int -> a -> Ket a -> Ket a

Set the value in a Ket at the specified index