learn-physics-0.6.2: Haskell code for learning physics

Copyright(c) Scott N. Walck 2016-2018
LicenseBSD3 (see LICENSE)
MaintainerScott N. Walck <walck@lvc.edu>
Stabilityexperimental
Safe HaskellTrustworthy
LanguageHaskell98

Physics.Learn.QuantumMat

Contents

Description

This module contains state vectors and matrices for quantum mechanics.

Synopsis

Complex numbers

type C = Complex Double #

State Vectors

xp :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the x direction on a spin-1/2 particle when the result of the measurement is hbar/2.

xm :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the x direction on a spin-1/2 particle when the result of the measurement is -hbar/2.

yp :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the y direction on a spin-1/2 particle when the result of the measurement is hbar/2.

ym :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the y direction on a spin-1/2 particle when the result of the measurement is -hbar/2.

zp :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the z direction on a spin-1/2 particle when the result of the measurement is hbar/2.

zm :: Vector C Source #

The state resulting from a measurement of spin angular momentum in the z direction on a spin-1/2 particle when the result of the measurement is -hbar/2.

np :: Double -> Double -> Vector C Source #

The state resulting from a measurement of spin angular momentum in the direction specified by spherical angles theta (polar angle) and phi (azimuthal angle) on a spin-1/2 particle when the result of the measurement is hbar/2.

nm :: Double -> Double -> Vector C Source #

The state resulting from a measurement of spin angular momentum in the direction specified by spherical angles theta (polar angle) and phi (azimuthal angle) on a spin-1/2 particle when the result of the measurement is -hbar/2.

dim :: Vector C -> Int Source #

Dimension of a vector.

scaleV :: C -> Vector C -> Vector C Source #

Scale a complex vector by a complex number.

inner :: Vector C -> Vector C -> C Source #

Complex inner product. First vector gets conjugated.

norm :: Vector C -> Double Source #

Length of a complex vector.

normalize :: Vector C -> Vector C Source #

Return a normalized version of a given state vector.

probVector Source #

Arguments

:: Vector C

state vector

-> Vector Double

vector of probabilities

Return a vector of probabilities for a given state vector.

gramSchmidt :: [Vector C] -> [Vector C] Source #

Form an orthonormal list of complex vectors from a linearly independent list of complex vectors.

conjV :: Vector C -> Vector C Source #

Conjugate the entries of a vector.

fromList :: [C] -> Vector C Source #

Construct a vector from a list of complex numbers.

toList :: Vector C -> [C] Source #

Produce a list of complex numbers from a vector.

Matrices (operators)

sx :: Matrix C Source #

The Pauli X matrix.

sy :: Matrix C Source #

The Pauli Y matrix.

sz :: Matrix C Source #

The Pauli Z matrix.

scaleM :: C -> Matrix C -> Matrix C Source #

Scale a complex matrix by a complex number.

(<>) :: Matrix C -> Matrix C -> Matrix C Source #

Matrix product.

