knots-0.1.0.1: Khovanov homology computations

Safe HaskellNone
LanguageHaskell98

Knots.Free

Synopsis

Documentation

type Basis b = Ord b Source

newtype Free b r Source

Free vector space with basis b and coefficient ring r.

Constructors

F 

Fields

unF :: Map b r
 

Instances

Functor (Free b) 
Foldable (Free b) 
(Eq b, Eq r) => Eq (Free b r) 
(Ord b, Read b, Read r) => Read (Free b r) 
(Show b, Show r) => Show (Free b r) 
Basis b => Default (Free b r) 
(NFData b, NFData r) => NFData (Free b r) 
(AbelianGroup r, Basis b) => AbelianGroup (Free b r)

Point-wise addition

(Basis b, Monoid b, Ring r, Eq r) => Ring (Free b r)

A sort of Kronecker (tensor) product

liftF :: (Map b r -> Map b' r') -> Free b r -> Free b' r' Source

(.#) :: r -> b -> Free b r Source

Monomial.

mapBasis :: (Basis b, Basis c) => (b -> c) -> Free b r -> Free c r Source

data Lin b c r Source

Encoding of a linear map from `Free b r' to `Free c r'. The choice of encoding is limited to such linear maps f where `f(x)' vanishes for all but finitely many basis elements x in b.

Speaking matrix-wise, the intended interpretation is column-major format; use dual to convert from row-major format.

Constructors

Lin 

Fields

dom :: Set b
 
cod :: Set c
 
matrix :: Free b (Free c r)
 

Instances

Functor (Lin b c) 
Foldable (Lin b c) 
(Eq b, Eq c, Eq r) => Eq (Lin b c r) 
(Ord b, Ord c, Read b, Read c, Read r) => Read (Lin b c r) 
(Show b, Show c, Show r) => Show (Lin b c r) 
(NFData b, NFData c, NFData r) => NFData (Lin b c r) 
(Basis b, Basis c, AbelianGroup r) => AbelianGroup (Lin b c r) 
(Ring r, Eq r, Monoid b, Basis b) => Ring (Lin b b r)

(Partial) ring instance for certain endomorphisms, implementing tensor product.

BEWARE: This is the tensor product; it is *not* composition of morphisms.

columns :: Lin i j a -> Map i (Map j a) Source

onMatrix :: (Free b (Free c r) -> Free b (Free c r)) -> Lin b c r -> Lin b c r Source

plus :: (Basis b, AbEq r) => [(b, r)] -> Free b r Source

coeff :: (Basis b, AbelianGroup r) => Free b r -> b -> r Source

monomials :: Free b r -> [(b, r)] Source

lin :: (Basis b, Basis c, AbelianGroup r, Eq r) => [b] -> [c] -> Free b (Free c r) -> Lin b c r Source

transpose :: (Basis b, Basis c, AbEq r) => Free c (Free b r) -> Free b (Free c r) Source

dual :: (Basis a, Basis b, AbEq r) => Lin a b r -> Lin b a r Source

Transposition.

o :: (Basis a, Basis b, Basis c, RingEq r) => Lin b c r -> Lin a b r -> Lin a c r Source

Composition of linear maps.

apply :: (Basis a, Basis b, RingEq r) => Free a (Free b r) -> Free a r -> Free b r Source

Matrix-vector-multiplication.

tensor :: (Basis b, Basis c, Ring r, Eq r) => Free b r -> Free c r -> Free (b, c) r Source

Outer tensor product. Works also for linear maps, but for endomorphisms, * is preferred.

isNullMatrix :: AbEq r => Lin a b r -> Bool Source

Checks whether the linear map maps everything to def.

join_free :: (Basis b, Basis c, AbelianGroup r) => Free b (Free c r) -> Free (b, c) r Source

unions :: (Basis a, Foldable f) => f (Set a) -> Set a Source

mapToPairs :: (Basis k, Basis a) => Map k (Set a) -> Set (k, a) Source

join_codomains :: (Basis b, Basis b', Basis c, Basis c', AbEq r) => Lin b c (Lin b' c' r) -> Set (c, c') Source

join_domains :: (Basis b, Basis b', Basis c, Basis c', AbEq r) => Lin b c (Lin b' c' r) -> Set (b, b') Source

join_lin :: (Basis a, Basis b, Basis c, Basis d, AbEq r) => Lin a c (Lin b d r) -> Lin (a, b) (c, d) r Source

seqMatrix :: Free c (Free b r) -> x -> x Source

Reduce the entries of a matrix to weak head normal form.

($!!!) :: (Free c (Free b r) -> x) -> Free c (Free b r) -> x infixr 0 Source

Apply seqMatrix to the argument before applying the function to it.

gauss :: forall b c r. (Basis b, Basis c, Field r, Eq r, NFData b, NFData c, NFData r) => Lin b c r -> Lin b c r Source

Applies elementary column transformations until column echelon form is achieved.

rank :: (Basis b, Basis c, Field r, Eq r, NFData b, NFData c, NFData r) => Lin b c r -> Int Source

adjust :: Basis b => (r -> r) -> b -> Free b r -> Free b r Source

exchange :: Basis b => b -> b -> Free b r -> Free b r Source

findIndices :: (r -> Bool) -> Free b r -> [b] Source

(#) :: (Basis b, Basis c, AbelianGroup r) => Free c (Free b r) -> (c, b) -> r Source