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

Safe HaskellSafe-Infered

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)] 

Instances

Fractional QNF 
(Eq k, Fractional k) => Fractional (LaurentPoly k) 
Num k => Monad (Vect k) 
Functor (Vect k) 
HasInverses (GroupAlgebra Q)

Note that the inverse of a group algebra element can only be efficiently calculated if the group generated by the non-zero terms is very small (eg <100 elements).

HopfAlgebra (LaurentPoly Q) (SL2q String) 
Bialgebra (LaurentPoly Q) (SL2q String) 
Bialgebra (LaurentPoly Q) (M2q String) 
Coalgebra (LaurentPoly Q) (SL2q String) 
Coalgebra (LaurentPoly Q) (M2q String) 
Algebra (LaurentPoly Q) (SL2q String) 
Algebra (LaurentPoly Q) (M2q String) 
Algebra (LaurentPoly Q) (Aq02 String) 
Algebra (LaurentPoly Q) (Aq20 String) 
Comodule (LaurentPoly Q) (M2q String) (Aq20 String) 
(Eq k, Eq b) => Eq (Vect k b) 
(Eq k, Fractional k, Monomial m, Ord m, Algebra k m) => Fractional (Vect k m)

As a convenience, a partial instance of Fractional is defined for polynomials. The instance is well-defined only for scalars, and gives an error if used on other values. The purpose of this is to allow entry of fractional scalars, in expressions such as x/2. On the other hand, an expression such as 2/x will return an error.

(Eq k, Fractional k, Ord a, Show a, HasConjugation k a) => Fractional (Vect k a)

If an algebra has a conjugation operation, then it has multiplicative inverses, via 1x = conj x sqnorm x

(Eq k, Num k, Eq b, Ord b, Show b, Algebra k b) => Num (Vect k b) 
(Ord k, Ord b) => Ord (Vect k b) 
(Show k, Eq k, Num k, Show b) => Show (Vect k b) 
(Eq k, Fractional k, Ord a, Show a) => HasInverses (Vect k (Interval a)) 

terms :: Vect t t1 -> [(t1, t)]Source

coeff :: (Eq a1, Num a) => a1 -> Vect a a1 -> aSource

Return the coefficient of the specified basis element in a vector

removeTerm :: (Eq k, Num k, Ord a) => a -> Vect k a -> Vect k aSource

Remove the term for a specified basis element from a vector

zerov :: Vect k bSource

The zero vector

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

Addition of vectors

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

Addition of vectors (same as add)

addmerge :: (Eq a, Num a, Ord t) => [(t, a)] -> [(t, a)] -> [(t, a)]Source

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

Sum of a list of vectors

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

negatev :: (Eq k, Num k) => Vect k b -> Vect k bSource

Negation of a vector

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

Subtraction of vectors

smultL :: (Eq k, Num k) => k -> Vect k b -> Vect k bSource

Scalar multiplication (on the left)

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

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

smultR :: (Eq k, Num k) => Vect k b -> k -> Vect k bSource

Scalar multiplication on the right

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

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

nf :: (Ord b, Eq k, 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, Eq k, Num k) => (a -> Vect k b) -> Vect k a -> Vect k bSource

A linear map between vector spaces A and B can be defined by giving its action on the basis elements of A. The action on all elements of A then follows by linearity.

If we have A = Vect k a, B = Vect k b, and f :: a -> Vect k b is a function from the basis elements of A into B, then linear f is the linear map that this defines by linearity.

newtype EBasis Source

Constructors

E Int 

Instances

e :: Monad m => Int -> m EBasisSource

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 :: (Eq k, 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

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

e' :: Monad m => Int -> m (Dual EBasis)Source

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

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

zerof :: t -> Vect k bSource

sumf :: (Eq k, Num k, Ord b) => [t -> Vect k b] -> t -> Vect k bSource