(#>) :: Matrix C -> Vector C -> Vector C Source #

Matrix-vector product.

(<#) :: Vector C -> Matrix C -> Vector C Source #

Vector-matrix product

conjugateTranspose :: Matrix C -> Matrix C Source #

Conjugate transpose of a matrix.

fromLists :: [[C]] -> Matrix C Source #

Construct a matrix from a list of lists of complex numbers.

toLists :: Matrix C -> [[C]] Source #

Produce a list of lists of complex numbers from a matrix.

size :: Matrix C -> (Int, Int) Source #

Size of a matrix.

matrixFunction :: (C -> C) -> Matrix C -> Matrix C Source #

Apply a function to a matrix. Assumes the matrix is a normal matrix (a matrix with an orthonormal basis of eigenvectors).

Density matrices

couter :: Vector C -> Vector C -> Matrix C Source #

Complex outer product

dm :: Vector C -> Matrix C Source #

Build a pure-state density matrix from a state vector.

trace :: Matrix C -> C Source #

Trace of a matrix.

normalizeDM :: Matrix C -> Matrix C Source #

Normalize a density matrix so that it has trace one.

oneQubitMixed :: Matrix C Source #

The one-qubit totally mixed state.

Quantum Dynamics

timeEvMat :: Double -> Matrix C -> Matrix C Source #

Given a time step and a Hamiltonian matrix, produce a unitary time evolution matrix. Unless you really need the time evolution matrix, it is better to use timeEv, which gives the same numerical results without doing an explicit matrix inversion. The function assumes hbar = 1.

timeEv :: Double -> Matrix C -> Vector C -> Vector C Source #

Given a time step and a Hamiltonian matrix, advance the state vector using the Schrodinger equation. This method should be faster than using timeEvMat since it solves a linear system rather than calculating an inverse matrix. The function assumes hbar = 1.

timeEvMatSpec :: Matrix C -> Double -> Matrix C Source #

Given a Hamiltonian matrix, return a function from time to evolution matrix. Uses spectral decomposition. Assumes hbar = 1.

Composition

class Kronecker a where Source #

Minimal complete definition

kron

Methods

kron :: a -> a -> a Source #

Instances

Product t => Kronecker (Matrix t) Source # 

Methods

kron :: Matrix t -> Matrix t -> Matrix t Source #

Product t => Kronecker (Vector t) Source # 

Methods

kron :: Vector t -> Vector t -> Vector t Source #

Measurement

possibleOutcomes :: Matrix C -> [Double] Source #

The possible outcomes of a measurement of an observable. These are the eigenvalues of the matrix of the observable.

outcomesProjectors :: Matrix C -> [(Double, Matrix C)] Source #

Given an obervable, return a list of pairs of possible outcomes and projectors for each outcome.

outcomesProbabilities :: Matrix C -> Vector C -> [(Double, Double)] Source #

Given an observable and a state vector, return a list of pairs of possible outcomes and probabilites for each outcome.

Vector and Matrix

data Vector a :: * -> * #

Storable-based vectors

Instances

LSDiv Vector 

Methods

linSolve :: Field t => Matrix t -> Vector t -> Vector t

Normed Vector Double 

Methods

pnorm :: NormType -> Vector Double -> RealOf Double

Normed Vector Float 

Methods

pnorm :: NormType -> Vector Float -> RealOf Float

Container Vector Double 

Methods

conj' :: Vector Double -> Vector Double

size' :: Vector Double -> IndexOf Vector

scalar' :: Double -> Vector Double

scale' :: Double -> Vector Double -> Vector Double

addConstant :: Double -> Vector Double -> Vector Double

add' :: Vector Double -> Vector Double -> Vector Double

sub :: Vector Double -> Vector Double -> Vector Double

mul :: Vector Double -> Vector Double -> Vector Double

equal :: Vector Double -> Vector Double -> Bool

cmap' :: Element b => (Double -> b) -> Vector Double -> Vector b

konst' :: Double -> IndexOf Vector -> Vector Double

build' :: IndexOf Vector -> ArgOf Vector Double -> Vector Double

atIndex' :: Vector Double -> IndexOf Vector -> Double

minIndex' :: Vector Double -> IndexOf Vector

maxIndex' :: Vector Double -> IndexOf Vector

minElement' :: Vector Double -> Double

maxElement' :: Vector Double -> Double

sumElements' :: Vector Double -> Double

prodElements' :: Vector Double -> Double

step' :: Vector Double -> Vector Double

ccompare' :: Vector Double -> Vector Double -> Vector I

cselect' :: Vector I -> Vector Double -> Vector Double -> Vector Double -> Vector Double

find' :: (Double -> Bool) -> Vector Double -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Double -> [(IndexOf Vector, Double)] -> Vector Double

accum' :: Vector Double -> (Double -> Double -> Double) -> [(IndexOf Vector, Double)] -> Vector Double

scaleRecip :: Double -> Vector Double -> Vector Double

divide :: Vector Double -> Vector Double -> Vector Double

arctan2' :: Vector Double -> Vector Double -> Vector Double

cmod' :: Double -> Vector Double -> Vector Double

fromInt' :: Vector I -> Vector Double

toInt' :: Vector Double -> Vector I

fromZ' :: Vector Z -> Vector Double

toZ' :: Vector Double -> Vector Z

Container Vector Float 

Methods

conj' :: Vector Float -> Vector Float

size' :: Vector Float -> IndexOf Vector

scalar' :: Float -> Vector Float

scale' :: Float -> Vector Float -> Vector Float

addConstant :: Float -> Vector Float -> Vector Float

add' :: Vector Float -> Vector Float -> Vector Float

sub :: Vector Float -> Vector Float -> Vector Float

mul :: Vector Float -> Vector Float -> Vector Float

equal :: Vector Float -> Vector Float -> Bool

cmap' :: Element b => (Float -> b) -> Vector Float -> Vector b

konst' :: Float -> IndexOf Vector -> Vector Float

build' :: IndexOf Vector -> ArgOf Vector Float -> Vector Float

atIndex' :: Vector Float -> IndexOf Vector -> Float

minIndex' :: Vector Float -> IndexOf Vector

maxIndex' :: Vector Float -> IndexOf Vector

minElement' :: Vector Float -> Float

maxElement' :: Vector Float -> Float

sumElements' :: Vector Float -> Float

prodElements' :: Vector Float -> Float

step' :: Vector Float -> Vector Float

ccompare' :: Vector Float -> Vector Float -> Vector I

cselect' :: Vector I -> Vector Float -> Vector Float -> Vector Float -> Vector Float

find' :: (Float -> Bool) -> Vector Float -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Float -> [(IndexOf Vector, Float)] -> Vector Float

accum' :: Vector Float -> (Float -> Float -> Float) -> [(IndexOf Vector, Float)] -> Vector Float

scaleRecip :: Float -> Vector Float -> Vector Float

divide :: Vector Float -> Vector Float -> Vector Float

arctan2' :: Vector Float -> Vector Float -> Vector Float

cmod' :: Float -> Vector Float -> Vector Float

fromInt' :: Vector I -> Vector Float

toInt' :: Vector Float -> Vector I

fromZ' :: Vector Z -> Vector Float

toZ' :: Vector Float -> Vector Z

Container Vector I 
Container Vector Z 
Container Vector t => Linear t Vector 

Methods

scale :: t -> Vector t -> Vector t #

Storable a => Vector Vector a 

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) a -> m (Vector a) #

basicUnsafeThaw :: PrimMonad m => Vector a -> m (Mutable Vector (PrimState m) a) #

basicLength :: Vector a -> Int #

basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a #

basicUnsafeIndexM :: Monad m => Vector a -> Int -> m a #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) a -> Vector a -> m () #

elemseq :: Vector a -> a -> b -> b #

Mul Matrix Vector Vector 

Methods

(<>) :: Product t => Matrix t -> Vector t -> Vector t

Mul Vector Matrix Vector 

Methods

(<>) :: Product t => Vector t -> Matrix t -> Vector t

Container Vector e => Konst e Int Vector 

Methods

konst :: e -> Int -> Vector e #

Normed Vector (Complex Double) 

Methods

pnorm :: NormType -> Vector (Complex Double) -> RealOf (Complex Double)

Normed Vector (Complex Float) 

Methods

pnorm :: NormType -> Vector (Complex Float) -> RealOf (Complex Float)

Container Vector (Complex Double) 

Methods

conj' :: Vector (Complex Double) -> Vector (Complex Double)

size' :: Vector (Complex Double) -> IndexOf Vector

scalar' :: Complex Double -> Vector (Complex Double)

scale' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

addConstant :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

add' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

sub :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

mul :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

equal :: Vector (Complex Double) -> Vector (Complex Double) -> Bool

cmap' :: Element b => (Complex Double -> b) -> Vector (Complex Double) -> Vector b

konst' :: Complex Double -> IndexOf Vector -> Vector (Complex Double)

build' :: IndexOf Vector -> ArgOf Vector (Complex Double) -> Vector (Complex Double)

atIndex' :: Vector (Complex Double) -> IndexOf Vector -> Complex Double

minIndex' :: Vector (Complex Double) -> IndexOf Vector

maxIndex' :: Vector (Complex Double) -> IndexOf Vector

minElement' :: Vector (Complex Double) -> Complex Double

maxElement' :: Vector (Complex Double) -> Complex Double

sumElements' :: Vector (Complex Double) -> Complex Double

prodElements' :: Vector (Complex Double) -> Complex Double

step' :: Vector (Complex Double) -> Vector (Complex Double)

ccompare' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector I

cselect' :: Vector I -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

find' :: (Complex Double -> Bool) -> Vector (Complex Double) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Double -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

accum' :: Vector (Complex Double) -> (Complex Double -> Complex Double -> Complex Double) -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

scaleRecip :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

divide :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

arctan2' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

cmod' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

fromInt' :: Vector I -> Vector (Complex Double)

toInt' :: Vector (Complex Double) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Double)

toZ' :: Vector (Complex Double) -> Vector Z

Container Vector (Complex Float) 

Methods

conj' :: Vector (Complex Float) -> Vector (Complex Float)

size' :: Vector (Complex Float) -> IndexOf Vector

scalar' :: Complex Float -> Vector (Complex Float)

scale' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

addConstant :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

add' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

sub :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

mul :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

equal :: Vector (Complex Float) -> Vector (Complex Float) -> Bool

cmap' :: Element b => (Complex Float -> b) -> Vector (Complex Float) -> Vector b

konst' :: Complex Float -> IndexOf Vector -> Vector (Complex Float)

build' :: IndexOf Vector -> ArgOf Vector (Complex Float) -> Vector (Complex Float)

atIndex' :: Vector (Complex Float) -> IndexOf Vector -> Complex Float

minIndex' :: Vector (Complex Float) -> IndexOf Vector

maxIndex' :: Vector (Complex Float) -> IndexOf Vector

minElement' :: Vector (Complex Float) -> Complex Float

maxElement' :: Vector (Complex Float) -> Complex Float

sumElements' :: Vector (Complex Float) -> Complex Float

prodElements' :: Vector (Complex Float) -> Complex Float

step' :: Vector (Complex Float) -> Vector (Complex Float)

ccompare' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector I

cselect' :: Vector I -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

find' :: (Complex Float -> Bool) -> Vector (Complex Float) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Float -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

accum' :: Vector (Complex Float) -> (Complex Float -> Complex Float -> Complex Float) -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

scaleRecip :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

divide :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

arctan2' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

cmod' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

fromInt' :: Vector I -> Vector (Complex Float)

toInt' :: Vector (Complex Float) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Float)

toZ' :: Vector (Complex Float) -> Vector Z

Representable Bra (Vector C) Source # 
Representable Ket (Vector C) Source # 
Container Vector e => Build Int (e -> e) Vector e 

Methods

build :: Int -> (e -> e) -> Vector e #

Storable a => IsList (Vector a) 

Associated Types

type Item (Vector a) :: * #

Methods

fromList :: [Item (Vector a)] -> Vector a #

fromListN :: Int -> [Item (Vector a)] -> Vector a #

toList :: Vector a -> [Item (Vector a)] #

(Storable a, Eq a) => Eq (Vector a) 

Methods

(==) :: Vector a -> Vector a -> Bool #

(/=) :: Vector a -> Vector a -> Bool #

(Data a, Storable a) => Data (Vector a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) #

toConstr :: Vector a -> Constr #

dataTypeOf :: Vector a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) #

gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

(Storable a, Ord a) => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Read a, Storable a) => Read (Vector a) 
(Show a, Storable a) => Show (Vector a) 

Methods

showsPrec :: Int -> Vector a -> ShowS #

show :: Vector a -> String #

showList :: [Vector a] -> ShowS #

Storable a => Semigroup (Vector a) 

Methods

(<>) :: Vector a -> Vector a -> Vector a #

sconcat :: NonEmpty (Vector a) -> Vector a #

stimes :: Integral b => b -> Vector a -> Vector a #

Storable a => Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

NFData (Vector a) 

Methods

rnf :: Vector a -> () #

Normed (Vector Float) 
Normed (Vector (Complex Float)) 
Normed (Vector I) 

Methods

norm_0 :: Vector I -> R #

norm_1 :: Vector I -> R #

norm_2 :: Vector I -> R #

norm_Inf :: Vector I -> R #

Normed (Vector Z) 

Methods

norm_0 :: Vector Z -> R #

norm_1 :: Vector Z -> R #

norm_2 :: Vector Z -> R #

norm_Inf :: Vector Z -> R #

Normed (Vector R) 

Methods

norm_0 :: Vector R -> R #

norm_1 :: Vector R -> R #

norm_2 :: Vector R -> R #

norm_Inf :: Vector R -> R #

