| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
SubHask.Algebra.Group
Description
This module contains most of the math types not directly related to linear algebra
FIXME: there is probably a better name for this
- newtype NonNegative t = NonNegative {
- unNonNegative :: t
- class Quotient a b where
- mkQuotient :: a -> a / b
- newtype a / b = Mod a
- type Z n = Integer / n
- extendedEuclid :: (Eq t, Integral t) => t -> t -> (t, t, t, t, t, t)
- newtype Galois p k = Galois (Z (p ^ k))
- class Prime n
- data GrothendieckGroup g where
- GrotheindieckGroup :: Cancellative g => g -> GrothendieckGroup g
- newtype VedicSquare n = VedicSquare (Z n)
Documentation
newtype NonNegative t Source
Constructors
| NonNegative | |
Fields
| |
Instances
class Quotient a b where Source
Maps members of an equivalence class into the "canonical" element.
Methods
mkQuotient :: a -> a / b Source
The type of equivalence classes created by a mod b.
Constructors
| Mod a |
Instances
| KnownNat n => FiniteType (Z n) Source | |
| Eq a0 => Eq ((/) k a b) Source | |
| (Ord a0, Eq a0) => Ord ((/) k a b) Source | |
| Read a0 => Read ((/) k a b) Source | |
| Show a0 => Show ((/) k a b) Source | |
| (Quotient k a b, Arbitrary a) => Arbitrary ((/) k a b) Source | |
| NFData a0 => NFData ((/) k a b) Source | |
| IsMutable a0 => IsMutable ((/) k a b) Source | |
| (Module a, Quotient k a b) => Module ((/) k a b) Source | |
| (Ring a, Quotient k a b) => Ring ((/) k a b) Source | |
| (Rig a, Quotient k a b) => Rig ((/) k a b) Source | |
| (Rg a, Quotient k a b) => Rg ((/) k a b) Source | |
| (Abelian a, Quotient k a b) => Abelian ((/) k a b) Source | |
| (Group a, Quotient k a b) => Group ((/) k a b) Source | |
| (Cancellative a, Quotient k a b) => Cancellative ((/) k a b) Source | |
| (Monoid a, Quotient k a b) => Monoid ((/) k a b) Source | |
| (Semigroup a, Quotient k a b) => Semigroup ((/) k a b) Source | |
| Eq_ a0 => Eq_ ((/) k a b) Source | |
| type (><) * k ((/) k1 a b) c = (/) k1 ((><) * k a c) b Source | |
| data Mutable m ((/) k a0 b0) = Mutable_Mod (Mutable m a) Source | |
| type Order (Z n) = n Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Elem ((/) k a0 b0) = Elem a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Scalar ((/) k a0 b0) = Scalar a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Actor ((/) k a0 b0) = Actor a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source | |
| type Logic ((/) k a0 b0) = Logic a0 Source |
extendedEuclid :: (Eq t, Integral t) => t -> t -> (t, t, t, t, t, t) Source
Extended Euclid's algorithm is used to calculate inverses in modular arithmetic
Galois p k is the type of integers modulo p^k, where p is prime.
All finite fields have this form.
See wikipedia https://en.wikipedia.org/wiki/Finite_field for more details.
FIXME: Many arithmetic operations over Galois Fields can be implemented more efficiently than the standard operations. See http://en.wikipedia.org/wiki/Finite_field_arithmetic.
Instances
| Read (Z ((^) p0 k0)) => Read (Galois p k) Source | |
| Show (Z ((^) p0 k0)) => Show (Galois p k) Source | |
| Arbitrary (Z ((^) p0 k0)) => Arbitrary (Galois p k) Source | |
| NFData (Z ((^) p0 k0)) => NFData (Galois p k) Source | |
| IsMutable (Galois p k) Source | |
| KnownNat ((^) p k) => Module (Galois p k) Source | |
| (Prime p, KnownNat ((^) p k)) => Field (Galois p k) Source | |
| (Ring (Z ((^) p0 k0)), Rng (Z ((^) p0 k0)), Rig (Z ((^) p0 k0))) => Ring (Galois p k) Source | |
| (Rig (Z ((^) p0 k0)), Monoid (Z ((^) p0 k0)), Rg (Z ((^) p0 k0))) => Rig (Galois p k) Source | |
| (Rg (Z ((^) p0 k0)), Abelian (Z ((^) p0 k0)), Monoid (Z ((^) p0 k0))) => Rg (Galois p k) Source | |
| (Abelian (Z ((^) p0 k0)), Semigroup (Z ((^) p0 k0))) => Abelian (Galois p k) Source | |
| (Group (Z ((^) p0 k0)), Cancellative (Z ((^) p0 k0)), Monoid (Z ((^) p0 k0))) => Group (Galois p k) Source | |
| (Cancellative (Z ((^) p0 k0)), Semigroup (Z ((^) p0 k0))) => Cancellative (Galois p k) Source | |
| (Monoid (Z ((^) p0 k0)), Semigroup (Z ((^) p0 k0))) => Monoid (Galois p k) Source | |
| (Semigroup (Z ((^) p0 k0)), IsMutable (Z ((^) p0 k0))) => Semigroup (Galois p k) Source | |
| Eq_ (Z ((^) p0 k0)) => Eq_ (Galois p k) Source | |
| type (><) * * (Galois p k) Integer = Galois p k Source | |
| data Mutable m (Galois p0 k0) = Mutable_Galois (Mutable m (Z ((^) p k))) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Elem (Galois p0 k0) = Elem (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Scalar (Galois p0 k0) = Scalar (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Actor (Galois p0 k0) = Actor (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source | |
| type Logic (Galois p0 k0) = Logic (Z ((^) p0 k0)) Source |
data GrothendieckGroup g where Source
The symmetric group is one of the simplest and best studied finite groups. It is efficiently implemented as a "BijectiveT SparseFunction (Z n) (Z n)". See https://en.wikipedia.org/wiki/Symmetric_group
The GrothendieckGroup is a general way to construct groups from cancellative semigroups.
FIXME: How should this be related to the Ratio type?
See wikipedia for more details.
Constructors
| GrotheindieckGroup :: Cancellative g => g -> GrothendieckGroup g |
newtype VedicSquare n Source
The Vedic Square always forms a monoid, and sometimes forms a group depending on the value of "n". (The type system isn't powerful enough to encode these special cases.)
See wikipedia for more detail.
Constructors
| VedicSquare (Z n) |
Instances