HaskellForMaths-0.3.3: Combinatorics, group theory, commutative algebra, non-commutative algebra

Math.Algebras.VectorSpace

Description

A module defining the type and operations of free k-vector spaces over a basis b (for a field k)

Synopsis

Documentation

newtype Vect k b Source

Given a field type k (ie a Fractional instance), Vect k b is the type of the free k-vector space over the basis type b. Elements of Vect k b consist of k-linear combinations of elements of b.

Constructors

V [(b, k)] 

zerov :: Vect k bSource

The zero vector

add :: (Ord b, Num k) => Vect k b -> Vect k b -> Vect k bSource

Addition of vectors

(<+>) :: (Ord b, Num k) => Vect k b -> Vect k b -> Vect k bSource

Addition of vectors (same as add)

sumv :: (Ord b, Num k) => [Vect k b] -> Vect k bSource

Sum of a list of vectors

neg :: Num k => Vect k b -> Vect k bSource

Negation of vector

(<->) :: (Ord b, Num k) => Vect k b -> Vect k b -> Vect k bSource

Subtraction of vectors

smultL :: Num k => k -> Vect k b -> Vect k bSource

Scalar multiplication (on the left)

(*>) :: Num k => k -> Vect k b -> Vect k bSource

Same as smultL. Mnemonic is multiply through (from the left)

smultR :: Num k => Vect k b -> k -> Vect k bSource

Scalar multiplication on the right

(<*) :: Num k => Vect k b -> k -> Vect k bSource

Same as smultR. Mnemonic is multiply through (from the right)

nf :: (Ord b, Num k) => Vect k b -> Vect k bSource

Convert an element of Vect k b into normal form. Normal form consists in having the basis elements in ascending order, with no duplicates, and all coefficients non-zero

linear :: (Ord b, Num k) => (a -> Vect k b) -> Vect k a -> Vect k bSource

newtype EBasis Source

Constructors

E Int 

type Trivial k = Vect k ()Source

Trivial k is the field k considered as a k-vector space. In maths, we would not normally make a distinction here, but in the code, we need this if we want to be able to put k as one side of a tensor product.

wrap :: Num k => k -> Vect k ()Source

unwrap :: Num k => Vect k () -> kSource

newtype Dual b Source

Given a finite vector space basis b, Dual b represents a basis for the dual vector space. (If b is infinite, then Dual b is only a sub-basis.)

Constructors

Dual b 

Instances

Num k => Coalgebra k (Dual HBasis) 
Eq b => Eq (Dual b) 
Ord b => Ord (Dual b) 
Show basis => Show (Dual basis) 

dual :: Vect k b -> Vect k (Dual b)Source