Normed (Vector C) 

Methods

norm_0 :: Vector C -> R #

norm_1 :: Vector C -> R #

norm_2 :: Vector C -> R #

norm_Inf :: Vector C -> R #

Container Vector t => Additive (Vector t) 

Methods

add :: Vector t -> Vector t -> Vector t #

Product t => Kronecker (Vector t) Source # 

Methods

kron :: Vector t -> Vector t -> Vector t Source #

Indexable (Vector Double) Double 

Methods

(!) :: Vector Double -> Int -> Double #

Indexable (Vector Float) Float 

Methods

(!) :: Vector Float -> Int -> Float #

Indexable (Vector I) I 

Methods

(!) :: Vector I -> Int -> I #

Indexable (Vector Z) Z 

Methods

(!) :: Vector Z -> Int -> Z #

Element t => Indexable (Matrix t) (Vector t) 

Methods

(!) :: Matrix t -> Int -> Vector t #

Indexable (Vector (Complex Double)) (Complex Double) 
Indexable (Vector (Complex Float)) (Complex Float) 

Methods

(!) :: Vector (Complex Float) -> Int -> Complex Float #

type IndexOf Vector 
type Mutable Vector 
type ArgOf Vector a 
type ArgOf Vector a = a -> a
type Item (Vector a) 
type Item (Vector a) = a
type ElementOf (Vector a) 
type ElementOf (Vector a) = a

