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

Math.Core.Field

Description

A module defining the field Q of rationals and the small finite fields (Galois fields) F2, F3, F4, F5, F7, F8, F9, F11, F13, F16, F17, F19, F23, F25.

Given a prime power q, Fq is the type representing elements of the field (eg F4), fq is a list of the elements of the field, beginning 0,1,... (eg f4), and for prime power fields, aq is a primitive element, which generates the multiplicative group (eg a4).

The design philosophy is that fq, the list of elements, represents the field. Thus, many functions elsewhere in the library expect to take fq as an argument, telling them which field to work over.

Synopsis

# Documentation

newtype Q Source #

Q is just the rationals, but with a better show function than the Prelude version

Constructors

 Q Rational
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: Q -> Q -> Bool #(/=) :: Q -> Q -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: Q -> Q -> Q #recip :: Q -> Q # Source # Instance detailsDefined in Math.NumberTheory.QuadraticField Methods(/) :: QNF -> QNF -> QNF #recip :: QNF -> QNF # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: Q -> Q -> Q #(-) :: Q -> Q -> Q #(*) :: Q -> Q -> Q #negate :: Q -> Q #abs :: Q -> Q #signum :: Q -> Q # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: Q -> Q -> Ordering #(<) :: Q -> Q -> Bool #(<=) :: Q -> Q -> Bool #(>) :: Q -> Q -> Bool #(>=) :: Q -> Q -> Bool #max :: Q -> Q -> Q #min :: Q -> Q -> Q # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> Q -> ShowS #show :: Q -> String #showList :: [Q] -> ShowS # Source # 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). Instance detailsDefined in Math.Algebras.GroupAlgebra Methods

newtype F2 Source #

F2 is a type for the finite field with 2 elements

Constructors

 F2 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F2 -> F2 -> Bool #(/=) :: F2 -> F2 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F2 -> F2 -> F2 #recip :: F2 -> F2 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F2 -> F2 -> F2 #(-) :: F2 -> F2 -> F2 #(*) :: F2 -> F2 -> F2 #negate :: F2 -> F2 #abs :: F2 -> F2 #signum :: F2 -> F2 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F2 -> F2 -> Ordering #(<) :: F2 -> F2 -> Bool #(<=) :: F2 -> F2 -> Bool #(>) :: F2 -> F2 -> Bool #(>=) :: F2 -> F2 -> Bool #max :: F2 -> F2 -> F2 #min :: F2 -> F2 -> F2 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F2 -> ShowS #show :: F2 -> String #showList :: [F2] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F2] Source #

f2 :: [F2] Source #

f2 is a list of the elements of F2

newtype F3 Source #

F3 is a type for the finite field with 3 elements

Constructors

 F3 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F3 -> F3 -> Bool #(/=) :: F3 -> F3 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F3 -> F3 -> F3 #recip :: F3 -> F3 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F3 -> F3 -> F3 #(-) :: F3 -> F3 -> F3 #(*) :: F3 -> F3 -> F3 #negate :: F3 -> F3 #abs :: F3 -> F3 #signum :: F3 -> F3 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F3 -> F3 -> Ordering #(<) :: F3 -> F3 -> Bool #(<=) :: F3 -> F3 -> Bool #(>) :: F3 -> F3 -> Bool #(>=) :: F3 -> F3 -> Bool #max :: F3 -> F3 -> F3 #min :: F3 -> F3 -> F3 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F3 -> ShowS #show :: F3 -> String #showList :: [F3] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F3] Source #

f3 :: [F3] Source #

f3 is a list of the elements of F3

newtype F5 Source #

F5 is a type for the finite field with 5 elements

Constructors

 F5 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F5 -> F5 -> Bool #(/=) :: F5 -> F5 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F5 -> F5 -> F5 #recip :: F5 -> F5 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F5 -> F5 -> F5 #(-) :: F5 -> F5 -> F5 #(*) :: F5 -> F5 -> F5 #negate :: F5 -> F5 #abs :: F5 -> F5 #signum :: F5 -> F5 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F5 -> F5 -> Ordering #(<) :: F5 -> F5 -> Bool #(<=) :: F5 -> F5 -> Bool #(>) :: F5 -> F5 -> Bool #(>=) :: F5 -> F5 -> Bool #max :: F5 -> F5 -> F5 #min :: F5 -> F5 -> F5 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F5 -> ShowS #show :: F5 -> String #showList :: [F5] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F5] Source #

