Data.Algebraic.NumberField
- Package
- purescript-numberfield
- Repository
- Ebmtranceboy/purescript-numberfield
#Expression Source
type Expression :: forall k. k -> Type -> Type
type Expression f a = Reflectable f (Framework a) => Proxy f -> Extension (Proxy f) (Framework a)
#Extension Source
newtype Extension :: forall k. k -> Type -> Type
newtype Extension f a
Constructors
Instances
(Add n1 1 n, Arity (Polynomial (Polynomial a)) n, Divisible a, Eq a, EuclideanRing a, Full n1 (Polynomial a), Leadable a, Reflectable f (Framework (Polynomial a))) => Semiring (Extension (Proxy f) (Framework (Polynomial a)))
(Add n1 1 n, Arity (Polynomial (Polynomial a)) n, Divisible a, Eq a, EuclideanRing a, Full n1 (Polynomial a), Leadable a, Reflectable f (Framework (Polynomial a))) => Ring (Extension (Proxy f) (Framework (Polynomial a)))
(Add n 1 m1, Add m1 1 m, Arity (Polynomial (Polynomial a)) m, Divisible a, Divisible r, Eq a, Eq r, EuclideanRing a, EuclideanRing r, Full m1 (Polynomial a), Leadable a, Leadable r, Ord r, Pad n (Polynomial r) (Polynomial (Polynomial a)), Peel r r, Reflectable f (Framework (Polynomial a)), Unpad n (Polynomial r) (Polynomial (Polynomial a))) => DivisionRing (Extension (Proxy f) (Framework (Polynomial a)))
#Framework Source
newtype Framework a
Constructors
Framework { lift :: a -> Polynomial a, minimal :: Polynomial a, primitiveExpressions :: Array (Polynomial a), primitiveSubstitution :: Polynomial a -> Polynomial a, rawModuli :: Array (Polynomial a), unlift :: Polynomial a -> a, value :: a }
Instances
Reifiable (Framework (Polynomial (Ratio a)))
(Reifiable (Framework a)) => Reifiable (Framework (Polynomial a))
(Add n1 1 n, Arity (Polynomial (Polynomial a)) n, Divisible a, Eq a, EuclideanRing a, Full n1 (Polynomial a), Leadable a, Reflectable f (Framework (Polynomial a))) => Semiring (Extension (Proxy f) (Framework (Polynomial a)))
(Add n1 1 n, Arity (Polynomial (Polynomial a)) n, Divisible a, Eq a, EuclideanRing a, Full n1 (Polynomial a), Leadable a, Reflectable f (Framework (Polynomial a))) => Ring (Extension (Proxy f) (Framework (Polynomial a)))
(Add n 1 m1, Add m1 1 m, Arity (Polynomial (Polynomial a)) m, Divisible a, Divisible r, Eq a, Eq r, EuclideanRing a, EuclideanRing r, Full m1 (Polynomial a), Leadable a, Leadable r, Ord r, Pad n (Polynomial r) (Polynomial (Polynomial a)), Peel r r, Reflectable f (Framework (Polynomial a)), Unpad n (Polynomial r) (Polynomial (Polynomial a))) => DivisionRing (Extension (Proxy f) (Framework (Polynomial a)))
#Permutation Source
newtype Permutation
Constructors
Instances
Show Permutation
Semigroup Permutation
Monoid Permutation
Group Permutation
Eq Permutation
Assumes disjoint cycles
Hashable Permutation
Ord Permutation
#abelize Source
abelize :: Permutation -> Permutation
Transforms a permutation into a product of disjoint cycles
#bell Source
bell :: Int -> Int
bell 5 = 1+5+10+10+15+10+1 for 5 = 5 : {{a,b,c,d,e}} = 4 + 1 : {{a,b,c,d},{e}},{{a,b,c,e},{d}},{{a,b,d,e},{c}},{{a,c,d,e},{b}},{{b,c,d,e},{a}} = 3 + 2 : {{a,b,c},{d,e}},{{a,b,d},{c,e}},{{a,c,d},{b,e}},{{b,c,d},{a,e}},{{a,b,e},{c,d}} ,{{a,c,e},{b,d}},{{a,d,e},{b,c}},{{b,c,e},{a,d}},{{c,d,e},{a,b}},{{b,d,e},{a,c}} = 3 + 1 + 1 : {{a,b,c},{d},{e}},{{a,b,d},{c},{e}} ,{{a,c,d},{b},{e}},{{b,c,d},{a},{e}} ,{{a,b,e},{c},{d}},{{a,c,e},{b},{d}} ,{{a,d,e},{b},{c}},{{b,c,e},{a},{d}} ,{{c,d,e},{a},{b}},{{b,d,e},{a},{c}} ,a+aa,a+aa,aa+a,aa+a,aaa+* = 2 + 2 + 1 : ++a,++a,++a,+a+,a++ ,++a,++a,+a+,+a+,a++ ,++a,+a+,+a+,+a+,a++ = 2 + 1 + 1 + 1 : {{a},{b},{c},{d,e}},{{a},{b},{d},{c,e}} ,{{a},{c},{d},{b,e}},{{b},{c},{d},{a,e}} ,{{a},{b},{e},{c,d}},{{a},{c},{e},{b,d}} ,{{a},{d},{e},{b,c}},{{b},{c},{e},{a,d}} ,{{c},{d},{e},{a,b}},{{b},{d},{e},{a,c}} = 1 + 1 + 1 + 1 + 1 : {{a},{b},{c},{d},{e}}
#cardinality Source
cardinality :: Array Int -> Int -> Int
Returns the number of permutations of whole elements satisfying the provided type given by an array of cycle lengths. For instance cardinality [2,2] 5 = cardinality [2,2,1] 5 = 15 for all permutations of type (ab)(cd)(e).
#cayley Source
cayley :: forall a. Divisible a => Eq a => EuclideanRing a => Leadable a => Peel a a => Polynomial a -> Polynomial a -> Polynomial a
Computes the reciprocal of the second polynomial with the help of the previously computed https://en.wikipedia.org/wiki/Resultant between that polynomial and the minimal polynomial of the extension
#cyclotomic Source
cyclotomic :: forall a. Eq a => Ring a => Divisible a => Leadable a => CommutativeRing a => Int -> Polynomial a
cyclotomic n
returns the (irreductible)
univariate minimal polynomial of degree totient n
whose roots are all the totient n
primitive roots of unity
#discriminant Source
discriminant :: forall a. Eq a => Semiring a => Ring a => EuclideanRing a => Ord a => Divisible a => Leadable a => IntLiftable a => Polynomial a -> a
Discriminant of a univariate polynomial
#extensionBySum Source
extensionBySum :: forall a. CommutativeRing a => Divisible a => Eq a => Leadable a => Ord a => Ring a => Array (Polynomial a) -> Polynomial a
Builds the minimal polynomial whose root(s) is (are) the sum of the roots of each of the polynomials listed in the array
#f0 Source
f0 :: Permutation
#f1 Source
f1 :: Permutation
#f10 Source
f10 :: Permutation
#f11 Source
f11 :: Permutation
#f12 Source
f12 :: Permutation
#f13 Source
f13 :: Permutation
#f14 Source
f14 :: Permutation
#f2 Source
f2 :: Permutation
#f3 Source
f3 :: Permutation
#f4 Source
f4 :: Permutation
#f5 Source
f5 :: Permutation
#f6 Source
f6 :: Permutation
#f7 Source
f7 :: Permutation
#f8 Source
f8 :: Permutation
#f9 Source
f9 :: Permutation
#framework Source
framework :: forall r a n1 n2 n3. Add n3 1 n2 => Add n2 1 n1 => Arity (Polynomial (Polynomial a)) n1 => Axed a r => CommutativeRing a => CommutativeRing r => Divisible a => Divisible r => DivisionRing r => Full n2 (Polynomial a) => GoSwap 0 n1 (Polynomial a) => Leadable a => Leadable r => Nest n2 (Polynomial a) => Ord a => Ord r => Pad n3 (Polynomial r) (Polynomial (Polynomial a)) => Pad n2 (Polynomial r) (Polynomial (Polynomial (Polynomial a))) => Peel a r => Set n2 r (Polynomial a) => Unpad n3 (Polynomial r) (Polynomial (Polynomial a)) => Polynomial a -> Array (Polynomial r) -> Framework (Polynomial a)
Computes the required quantities needed to perform computations with algebraic extensions in the field of rational numbers
#generate Source
generate :: Set Permutation -> Set Permutation
Returns the set of elements generated by an set of permutations. Assumes set of products of disjoint cycles.
#isGroup Source
isGroup :: Set Permutation -> Boolean
Tests if the set of given elements is closed under group operation
#leftCosets Source
leftCosets :: Set Permutation -> Set Permutation -> Set (Set Permutation)
#minimalPolynomial Source
minimalPolynomial :: forall a. Framework a -> Polynomial a
#nextRepresentation Source
nextRepresentation :: Array Int -> Array Int
Circular permutation of a cycle
#normalSubgroups Source
normalSubgroups :: Set Permutation -> Set (Set Permutation)
#normalize Source
normalize :: forall f a n n1. Add n1 1 n => Arity (Polynomial (Polynomial a)) n => Divisible a => Eq a => EuclideanRing a => Full n1 (Polynomial a) => Leadable a => Reflectable f (Framework (Polynomial a)) => Polynomial a -> Extension (Proxy f) (Framework (Polynomial a))
#order Source
order :: Permutation -> Int
Returns 1 if p = id, or k>1 s.t. p^(k-1) /= id and p^k = id
Assumes product disjoint cycles
#partitions Source
partitions :: Int -> Int
#permutationsR Source
permutationsR :: forall f a. Foldable f => Eq a => f a -> Array (Array a)
Etablit la liste complète des permutations distinctes d'une liste même en cas d'éléments redondants :
#ptype Source
ptype :: Permutation -> Array Int
Returns the type of a permutation, i.e. the list of orders of one of its expected representation as a product of disjoint cycles. This type is notably the characteritic shared by every conjuate of the permutation, in other words, the set of permutations sharing the same type
#ramanujanTau Source
ramanujanTau :: Int -> Int
#reciprocal Source
reciprocal :: forall n n1 n2 a r. Add n2 1 n1 => Add n1 1 n => Arity a n => Divisible r => Eq r => EuclideanRing r => Leadable r => Ord r => Pad n2 (Polynomial r) a => Peel r r => Unpad n2 (Polynomial r) a => a -> a -> a
Computes the reciprocal of the first polynomial in the extension whose minimal polynomial is provided by the second polynomial
#rightCosets Source
rightCosets :: Set Permutation -> Set Permutation -> Set (Set Permutation)
#run Source
run :: forall a. Framework (Polynomial a) -> Polynomial a
#subgroups Source
subgroups :: Set Permutation -> Set (Set Permutation)
#sumDivisors Source
sumDivisors :: Int -> Int
#sylvester Source
sylvester :: forall a. CommutativeRing a => Divisible a => Eq a => Leadable a => Polynomial a -> Polynomial a -> Matrix a
Builds the https://en.wikipedia.org/wiki/Sylvester_matrix of two univariate polynomials with coefficients in a commutative ring
#symmetric Source
symmetric :: Int -> Array Permutation
Presentation of the Symmetric Group of order n as an array of product of disjoint cycles.
#toPrimitive Source
toPrimitive :: forall a. Framework a -> Array (Polynomial a)
#trim Source
trim :: Permutation -> Permutation
- Modules
- Data.
Algebraic. NumberField
Assumes disjoint cycles