A small kernel of code for playing with Galois fields of arbitrary characteristic
リビジョン | 8afc24c8f8d1045f8bcd53bd700b3e093a6748bf (tree) |
---|---|
日時 | 2019-08-02 08:58:36 |
作者 | Eric Hopper <hopper@omni...> |
コミッター | Eric Hopper |
Beging making this more like a reusable Python module.
@@ -6,6 +6,16 @@ | ||
6 | 6 | _fieldTypes = {} |
7 | 7 | |
8 | 8 | def gfMeta(prime_, basis_): |
9 | + """Use this to create a class representing a Galois extension field. | |
10 | + | |
11 | + prime is the first argument and is the characteristic, Every | |
12 | + polynomial coefficient in the extension field will be a member of | |
13 | + Zprime (integers modulo prime) | |
14 | + | |
15 | + basis is the irreducible polynomial that defines the extension | |
16 | + field. It's degree is one larger than the degree of any member of | |
17 | + the field. | |
18 | + """ | |
9 | 19 | global _fieldTypes |
10 | 20 | prime_ = int(prime_) |
11 | 21 | basis_ = tuple((int(p) for p in basis_)) |
@@ -1,4 +1,4 @@ | ||
1 | -import polyops | |
1 | +from . import polyops | |
2 | 2 | import fractions |
3 | 3 | from functools import reduce |
4 | 4 |