f5 :: [F5] Source #

f5 is a list of the elements of F5

newtype F7 Source #

F7 is a type for the finite field with 7 elements

Constructors

 F7 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F7 -> F7 -> Bool #(/=) :: F7 -> F7 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F7 -> F7 -> F7 #recip :: F7 -> F7 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F7 -> F7 -> F7 #(-) :: F7 -> F7 -> F7 #(*) :: F7 -> F7 -> F7 #negate :: F7 -> F7 #abs :: F7 -> F7 #signum :: F7 -> F7 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F7 -> F7 -> Ordering #(<) :: F7 -> F7 -> Bool #(<=) :: F7 -> F7 -> Bool #(>) :: F7 -> F7 -> Bool #(>=) :: F7 -> F7 -> Bool #max :: F7 -> F7 -> F7 #min :: F7 -> F7 -> F7 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F7 -> ShowS #show :: F7 -> String #showList :: [F7] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F7] Source #

f7 :: [F7] Source #

f7 is a list of the elements of F7

newtype F11 Source #

F11 is a type for the finite field with 11 elements

Constructors

 F11 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F11 -> F11 -> Bool #(/=) :: F11 -> F11 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F11 -> F11 -> F11 #recip :: F11 -> F11 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F11 -> F11 -> F11 #(-) :: F11 -> F11 -> F11 #(*) :: F11 -> F11 -> F11 #negate :: F11 -> F11 #abs :: F11 -> F11 #signum :: F11 -> F11 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F11 -> F11 -> Ordering #(<) :: F11 -> F11 -> Bool #(<=) :: F11 -> F11 -> Bool #(>) :: F11 -> F11 -> Bool #(>=) :: F11 -> F11 -> Bool #max :: F11 -> F11 -> F11 #min :: F11 -> F11 -> F11 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F11 -> ShowS #show :: F11 -> String #showList :: [F11] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F11] Source #

f11 :: [F11] Source #

f11 is a list of the elements of F11

newtype F13 Source #

F13 is a type for the finite field with 13 elements

Constructors

 F13 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F13 -> F13 -> Bool #(/=) :: F13 -> F13 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F13 -> F13 -> F13 #recip :: F13 -> F13 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F13 -> F13 -> F13 #(-) :: F13 -> F13 -> F13 #(*) :: F13 -> F13 -> F13 #negate :: F13 -> F13 #abs :: F13 -> F13 #signum :: F13 -> F13 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F13 -> F13 -> Ordering #(<) :: F13 -> F13 -> Bool #(<=) :: F13 -> F13 -> Bool #(>) :: F13 -> F13 -> Bool #(>=) :: F13 -> F13 -> Bool #max :: F13 -> F13 -> F13 #min :: F13 -> F13 -> F13 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F13 -> ShowS #show :: F13 -> String #showList :: [F13] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F13] Source #

f13 :: [F13] Source #

f13 is a list of the elements of F13

newtype F17 Source #

F17 is a type for the finite field with 17 elements

Constructors

 F17 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F17 -> F17 -> Bool #(/=) :: F17 -> F17 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F17 -> F17 -> F17 #recip :: F17 -> F17 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F17 -> F17 -> F17 #(-) :: F17 -> F17 -> F17 #(*) :: F17 -> F17 -> F17 #negate :: F17 -> F17 #abs :: F17 -> F17 #signum :: F17 -> F17 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F17 -> F17 -> Ordering #(<) :: F17 -> F17 -> Bool #(<=) :: F17 -> F17 -> Bool #(>) :: F17 -> F17 -> Bool #(>=) :: F17 -> F17 -> Bool #max :: F17 -> F17 -> F17 #min :: F17 -> F17 -> F17 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F17 -> ShowS #show :: F17 -> String #showList :: [F17] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F17] Source #

