# Data.Matrix.Algebraic

Matrix operations with vector space dimensionalities enforced
at the type level. Uses operations from interfaces in `Control.Algebra`
and `Control.Algebra.VectorSpace`.

diag_ : Monoid a => Vect n a -> Matrix n n a

  Square matrix from diagonal elements

det2 : Ring a => Matrix (fromInteger 2) (fromInteger 2) a -> a

  Determinant of a 2-by-2 matrix

det : Ring a => Matrix (S (S n)) (S (S n)) a -> a

  Determinant of a square matrix

blockDiag : Monoid a => Matrix n n a -> Matrix m m a -> Matrix (n + m) (n + m) a

  Combine two matrices to make a new matrix in block diagonal form

basis : RingWithUnity a => Fin d -> Vect d a

  Standard basis vector with one nonzero entry, ring data type and vector-length unfixed

altSum : Group a => Vect n a -> a

  Alternating sum

(\&\) : Ring a => Vect n a -> Vect m a -> Vect (n * m) a

  Tensor multiply (⊗) ring vectors

  Fixity
    Left associative, precedence 7
Id : RingWithUnity a => Matrix d d a

  Identity matrix

(>><<) : Ring a => Matrix n n a -> Matrix n n a -> Matrix n n a

  Matrix anti-commutator

  Fixity
    Left associative, precedence 2
(><) : Ring a => Vect n a -> Vect m a -> Matrix n m a

  Outer product between ring vectors

  Fixity
    Left associative, precedence 2
(<\>) : Ring a => Vect n a -> Matrix n m a -> Vect m a

  Matrix times a row vector

  Fixity
    Left associative, precedence 3
(<>) : Ring a => Matrix n k a -> Matrix k m a -> Matrix n m a

  Matrix multiplication

  Fixity
    Left associative, precedence 5
(<<>>) : Ring a => Matrix n n a -> Matrix n n a -> Matrix n n a

  Matrix commutator

  Fixity
    Left associative, precedence 2
(<:>) : Ring a => Vect n a -> Vect n a -> a

  Inner product of ring vectors

  Fixity
    Left associative, precedence 2
(</>) : Ring a => Matrix n m a -> Vect m a -> Vect n a

  Matrix times a column vector

  Fixity
    Left associative, precedence 3
(<&>) : Ring a => Matrix h1 w1 a -> Matrix h2 w2 a -> Matrix (h1 * h2) (w1 * w2) a

  Tensor multiply (⊗) for ring matrices

  Fixity
    Left associative, precedence 7