data Matrix t :: * -> * #

Matrix representation suitable for BLAS/LAPACK computations.

Instances

LSDiv Matrix 

Methods

linSolve :: Field t => Matrix t -> Matrix t -> Matrix t

Normed Matrix Double 

Methods

pnorm :: NormType -> Matrix Double -> RealOf Double

Normed Matrix Float 

Methods

pnorm :: NormType -> Matrix Float -> RealOf Float

(Num a, Element a, Container Vector a) => Container Matrix a 

Methods

conj' :: Matrix a -> Matrix a

size' :: Matrix a -> IndexOf Matrix

scalar' :: a -> Matrix a

scale' :: a -> Matrix a -> Matrix a

addConstant :: a -> Matrix a -> Matrix a

add' :: Matrix a -> Matrix a -> Matrix a

sub :: Matrix a -> Matrix a -> Matrix a

mul :: Matrix a -> Matrix a -> Matrix a

equal :: Matrix a -> Matrix a -> Bool

cmap' :: Element b => (a -> b) -> Matrix a -> Matrix b

konst' :: a -> IndexOf Matrix -> Matrix a

build' :: IndexOf Matrix -> ArgOf Matrix a -> Matrix a

atIndex' :: Matrix a -> IndexOf Matrix -> a

minIndex' :: Matrix a -> IndexOf Matrix

maxIndex' :: Matrix a -> IndexOf Matrix

minElement' :: Matrix a -> a

maxElement' :: Matrix a -> a

sumElements' :: Matrix a -> a

prodElements' :: Matrix a -> a

step' :: Matrix a -> Matrix a