f17 :: [F17] Source #

f17 is a list of the elements of F17

newtype F19 Source #

F19 is a type for the finite field with 19 elements

Constructors

 F19 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F19 -> F19 -> Bool #(/=) :: F19 -> F19 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F19 -> F19 -> F19 #recip :: F19 -> F19 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F19 -> F19 -> F19 #(-) :: F19 -> F19 -> F19 #(*) :: F19 -> F19 -> F19 #negate :: F19 -> F19 #abs :: F19 -> F19 #signum :: F19 -> F19 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F19 -> F19 -> Ordering #(<) :: F19 -> F19 -> Bool #(<=) :: F19 -> F19 -> Bool #(>) :: F19 -> F19 -> Bool #(>=) :: F19 -> F19 -> Bool #max :: F19 -> F19 -> F19 #min :: F19 -> F19 -> F19 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F19 -> ShowS #show :: F19 -> String #showList :: [F19] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F19] Source #

f19 :: [F19] Source #

f19 is a list of the elements of F19

newtype F23 Source #

F23 is a type for the finite field with 23 elements

Constructors

 F23 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F23 -> F23 -> Bool #(/=) :: F23 -> F23 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F23 -> F23 -> F23 #recip :: F23 -> F23 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F23 -> F23 -> F23 #(-) :: F23 -> F23 -> F23 #(*) :: F23 -> F23 -> F23 #negate :: F23 -> F23 #abs :: F23 -> F23 #signum :: F23 -> F23 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F23 -> F23 -> Ordering #(<) :: F23 -> F23 -> Bool #(<=) :: F23 -> F23 -> Bool #(>) :: F23 -> F23 -> Bool #(>=) :: F23 -> F23 -> Bool #max :: F23 -> F23 -> F23 #min :: F23 -> F23 -> F23 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F23 -> ShowS #show :: F23 -> String #showList :: [F23] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F23] Source #

f23 :: [F23] Source #

f23 is a list of the elements of F23

newtype F4 Source #

F4 is a type for the finite field with 4 elements. F4 is represented as the extension of F2 by an element a4 satisfying x^2+x+1 = 0

Constructors

 F4 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F4 -> F4 -> Bool #(/=) :: F4 -> F4 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F4 -> F4 -> F4 #recip :: F4 -> F4 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F4 -> F4 -> F4 #(-) :: F4 -> F4 -> F4 #(*) :: F4 -> F4 -> F4 #negate :: F4 -> F4 #abs :: F4 -> F4 #signum :: F4 -> F4 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F4 -> F4 -> Ordering #(<) :: F4 -> F4 -> Bool #(<=) :: F4 -> F4 -> Bool #(>) :: F4 -> F4 -> Bool #(>=) :: F4 -> F4 -> Bool #max :: F4 -> F4 -> F4 #min :: F4 -> F4 -> F4 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F4 -> ShowS #show :: F4 -> String #showList :: [F4] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F4] Source #

a4 is a primitive element for F4 as an extension over F2. a4 satisfies x^2+x+1 = 0.

f4 :: [F4] Source #

f4 is a list of the elements of F4

powers :: (Eq a, Num a) => a -> [a] Source #

newtype F8 Source #

F8 is a type for the finite field with 8 elements. F8 is represented as the extension of F2 by an element a8 satisfying x^3+x+1 = 0

Constructors

 F8 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F8 -> F8 -> Bool #(/=) :: F8 -> F8 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F8 -> F8 -> F8 #recip :: F8 -> F8 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F8 -> F8 -> F8 #(-) :: F8 -> F8 -> F8 #(*) :: F8 -> F8 -> F8 #negate :: F8 -> F8 #abs :: F8 -> F8 #signum :: F8 -> F8 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F8 -> F8 -> Ordering #(<) :: F8 -> F8 -> Bool #(<=) :: F8 -> F8 -> Bool #(>) :: F8 -> F8 -> Bool #(>=) :: F8 -> F8 -> Bool #max :: F8 -> F8 -> F8 #min :: F8 -> F8 -> F8 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F8 -> ShowS #show :: F8 -> String #showList :: [F8] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F8] Source #

