Copyright | (c) Scott N. Walck 2016 |
---|---|
License | BSD3 (see LICENSE) |
Maintainer | Scott N. Walck <walck@lvc.edu> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell98 |
This module contains ket vectors, bra vectors, and operators for quantum mechanics.
- data Ket
- data Bra
- data Operator
- class Mult a b c | a b -> c where
- (<>) :: a -> b -> c
- class Dagger a b | a -> b where
- dagger :: a -> b
- class Representable a b | a -> b where
- rep :: OrthonormalBasis -> a -> b
- dim :: a -> Int
- data OrthonormalBasis
- makeOB :: [Ket] -> OrthonormalBasis
- listBasis :: OrthonormalBasis -> [Ket]
- size :: OrthonormalBasis -> Int
- xp :: Ket
- xm :: Ket
- yp :: Ket
- ym :: Ket
- zp :: Ket
- zm :: Ket
- np :: Double -> Double -> Ket
- nm :: Double -> Double -> Ket
- xBasis :: OrthonormalBasis
- yBasis :: OrthonormalBasis
- zBasis :: OrthonormalBasis
- sx :: Operator
- sy :: Operator
- sz :: Operator
- prob :: Ket -> Ket -> Double
- probs :: OrthonormalBasis -> Ket -> [Double]
Documentation
A ket vector describes the state of a quantum system.
A bra vector describes the state of a quantum system.
An operator describes an observable (a Hermitian operator) or an action (a unitary operator).
class Mult a b c | a b -> c where Source
Generic multiplication including inner product, outer product, operator product, and whatever else makes sense. No conjugation takes place in this operation.
class Dagger a b | a -> b where Source
The adjoint operation on complex numbers, kets, bras, and operators.
class Representable a b | a -> b where Source
makeOB :: [Ket] -> OrthonormalBasis Source
Make an orthonormal basis from a list of linearly independent kets.
listBasis :: OrthonormalBasis -> [Ket] Source
size :: OrthonormalBasis -> Int Source
State of a spin-1/2 particle if measurement in the x-direction would give angular momentum +hbar/2.
State of a spin-1/2 particle if measurement in the x-direction would give angular momentum -hbar/2.
State of a spin-1/2 particle if measurement in the y-direction would give angular momentum +hbar/2.
State of a spin-1/2 particle if measurement in the y-direction would give angular momentum -hbar/2.
State of a spin-1/2 particle if measurement in the z-direction would give angular momentum +hbar/2.
State of a spin-1/2 particle if measurement in the z-direction would give angular momentum -hbar/2.
np :: Double -> Double -> Ket Source
State of a spin-1/2 particle if measurement in the n-direction, described by spherical polar angle theta and azimuthal angle phi, would give angular momentum +hbar/2.
nm :: Double -> Double -> Ket Source
State of a spin-1/2 particle if measurement in the n-direction, described by spherical polar angle theta and azimuthal angle phi, would give angular momentum -hbar/2.
probs :: OrthonormalBasis -> Ket -> [Double] Source