ccompare' :: Matrix a -> Matrix a -> Matrix I

cselect' :: Matrix I -> Matrix a -> Matrix a -> Matrix a -> Matrix a

find' :: (a -> Bool) -> Matrix a -> [IndexOf Matrix]

assoc' :: IndexOf Matrix -> a -> [(IndexOf Matrix, a)] -> Matrix a

accum' :: Matrix a -> (a -> a -> a) -> [(IndexOf Matrix, a)] -> Matrix a

scaleRecip :: a -> Matrix a -> Matrix a

divide :: Matrix a -> Matrix a -> Matrix a

arctan2' :: Matrix a -> Matrix a -> Matrix a

cmod' :: a -> Matrix a -> Matrix a

fromInt' :: Matrix I -> Matrix a

toInt' :: Matrix a -> Matrix I

fromZ' :: Matrix Z -> Matrix a

toZ' :: Matrix a -> Matrix Z

Container Matrix t => Linear t Matrix 

Methods

scale :: t -> Matrix t -> Matrix t #

Mul Matrix Matrix Matrix 

Methods

(<>) :: Product t => Matrix t -> Matrix t -> Matrix t

Mul Matrix Vector Vector 

Methods

(<>) :: Product t => Matrix t -> Vector t -> Vector t

Mul Vector Matrix Vector 

Methods

(<>) :: Product t => Vector t -> Matrix t -> Vector t

Normed Matrix (Complex Double) 

Methods

pnorm :: NormType -> Matrix (Complex Double) -> RealOf (Complex Double)

Normed Matrix (Complex Float) 

Methods

pnorm :: NormType -> Matrix (Complex Float) -> RealOf (Complex Float)

Representable Operator (Matrix C) Source # 
(Num e, Container Vector e) => Konst e (Int, Int) Matrix 

Methods

konst :: e -> (Int, Int) -> Matrix e #

(Storable t, NFData t) => NFData (Matrix t) 

Methods

rnf :: Matrix t -> () #

Normed (Matrix R) 

Methods

norm_0 :: Matrix R -> R #

norm_1 :: Matrix R -> R #

norm_2 :: Matrix R -> R #

norm_Inf :: Matrix R -> R #

Normed (Matrix C) 

Methods

norm_0 :: Matrix C -> R #

norm_1 :: Matrix C -> R #

norm_2 :: Matrix C -> R #

norm_Inf :: Matrix C -> R #

Container Matrix t => Additive (Matrix t) 

Methods

add :: Matrix t -> Matrix t -> Matrix t #

Storable t => TransArray (Matrix t) 

Associated Types

type Trans (Matrix t) b :: * #

type TransRaw (Matrix t) b :: * #

Methods

apply :: Matrix t -> (b -> IO r) -> Trans (Matrix t) b -> IO r #

applyRaw :: Matrix t -> (b -> IO r) -> TransRaw (Matrix t) b -> IO r #

Product t => Kronecker (Matrix t) Source # 

Methods

kron :: Matrix t -> Matrix t -> Matrix t Source #

Element t => Indexable (Matrix t) (Vector t) 

Methods

(!) :: Matrix t -> Int -> Vector t #

(CTrans t, Container Vector t) => Transposable (Matrix t) (Matrix t) 

Methods

tr :: Matrix t -> Matrix t #

tr' :: Matrix t -> Matrix t #

Container Matrix e => Build (Int, Int) (e -> e -> e) Matrix e 

Methods

build :: (Int, Int) -> (e -> e -> e) -> Matrix e #

type IndexOf Matrix 
type IndexOf Matrix = (Int, Int)
type ArgOf Matrix a 
type ArgOf Matrix a = a -> a -> a
type ElementOf (Matrix a) 
type ElementOf (Matrix a) = a
type TransRaw (Matrix t) b 
type TransRaw (Matrix t) b = CInt -> CInt -> Ptr t -> b
type Trans (Matrix t) b 
type Trans (Matrix t) b = CInt -> CInt -> CInt -> CInt -> Ptr t -> b