a8 is a primitive element for F8 as an extension over F2. a8 satisfies x^3+x+1 = 0.

f8 :: [F8] Source #

f8 is a list of the elements of F8

newtype F9 Source #

F9 is a type for the finite field with 9 elements. F9 is represented as the extension of F3 by an element a9 satisfying x^2+2x+2 = 0

Constructors

 F9 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F9 -> F9 -> Bool #(/=) :: F9 -> F9 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F9 -> F9 -> F9 #recip :: F9 -> F9 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F9 -> F9 -> F9 #(-) :: F9 -> F9 -> F9 #(*) :: F9 -> F9 -> F9 #negate :: F9 -> F9 #abs :: F9 -> F9 #signum :: F9 -> F9 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F9 -> F9 -> Ordering #(<) :: F9 -> F9 -> Bool #(<=) :: F9 -> F9 -> Bool #(>) :: F9 -> F9 -> Bool #(>=) :: F9 -> F9 -> Bool #max :: F9 -> F9 -> F9 #min :: F9 -> F9 -> F9 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F9 -> ShowS #show :: F9 -> String #showList :: [F9] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F9] Source #

a9 is a primitive element for F9 as an extension over F3. a9 satisfies x^2+2x+2 = 0.

f9 :: [F9] Source #

f9 is a list of the elements of F9

newtype F16 Source #

F16 is a type for the finite field with 16 elements. F16 is represented as the extension of F2 by an element a16 satisfying x^4+x+1 = 0

Constructors

 F16 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F16 -> F16 -> Bool #(/=) :: F16 -> F16 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F16 -> F16 -> F16 #recip :: F16 -> F16 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F16 -> F16 -> F16 #(-) :: F16 -> F16 -> F16 #(*) :: F16 -> F16 -> F16 #negate :: F16 -> F16 #abs :: F16 -> F16 #signum :: F16 -> F16 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F16 -> F16 -> Ordering #(<) :: F16 -> F16 -> Bool #(<=) :: F16 -> F16 -> Bool #(>) :: F16 -> F16 -> Bool #(>=) :: F16 -> F16 -> Bool #max :: F16 -> F16 -> F16 #min :: F16 -> F16 -> F16 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F16 -> ShowS #show :: F16 -> String #showList :: [F16] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F16] Source #

a16 is a primitive element for F16 as an extension over F2. a16 satisfies x^4+x+1 = 0.

f16 :: [F16] Source #

f16 is a list of the elements of F16

newtype F25 Source #

F25 is a type for the finite field with 25 elements. F25 is represented as the extension of F5 by an element a25 satisfying x^2+4x+2 = 0

Constructors

 F25 Int
Instances
 Source # Instance detailsDefined in Math.Core.Field Methods(==) :: F25 -> F25 -> Bool #(/=) :: F25 -> F25 -> Bool # Source # Instance detailsDefined in Math.Core.Field Methods(/) :: F25 -> F25 -> F25 #recip :: F25 -> F25 # Source # Instance detailsDefined in Math.Core.Field Methods(+) :: F25 -> F25 -> F25 #(-) :: F25 -> F25 -> F25 #(*) :: F25 -> F25 -> F25 #negate :: F25 -> F25 #abs :: F25 -> F25 #signum :: F25 -> F25 # Source # Instance detailsDefined in Math.Core.Field Methodscompare :: F25 -> F25 -> Ordering #(<) :: F25 -> F25 -> Bool #(<=) :: F25 -> F25 -> Bool #(>) :: F25 -> F25 -> Bool #(>=) :: F25 -> F25 -> Bool #max :: F25 -> F25 -> F25 #min :: F25 -> F25 -> F25 # Source # Instance detailsDefined in Math.Core.Field MethodsshowsPrec :: Int -> F25 -> ShowS #show :: F25 -> String #showList :: [F25] -> ShowS # Source # Instance detailsDefined in Math.Core.Field Methodselts :: [F25] Source #

a25 is a primitive element for F25 as an extension over F5. a25 satisfies x^2+4x+2 = 0.

f25 :: [F25] Source #

f25 is a list of the elements of F25