diff --git a/v0.3.x/.doctrees/api/galois.BCH.decode.doctree b/v0.3.x/.doctrees/api/galois.BCH.decode.doctree index ebaa991ae..0996dc722 100644 Binary files a/v0.3.x/.doctrees/api/galois.BCH.decode.doctree and b/v0.3.x/.doctrees/api/galois.BCH.decode.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.BCH.detect.doctree b/v0.3.x/.doctrees/api/galois.BCH.detect.doctree index 5ff6a7084..b142f8fa7 100644 Binary files a/v0.3.x/.doctrees/api/galois.BCH.detect.doctree and b/v0.3.x/.doctrees/api/galois.BCH.detect.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.BCH.doctree b/v0.3.x/.doctrees/api/galois.BCH.doctree index f1e40cd23..7f49f3a8f 100644 Binary files a/v0.3.x/.doctrees/api/galois.BCH.doctree and b/v0.3.x/.doctrees/api/galois.BCH.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.BCH.encode.doctree b/v0.3.x/.doctrees/api/galois.BCH.encode.doctree index 166948712..720f86059 100644 Binary files a/v0.3.x/.doctrees/api/galois.BCH.encode.doctree and b/v0.3.x/.doctrees/api/galois.BCH.encode.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.Random.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.Random.doctree index ba8b2a445..c99e35122 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.Random.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.Random.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.characteristic_poly.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.characteristic_poly.doctree index 0689122d7..ac242b7ea 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.characteristic_poly.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.characteristic_poly.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.column_space.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.column_space.doctree index 5f9cb24a6..b8fe92e77 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.column_space.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.column_space.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.left_null_space.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.left_null_space.doctree index f1a51e473..e2f403b59 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.left_null_space.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.left_null_space.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.log.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.log.doctree index 217b0b046..380e20e51 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.log.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.log.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.minimal_poly.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.minimal_poly.doctree index e6078d527..09fb3e0b2 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.minimal_poly.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.minimal_poly.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.null_space.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.null_space.doctree index f6d9344ec..9f2e32afd 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.null_space.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.null_space.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.FieldArray.row_space.doctree b/v0.3.x/.doctrees/api/galois.FieldArray.row_space.doctree index 5015119f3..91605a4e2 100644 Binary files a/v0.3.x/.doctrees/api/galois.FieldArray.row_space.doctree and b/v0.3.x/.doctrees/api/galois.FieldArray.row_space.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.Poly.Random.doctree b/v0.3.x/.doctrees/api/galois.Poly.Random.doctree index 06d94ff1a..8dc3a0786 100644 Binary files a/v0.3.x/.doctrees/api/galois.Poly.Random.doctree and b/v0.3.x/.doctrees/api/galois.Poly.Random.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.Poly.derivative.doctree b/v0.3.x/.doctrees/api/galois.Poly.derivative.doctree index cd782fa3d..116506755 100644 Binary files a/v0.3.x/.doctrees/api/galois.Poly.derivative.doctree and b/v0.3.x/.doctrees/api/galois.Poly.derivative.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.Poly.field.doctree b/v0.3.x/.doctrees/api/galois.Poly.field.doctree index 98eb5d3f3..eb58c2403 100644 Binary files a/v0.3.x/.doctrees/api/galois.Poly.field.doctree and b/v0.3.x/.doctrees/api/galois.Poly.field.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.Poly.is_irreducible.doctree b/v0.3.x/.doctrees/api/galois.Poly.is_irreducible.doctree index 1bdbbd05e..627ab1a1e 100644 Binary files a/v0.3.x/.doctrees/api/galois.Poly.is_irreducible.doctree and b/v0.3.x/.doctrees/api/galois.Poly.is_irreducible.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.ReedSolomon.decode.doctree b/v0.3.x/.doctrees/api/galois.ReedSolomon.decode.doctree index 632bf8c8a..22beb4dfd 100644 Binary files a/v0.3.x/.doctrees/api/galois.ReedSolomon.decode.doctree and b/v0.3.x/.doctrees/api/galois.ReedSolomon.decode.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.ReedSolomon.detect.doctree b/v0.3.x/.doctrees/api/galois.ReedSolomon.detect.doctree index f3603f79a..33a8983ae 100644 Binary files a/v0.3.x/.doctrees/api/galois.ReedSolomon.detect.doctree and b/v0.3.x/.doctrees/api/galois.ReedSolomon.detect.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.ReedSolomon.doctree b/v0.3.x/.doctrees/api/galois.ReedSolomon.doctree index 00a925a79..868b3620c 100644 Binary files a/v0.3.x/.doctrees/api/galois.ReedSolomon.doctree and b/v0.3.x/.doctrees/api/galois.ReedSolomon.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.ReedSolomon.encode.doctree b/v0.3.x/.doctrees/api/galois.ReedSolomon.encode.doctree index 4bfb436d5..f76d10ba5 100644 Binary files a/v0.3.x/.doctrees/api/galois.ReedSolomon.encode.doctree and b/v0.3.x/.doctrees/api/galois.ReedSolomon.encode.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.crt.doctree b/v0.3.x/.doctrees/api/galois.crt.doctree index 3bc2d15b3..4776da0f6 100644 Binary files a/v0.3.x/.doctrees/api/galois.crt.doctree and b/v0.3.x/.doctrees/api/galois.crt.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.fermat_primality_test.doctree b/v0.3.x/.doctrees/api/galois.fermat_primality_test.doctree index 550fe8225..39f07c7a2 100644 Binary files a/v0.3.x/.doctrees/api/galois.fermat_primality_test.doctree and b/v0.3.x/.doctrees/api/galois.fermat_primality_test.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.irreducible_poly.doctree b/v0.3.x/.doctrees/api/galois.irreducible_poly.doctree index ee73926fa..1981af969 100644 Binary files a/v0.3.x/.doctrees/api/galois.irreducible_poly.doctree and b/v0.3.x/.doctrees/api/galois.irreducible_poly.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.irreducible_polys.doctree b/v0.3.x/.doctrees/api/galois.irreducible_polys.doctree index a27234010..f2c1982ef 100644 Binary files a/v0.3.x/.doctrees/api/galois.irreducible_polys.doctree and b/v0.3.x/.doctrees/api/galois.irreducible_polys.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.lagrange_poly.doctree b/v0.3.x/.doctrees/api/galois.lagrange_poly.doctree index 2b2a3a2fc..76554eb52 100644 Binary files a/v0.3.x/.doctrees/api/galois.lagrange_poly.doctree and b/v0.3.x/.doctrees/api/galois.lagrange_poly.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.primitive_element.doctree b/v0.3.x/.doctrees/api/galois.primitive_element.doctree index 206782a4b..1aa8a8206 100644 Binary files a/v0.3.x/.doctrees/api/galois.primitive_element.doctree and b/v0.3.x/.doctrees/api/galois.primitive_element.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.primitive_poly.doctree b/v0.3.x/.doctrees/api/galois.primitive_poly.doctree index 428423747..18a796af4 100644 Binary files a/v0.3.x/.doctrees/api/galois.primitive_poly.doctree and b/v0.3.x/.doctrees/api/galois.primitive_poly.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.primitive_polys.doctree b/v0.3.x/.doctrees/api/galois.primitive_polys.doctree index 2a9891415..54d420f12 100644 Binary files a/v0.3.x/.doctrees/api/galois.primitive_polys.doctree and b/v0.3.x/.doctrees/api/galois.primitive_polys.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.primitive_root.doctree b/v0.3.x/.doctrees/api/galois.primitive_root.doctree index 47cf26fd4..8fc770561 100644 Binary files a/v0.3.x/.doctrees/api/galois.primitive_root.doctree and b/v0.3.x/.doctrees/api/galois.primitive_root.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.primitive_roots.doctree b/v0.3.x/.doctrees/api/galois.primitive_roots.doctree index 1c4aa8c87..11e2e7730 100644 Binary files a/v0.3.x/.doctrees/api/galois.primitive_roots.doctree and b/v0.3.x/.doctrees/api/galois.primitive_roots.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.prod.doctree b/v0.3.x/.doctrees/api/galois.prod.doctree index 71bae31a8..d9a0e52e2 100644 Binary files a/v0.3.x/.doctrees/api/galois.prod.doctree and b/v0.3.x/.doctrees/api/galois.prod.doctree differ diff --git a/v0.3.x/.doctrees/api/galois.typing.ShapeLike.doctree b/v0.3.x/.doctrees/api/galois.typing.ShapeLike.doctree index c0bfe3f04..a2b685bd0 100644 Binary files a/v0.3.x/.doctrees/api/galois.typing.ShapeLike.doctree and b/v0.3.x/.doctrees/api/galois.typing.ShapeLike.doctree differ diff --git a/v0.3.x/.doctrees/basic-usage/array-creation.doctree b/v0.3.x/.doctrees/basic-usage/array-creation.doctree index 6410158ed..e633b8d3c 100644 Binary files a/v0.3.x/.doctrees/basic-usage/array-creation.doctree and b/v0.3.x/.doctrees/basic-usage/array-creation.doctree differ diff --git a/v0.3.x/.doctrees/basic-usage/element-representation.doctree b/v0.3.x/.doctrees/basic-usage/element-representation.doctree index 0f17e1a05..47a450aed 100644 Binary files a/v0.3.x/.doctrees/basic-usage/element-representation.doctree and b/v0.3.x/.doctrees/basic-usage/element-representation.doctree differ diff --git a/v0.3.x/.doctrees/basic-usage/poly.doctree b/v0.3.x/.doctrees/basic-usage/poly.doctree index 8d830f033..f764306ac 100644 Binary files a/v0.3.x/.doctrees/basic-usage/poly.doctree and b/v0.3.x/.doctrees/basic-usage/poly.doctree differ diff --git a/v0.3.x/.doctrees/environment.pickle b/v0.3.x/.doctrees/environment.pickle index c91d626e6..177e5b699 100644 Binary files a/v0.3.x/.doctrees/environment.pickle and b/v0.3.x/.doctrees/environment.pickle differ diff --git a/v0.3.x/.doctrees/getting-started.doctree b/v0.3.x/.doctrees/getting-started.doctree index d4afc5106..c829e53be 100644 Binary files a/v0.3.x/.doctrees/getting-started.doctree and b/v0.3.x/.doctrees/getting-started.doctree differ diff --git a/v0.3.x/api/galois.Array.Identity/index.html b/v0.3.x/api/galois.Array.Identity/index.html index 5e66e883e..854d1c668 100644 --- a/v0.3.x/api/galois.Array.Identity/index.html +++ b/v0.3.x/api/galois.Array.Identity/index.html @@ -7792,14 +7792,14 @@
None
) Self None
) Self
Creates an \(n \times n\) identity matrix.
The size \(n\) along one dimension of the identity matrix.
+The size \(n\) along one dimension of the identity matrix.
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this Array
subclass (the first element in
dtypes
).
None
) Self None
) Self
Creates an array of all ones.
A NumPy-compliant shape
tuple.
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this Array
subclass (the first element in
dtypes
).
()
, low: ElementLike = 0
, high: ElementLike | None = None
, seed: int | Generator | None = None
, dtype: DTypeLike | None = None
) Self ()
, low: ElementLike = 0
, high: ElementLike | None = None
, seed: int | Generator | None = None
, dtype: DTypeLike | None = None
) Self
Creates an array with random elements.
0
¶The smallest element (inclusive). The default is 0.
None
¶The largest element (exclusive). The default is None
which represents order
.
None
¶The largest element (exclusive). The default is None
which represents order
.
None
¶Non-negative integer used to initialize the PRNG. The default is None
which means that
+
None
¶Non-negative integer used to initialize the PRNG. The default is None
which means that
unpredictable entropy will be pulled from the OS to be used as the seed.
A numpy.random.Generator
can also be passed.
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this Array
subclass (the first element in
dtypes
).
1
, dtype: DTypeLike | None = None
) Self 1
, dtype: DTypeLike | None = None
) Self
Creates a 1-D array with a range of elements.
The stopping element (exclusive).
1
¶The increment between elements. The default is 1.
+1
¶The increment between elements. The default is 1.
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this Array
subclass (the first element in
dtypes
).
None
) Self None
) Self
Creates an array of all zeros.
A NumPy-compliant shape
tuple.
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
None
¶The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this Array
subclass (the first element in
dtypes
).
The characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^e\) of the Galois ring \(\mathrm{GR}(p^e, m)\).
"jit-calculate"
mode is slower than "jit-lookup"
.
"python-calculate"
: Uses pure-Python ufuncs with explicit calculation. This is reserved for fields
whose elements cannot be represented with numpy.int64
and instead use numpy.object_
-with Python int
(which has arbitrary precision).
int
(which has arbitrary precision).
The degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\) or Galois ring \(\mathrm{GR}(p^e, m)\).
List of valid integer numpy.dtype
values that are compatible with this Galois field or Galois ring.
The name of the Galois field or Galois ring.
The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^{em}\) of the Galois ring \(\mathrm{GR}(p^e, m)\).
'int'
) Generator[None, None, None] 'int'
) Generator[None, None, None]
Sets the element representation for all arrays from this FieldArray
subclass.
All supported compilation modes of the Galois field or Galois ring.
Creates an \(n \times n\) identity matrix.
Sets the element representation for all arrays from this FieldArray
subclass.
The characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^e\) of the Galois ring \(\mathrm{GR}(p^e, m)\).
The degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\) or Galois ring \(\mathrm{GR}(p^e, m)\).
List of valid integer numpy.dtype
values that are compatible with this Galois field or Galois ring.
The name of the Galois field or Galois ring.
The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^{em}\) of the Galois ring \(\mathrm{GR}(p^e, m)\).
All supported compilation modes of the Galois field or Galois ring.
None
, d: int | None = None
, field: type[FieldArray] | None = None
, extension_field: type[FieldArray] | None = None
, alpha: ElementLike | None = None
, c: int = 1
, systematic: bool = True
)None
, d: int | None = None
, field: type[FieldArray] | None = None
, extension_field: type[FieldArray] | None = None
, alpha: ElementLike | None = None
, c: int = 1
, systematic: bool = True
)
Constructs a general \(\textrm{BCH}(n, k)\) code over \(\mathrm{GF}(q)\).
The codeword size \(n\). If \(n = q^m - 1\), the BCH code is primitive.
+The codeword size \(n\). If \(n = q^m - 1\), the BCH code is primitive.
None
¶The message size \(k\).
+None
¶The message size \(k\).
Important
Either k
or d
must be provided to define the code. Both may be provided as long as they are
@@ -7891,25 +7891,25 @@
None
¶The design distance \(d\). This defines the number of roots \(d - 1\) in the generator +
None
¶The design distance \(d\). This defines the number of roots \(d - 1\) in the generator polynomial \(g(x)\) over \(\mathrm{GF}(q^m)\).
None
¶The Galois field \(\mathrm{GF}(q)\) that defines the alphabet of the codeword symbols. +
None
¶The Galois field \(\mathrm{GF}(q)\) that defines the alphabet of the codeword symbols.
The default is None
which corresponds to \(\mathrm{GF}(2)\).
None
¶The Galois field \(\mathrm{GF}(q^m)\) that defines the syndrome arithmetic. +
None
¶The Galois field \(\mathrm{GF}(q^m)\) that defines the syndrome arithmetic.
The default is None
which corresponds to \(\mathrm{GF}(q^m)\) where
\(q^{m - 1} \le n < q^m\). The default extension field will use matlab_primitive_poly(q, m)
for the irreducible polynomial.
None
¶A primitive \(n\)-th root of unity \(\alpha\) in \(\mathrm{GF}(q^m)\) that defines the +
None
¶A primitive \(n\)-th root of unity \(\alpha\) in \(\mathrm{GF}(q^m)\) that defines the \(\alpha^c, \dots, \alpha^{c+d-2}\) roots of the generator polynomial \(g(x)\).
1
¶The first consecutive power \(c\) of \(\alpha\) that defines the +
1
¶The first consecutive power \(c\) of \(\alpha\) that defines the \(\alpha^c, \dots, \alpha^{c+d-2}\) roots of the generator polynomial \(g(x)\). The default is 1. If \(c = 1\), the BCH code is narrow-sense.
True
¶Indicates if the encoding should be systematic, meaning the codeword is the message with +
True
¶Indicates if the encoding should be systematic, meaning the codeword is the message with
parity appended. The default is True
.
A terse representation of the BCH code.
Examples
Construct a binary primitive \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.__str__/index.html b/v0.3.x/api/galois.BCH.__str__/index.html index 00b6e57ee..f44d7e024 100644 --- a/v0.3.x/api/galois.BCH.__str__/index.html +++ b/v0.3.x/api/galois.BCH.__str__/index.html @@ -7738,7 +7738,7 @@A formatted string with relevant properties of the BCH code.
Examples
Construct a binary primitive \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.c/index.html b/v0.3.x/api/galois.BCH.c/index.html index d07c607be..c7bf007bb 100644 --- a/v0.3.x/api/galois.BCH.c/index.html +++ b/v0.3.x/api/galois.BCH.c/index.html @@ -7738,7 +7738,7 @@The first consecutive power \(c\) of \(\alpha\) that defines the roots \(\alpha^c, \dots, \alpha^{c+d-2}\) of the generator polynomial \(g(x)\).
Examples
diff --git a/v0.3.x/api/galois.BCH.d/index.html b/v0.3.x/api/galois.BCH.d/index.html index 7da318041..768277eb0 100644 --- a/v0.3.x/api/galois.BCH.d/index.html +++ b/v0.3.x/api/galois.BCH.d/index.html @@ -7752,7 +7752,7 @@The minimum distance \(d\) of the \([n, k, d]_q\) code.
Notes
The minimum distance of a BCH code may be greater than the design distance, i.e. \(d_{min} \ge d\).
diff --git a/v0.3.x/api/galois.BCH.decode/index.html b/v0.3.x/api/galois.BCH.decode/index.html index b3938ad28..1353fd380 100644 --- a/v0.3.x/api/galois.BCH.decode/index.html +++ b/v0.3.x/api/galois.BCH.decode/index.html @@ -7836,7 +7836,7 @@'message'
, errors: False = False
) FieldArray 'message'
, errors: True = True
) tuple[galois._fields._array.FieldArray, int | numpy.ndarray] 'message'
, errors: True = True
) tuple[galois._fields._array.FieldArray, int | numpy.ndarray]
Decodes the codeword \(\mathbf{c}\) into the message \(\mathbf{m}\).
Corrupt \(t\) symbols of the codeword.
@@ -7933,12 +7933,12 @@ Out[5]: 2 In [6]: c[0:bch.t] ^= 1; c -Out[6]: GF([1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0], order=2) +Out[6]: GF([0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0], order=2)Decode the codeword and recover the message.
In [7]: d = bch.decode(c); d
-Out[7]: GF([0, 0, 0, 1, 1, 0, 1], order=2)
+Out[7]: GF([1, 1, 0, 0, 1, 0, 0], order=2)
In [8]: np.array_equal(d, m)
Out[8]: True
@@ -7946,7 +7946,7 @@
Decode the codeword, specifying the number of corrected errors, and recover the message.
In [9]: d, e = bch.decode(c, errors=True); d, e
-Out[9]: (GF([0, 0, 0, 1, 1, 0, 1], order=2), 2)
+Out[9]: (GF([1, 1, 0, 0, 1, 0, 0], order=2), 2)
In [10]: np.array_equal(d, m)
Out[10]: True
@@ -7960,10 +7960,10 @@
In [12]: GF = bch.field
In [13]: m = GF.Random(bch.k - 3); m
-Out[13]: GF([0, 1, 0, 0], order=2)
+Out[13]: GF([1, 0, 1, 1], order=2)
In [14]: c = bch.encode(m); c
-Out[14]: GF([0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], order=2)
+Out[14]: GF([1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], order=2)
Corrupt \(t\) symbols of the codeword.
@@ -7971,12 +7971,12 @@ Out[15]: 2 In [16]: c[0:bch.t] ^= 1; c -Out[16]: GF([1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], order=2) +Out[16]: GF([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], order=2)Decode the codeword and recover the message.
In [17]: d = bch.decode(c); d
-Out[17]: GF([0, 1, 0, 0], order=2)
+Out[17]: GF([1, 0, 1, 1], order=2)
In [18]: np.array_equal(d, m)
Out[18]: True
@@ -7984,7 +7984,7 @@
Decode the codeword, specifying the number of corrected errors, and recover the message.
In [19]: d, e = bch.decode(c, errors=True); d, e
-Out[19]: (GF([0, 1, 0, 0], order=2), 2)
+Out[19]: (GF([1, 0, 1, 1], order=2), 2)
In [20]: np.array_equal(d, m)
Out[20]: True
@@ -7999,15 +7999,15 @@
In [23]: m = GF.Random((3, bch.k)); m
Out[23]:
-GF([[1, 1, 0, 1, 1, 0, 0],
- [0, 1, 1, 0, 0, 0, 1],
- [0, 0, 1, 1, 0, 1, 0]], order=2)
+GF([[1, 1, 0, 1, 1, 0, 1],
+ [1, 1, 1, 1, 1, 0, 1],
+ [0, 1, 0, 0, 1, 0, 0]], order=2)
In [24]: c = bch.encode(m); c
Out[24]:
-GF([[1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1],
- [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1],
- [0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0]], order=2)
+GF([[1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0],
+ [1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0],
+ [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]], order=2)
Corrupt the codeword. Add zero errors to the first codeword, one to the second, and two to the @@ -8018,17 +8018,17 @@ In [27]: c Out[27]: -GF([[1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1], - [1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1], - [1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0]], order=2) +GF([[1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], + [0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0], + [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]], order=2)
Decode the codeword and recover the message.
In [28]: d = bch.decode(c); d
Out[28]:
-GF([[1, 1, 0, 1, 1, 0, 0],
- [0, 1, 1, 0, 0, 0, 1],
- [0, 0, 1, 1, 0, 1, 0]], order=2)
+GF([[1, 1, 0, 1, 1, 0, 1],
+ [1, 1, 1, 1, 1, 0, 1],
+ [0, 1, 0, 0, 1, 0, 0]], order=2)
In [29]: np.array_equal(d, m)
Out[29]: True
@@ -8037,9 +8037,9 @@
Decode the codeword, specifying the number of corrected errors, and recover the message.
In [30]: d, e = bch.decode(c, errors=True); d, e
Out[30]:
-(GF([[1, 1, 0, 1, 1, 0, 0],
- [0, 1, 1, 0, 0, 0, 1],
- [0, 0, 1, 1, 0, 1, 0]], order=2),
+(GF([[1, 1, 0, 1, 1, 0, 1],
+ [1, 1, 1, 1, 1, 0, 1],
+ [0, 1, 0, 0, 1, 0, 0]], order=2),
array([0, 1, 2]))
In [31]: np.array_equal(d, m)
@@ -8055,14 +8055,14 @@
In [34]: m = GF.Random((3, bch.k - 3)); m
Out[34]:
-GF([[0, 1, 0, 0],
- [0, 0, 1, 0],
+GF([[0, 0, 0, 0],
+ [1, 0, 1, 1],
[0, 1, 0, 1]], order=2)
In [35]: c = bch.encode(m); c
Out[35]:
-GF([[0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0],
- [0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1],
+GF([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
[0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]], order=2)
@@ -8074,16 +8074,16 @@
In [38]: c
Out[38]:
-GF([[0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0],
- [1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1],
+GF([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]], order=2)
Decode the codeword and recover the message.
In [39]: d = bch.decode(c); d
Out[39]:
-GF([[0, 1, 0, 0],
- [0, 0, 1, 0],
+GF([[0, 0, 0, 0],
+ [1, 0, 1, 1],
[0, 1, 0, 1]], order=2)
In [40]: np.array_equal(d, m)
@@ -8093,8 +8093,8 @@
Decode the codeword, specifying the number of corrected errors, and recover the message.
In [41]: d, e = bch.decode(c, errors=True); d, e
Out[41]:
-(GF([[0, 1, 0, 0],
- [0, 0, 1, 0],
+(GF([[0, 0, 0, 0],
+ [1, 0, 1, 1],
[0, 1, 0, 1]], order=2),
array([0, 1, 2]))
diff --git a/v0.3.x/api/galois.BCH.detect/index.html b/v0.3.x/api/galois.BCH.detect/index.html
index 5bc41465c..b0783c9d5 100644
--- a/v0.3.x/api/galois.BCH.detect/index.html
+++ b/v0.3.x/api/galois.BCH.detect/index.html
@@ -7792,7 +7792,7 @@
-
-galois.BCH.detect(codeword: ArrayLike) bool | numpy.ndarray
+galois.BCH.detect(codeword: ArrayLike) bool | numpy.ndarray
Detects if errors are present in the codeword \(\mathbf{c}\).
- Parameters:¶
@@ -7828,10 +7828,10 @@
In [2]: GF = bch.field
In [3]: m = GF.Random(bch.k); m
-Out[3]: GF([1, 1, 1, 0, 0, 1, 0], order=2)
+Out[3]: GF([0, 0, 1, 0, 0, 0, 0], order=2)
In [4]: c = bch.encode(m); c
-Out[4]: GF([1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1], order=2)
+Out[4]: GF([0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0], order=2)
Detect no errors in the valid codeword.
@@ -7844,7 +7844,7 @@
Out[6]: 5
In [7]: c[0:bch.d - 1] ^= 1; c
-Out[7]: GF([0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1], order=2)
+Out[7]: GF([1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0], order=2)
In [8]: bch.detect(c)
Out[8]: True
@@ -7858,10 +7858,10 @@
In [10]: GF = bch.field
In [11]: m = GF.Random(bch.k - 3); m
-Out[11]: GF([1, 1, 0, 1], order=2)
+Out[11]: GF([0, 0, 1, 0], order=2)
In [12]: c = bch.encode(m); c
-Out[12]: GF([1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0], order=2)
+Out[12]: GF([0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1], order=2)
Detect no errors in the valid codeword.
@@ -7874,7 +7874,7 @@ Out[14]: 5 In [15]: c[0:bch.d - 1] ^= 1; c -Out[15]: GF([0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0], order=2) +Out[15]: GF([1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1], order=2) In [16]: bch.detect(c) Out[16]: True @@ -7889,15 +7889,15 @@ In [19]: m = GF.Random((3, bch.k)); m Out[19]: -GF([[0, 0, 0, 1, 1, 1, 0], - [0, 1, 0, 1, 1, 0, 1], - [1, 1, 1, 1, 0, 1, 1]], order=2) +GF([[1, 0, 1, 0, 1, 1, 0], + [0, 1, 0, 1, 1, 1, 0], + [0, 0, 1, 0, 0, 1, 1]], order=2) In [20]: c = bch.encode(m); c Out[20]: -GF([[0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], - [0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0], - [1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1]], order=2) +GF([[1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1], + [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0]], order=2)Detect no errors in the valid codewords.
@@ -7917,9 +7917,9 @@ In [26]: c Out[26]: -GF([[1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], - [1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0], - [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1]], order=2) +GF([[0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1], + [1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0]], order=2) In [27]: bch.detect(c) Out[27]: array([ True, True, True]) @@ -7934,15 +7934,15 @@ In [30]: m = GF.Random((3, bch.k - 3)); m Out[30]: -GF([[1, 0, 1, 0], - [1, 0, 0, 1], - [1, 1, 1, 1]], order=2) +GF([[1, 1, 0, 0], + [0, 1, 1, 1], + [0, 1, 0, 1]], order=2) In [31]: c = bch.encode(m); c Out[31]: -GF([[1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0], - [1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0], - [1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1]], order=2) +GF([[1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1], + [0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], + [0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]], order=2)Detect no errors in the valid codewords.
@@ -7962,9 +7962,9 @@ In [37]: c Out[37]: -GF([[0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0], - [0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0], - [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1]], order=2) +GF([[0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1], + [1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], + [1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]], order=2) In [38]: bch.detect(c) Out[38]: array([ True, True, True]) diff --git a/v0.3.x/api/galois.BCH.encode/index.html b/v0.3.x/api/galois.BCH.encode/index.html index 3cb9657aa..942c95b23 100644 --- a/v0.3.x/api/galois.BCH.encode/index.html +++ b/v0.3.x/api/galois.BCH.encode/index.html @@ -7885,15 +7885,15 @@ In [2]: GF = bch.field In [3]: m = GF.Random(bch.k); m -Out[3]: GF([1, 1, 1, 1, 0, 0, 0], order=2) +Out[3]: GF([1, 1, 1, 0, 1, 1, 1], order=2) In [4]: c = bch.encode(m); c -Out[4]: GF([1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1], order=2) +Out[4]: GF([1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0], order=2)Compute the parity symbols only.
In [5]: p = bch.encode(m, output="parity"); p
-Out[5]: GF([1, 0, 1, 1, 1, 0, 1, 1], order=2)
+Out[5]: GF([1, 1, 1, 0, 0, 0, 1, 0], order=2)
Compute the parity symbols only.
In [10]: p = bch.encode(m, output="parity"); p
-Out[10]: GF([1, 1, 0, 1, 0, 0, 0, 1], order=2)
+Out[10]: GF([0, 0, 1, 0, 1, 0, 1, 0], order=2)
Compute the parity symbols only.
In [15]: p = bch.encode(m, output="parity"); p
Out[15]:
-GF([[1, 0, 0, 1, 1, 1, 0, 0],
- [0, 1, 0, 1, 1, 1, 1, 0],
- [1, 0, 1, 0, 1, 1, 1, 1]], order=2)
+GF([[1, 1, 0, 1, 0, 1, 0, 1],
+ [1, 0, 1, 0, 1, 1, 1, 1],
+ [1, 1, 0, 0, 1, 1, 1, 1]], order=2)
Compute the parity symbols only.
In [20]: p = bch.encode(m, output="parity"); p
Out[20]:
-GF([[1, 0, 1, 1, 1, 1, 1, 1],
- [1, 1, 0, 1, 0, 0, 0, 1],
- [0, 0, 1, 1, 0, 1, 1, 1]], order=2)
+GF([[0, 1, 0, 1, 1, 0, 0, 1],
+ [0, 0, 0, 1, 1, 1, 0, 1],
+ [0, 1, 1, 0, 1, 1, 1, 0]], order=2)
The Galois field \(\mathrm{GF}(q^m)\) that defines the BCH syndrome arithmetic.
Examples
Construct a binary \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.field/index.html b/v0.3.x/api/galois.BCH.field/index.html index 099a155d4..706224889 100644 --- a/v0.3.x/api/galois.BCH.field/index.html +++ b/v0.3.x/api/galois.BCH.field/index.html @@ -7738,7 +7738,7 @@The Galois field \(\mathrm{GF}(q)\) that defines the codeword alphabet.
Examples
Construct a binary \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.is_narrow_sense/index.html b/v0.3.x/api/galois.BCH.is_narrow_sense/index.html index a4c09f4ec..7ec3f8398 100644 --- a/v0.3.x/api/galois.BCH.is_narrow_sense/index.html +++ b/v0.3.x/api/galois.BCH.is_narrow_sense/index.html @@ -7738,7 +7738,7 @@Indicates if the BCH code is narrow-sense, meaning the roots of the generator polynomial are consecutive powers of \(\alpha\) starting at 1, that is \(\alpha, \dots, \alpha^{d-1}\).
Examples
diff --git a/v0.3.x/api/galois.BCH.is_primitive/index.html b/v0.3.x/api/galois.BCH.is_primitive/index.html index a7a9f7665..0a337fe21 100644 --- a/v0.3.x/api/galois.BCH.is_primitive/index.html +++ b/v0.3.x/api/galois.BCH.is_primitive/index.html @@ -7738,7 +7738,7 @@Indicates if the BCH code is primitive, meaning \(n = q^m - 1\).
Examples
Construct a binary primitive \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.is_systematic/index.html b/v0.3.x/api/galois.BCH.is_systematic/index.html index 1f49555d1..00e0970dd 100644 --- a/v0.3.x/api/galois.BCH.is_systematic/index.html +++ b/v0.3.x/api/galois.BCH.is_systematic/index.html @@ -7738,7 +7738,7 @@Indicates if the code is systematic, meaning the codewords have parity appended to the message.
Examples
Construct a non-primitive \(\textrm{BCH}(13, 4)\) systematic code over \(\mathrm{GF}(3)\).
diff --git a/v0.3.x/api/galois.BCH.k/index.html b/v0.3.x/api/galois.BCH.k/index.html index 929290149..514016e96 100644 --- a/v0.3.x/api/galois.BCH.k/index.html +++ b/v0.3.x/api/galois.BCH.k/index.html @@ -7738,7 +7738,7 @@The message size \(k\) of the \([n, k, d]_q\) code. This is also called the code dimension.
Examples
Construct a binary \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.n/index.html b/v0.3.x/api/galois.BCH.n/index.html index 8a0899bd7..e1e3dc427 100644 --- a/v0.3.x/api/galois.BCH.n/index.html +++ b/v0.3.x/api/galois.BCH.n/index.html @@ -7738,7 +7738,7 @@The codeword size \(n\) of the \([n, k, d]_q\) code. This is also called the code length.
Examples
Construct a binary \(\textrm{BCH}(15, 7)\) code.
diff --git a/v0.3.x/api/galois.BCH.t/index.html b/v0.3.x/api/galois.BCH.t/index.html index 1a552bd11..42968fa5f 100644 --- a/v0.3.x/api/galois.BCH.t/index.html +++ b/v0.3.x/api/galois.BCH.t/index.html @@ -7752,7 +7752,7 @@The error-correcting capability \(t\) of the code.
Notes
The code can correct \(t\) symbol errors in a codeword.
diff --git a/v0.3.x/api/galois.BCH/index.html b/v0.3.x/api/galois.BCH/index.html index 35a37d721..93db9bd77 100644 --- a/v0.3.x/api/galois.BCH/index.html +++ b/v0.3.x/api/galois.BCH/index.html @@ -8063,19 +8063,19 @@Encode a message.
In [3]: m = GF.Random(bch.k); m
-Out[3]: GF([0, 0, 1, 1, 0, 1, 1], order=2)
+Out[3]: GF([1, 0, 0, 0, 1, 1, 1], order=2)
In [4]: c = bch.encode(m); c
-Out[4]: GF([0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1], order=2)
+Out[4]: GF([1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0], order=2)
Corrupt the codeword and decode the message.
# Corrupt the first symbol in the codeword
In [5]: c[0] ^= 1; c
-Out[5]: GF([1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1], order=2)
+Out[5]: GF([0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0], order=2)
In [6]: dec_m = bch.decode(c); dec_m
-Out[6]: GF([0, 0, 1, 1, 0, 1, 1], order=2)
+Out[6]: GF([1, 0, 0, 0, 1, 1, 1], order=2)
In [7]: np.array_equal(dec_m, m)
Out[7]: True
@@ -8083,7 +8083,7 @@
Instruct the decoder to return the number of corrected symbol errors.
In [8]: dec_m, N = bch.decode(c, errors=True); dec_m, N
-Out[8]: (GF([0, 0, 1, 1, 0, 1, 1], order=2), 1)
+Out[8]: (GF([1, 0, 0, 0, 1, 1, 1], order=2), 1)
In [9]: np.array_equal(dec_m, m)
Out[9]: True
@@ -8092,7 +8092,7 @@
Constructors¶
-
-BCH(n: int, k: int | None =
None
, d: int | None = None
, ...)
+BCH(n: int, k: int | None = None
, d: int | None = None
, ...)
Constructs a general \(\textrm{BCH}(n, k)\) code over \(\mathrm{GF}(q)\).
@@ -8101,13 +8101,13 @@ ConstructorsString representation¶
@@ -8118,13 +8118,13 @@ Methods
decode(codeword: ArrayLike, ...) FieldArray
-
-decode(...) tuple[galois._fields._array.FieldArray, int | numpy.ndarray]
+decode(...) tuple[galois._fields._array.FieldArray, int | numpy.ndarray]
Decodes the codeword \(\mathbf{c}\) into the message \(\mathbf{m}\).
-
-detect(codeword: ArrayLike) bool | numpy.ndarray
+detect(codeword: ArrayLike) bool | numpy.ndarray
Detects if errors are present in the codeword \(\mathbf{c}\).
@@ -8139,37 +8139,37 @@ MethodsProperties¶
-
-property extension_field : type[FieldArray]
+property extension_field : type[FieldArray]
The Galois field \(\mathrm{GF}(q^m)\) that defines the BCH syndrome arithmetic.
-
-property field : type[FieldArray]
+property field : type[FieldArray]
The Galois field \(\mathrm{GF}(q)\) that defines the codeword alphabet.
-
-property k : int
+property k : int
The message size \(k\) of the \([n, k, d]_q\) code. This is also called the code dimension.
-
-property n : int
+property n : int
The codeword size \(n\) of the \([n, k, d]_q\) code. This is also called the code length.
@@ -8178,20 +8178,20 @@ PropertiesAttributes¶
-
-property is_narrow_sense : bool
+property is_narrow_sense : bool
Indicates if the BCH code is narrow-sense, meaning the roots of the generator polynomial are consecutive
powers of \(\alpha\) starting at 1, that is \(\alpha, \dots, \alpha^{d-1}\).
-
-property is_primitive : bool
+property is_primitive : bool
Indicates if the BCH code is primitive, meaning \(n = q^m - 1\).
-
-property is_systematic : bool
+property is_systematic : bool
Indicates if the code is systematic, meaning the codewords have parity appended to the message.
@@ -8223,7 +8223,7 @@ Polynomials
-
-property c : int
+property c : int
The first consecutive power \(c\) of \(\alpha\) that defines the roots
\(\alpha^c, \dots, \alpha^{c+d-2}\) of the generator polynomial \(g(x)\).
diff --git a/v0.3.x/api/galois.FLFSR.Taps/index.html b/v0.3.x/api/galois.FLFSR.Taps/index.html
index 0d1e5a1f7..538f39488 100644
--- a/v0.3.x/api/galois.FLFSR.Taps/index.html
+++ b/v0.3.x/api/galois.FLFSR.Taps/index.html
@@ -7806,14 +7806,14 @@
-
-classmethod galois.FLFSR.Taps(taps: FieldArray, state: ArrayLike | None =
None
) Self
+classmethod galois.FLFSR.Taps(taps: FieldArray, state: ArrayLike | None = None
) Self
Constructs a Fibonacci LFSR from its taps \(T = [c_{n-1}, c_{n-2}, \dots, c_1, c_0]\).
- Parameters:¶
- taps: FieldArray¶
The shift register taps \(T = [c_{n-1}, c_{n-2}, \dots, c_1, c_0]\).
-- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
+
- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which corresponds to all ones.
diff --git a/v0.3.x/api/galois.FLFSR.__init__/index.html b/v0.3.x/api/galois.FLFSR.__init__/index.html
index 5e2498753..0c92e2453 100644
--- a/v0.3.x/api/galois.FLFSR.__init__/index.html
+++ b/v0.3.x/api/galois.FLFSR.__init__/index.html
@@ -7792,7 +7792,7 @@
-
-galois.FLFSR(feedback_poly: Poly, state: ArrayLike | None =
None
)
+galois.FLFSR(feedback_poly: Poly, state: ArrayLike | None = None
)
Constructs a Fibonacci LFSR from its feedback polynomial \(f(x)\).
- Parameters:¶
@@ -7800,7 +7800,7 @@
- feedback_poly: Poly¶
The feedback polynomial
\(f(x) = -c_{0}x^{n} - c_{1}x^{n-1} - \dots - c_{n-2}x^{2} - c_{n-1}x + 1\).
-- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
+
- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which corresponds to all ones.
diff --git a/v0.3.x/api/galois.FLFSR.__repr__/index.html b/v0.3.x/api/galois.FLFSR.__repr__/index.html
index 61b91a862..5bd04e948 100644
--- a/v0.3.x/api/galois.FLFSR.__repr__/index.html
+++ b/v0.3.x/api/galois.FLFSR.__repr__/index.html
@@ -7738,7 +7738,7 @@
-
-galois.FLFSR.__repr__() str
+galois.FLFSR.__repr__() str
A terse representation of the Fibonacci LFSR.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.FLFSR.__str__/index.html b/v0.3.x/api/galois.FLFSR.__str__/index.html
index ca1c63fbc..30baf521d 100644
--- a/v0.3.x/api/galois.FLFSR.__str__/index.html
+++ b/v0.3.x/api/galois.FLFSR.__str__/index.html
@@ -7738,7 +7738,7 @@
-
-galois.FLFSR.__str__() str
+galois.FLFSR.__str__() str
A formatted string of relevant properties of the Fibonacci LFSR.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.FLFSR.field/index.html b/v0.3.x/api/galois.FLFSR.field/index.html
index 2a910d164..4b527862a 100644
--- a/v0.3.x/api/galois.FLFSR.field/index.html
+++ b/v0.3.x/api/galois.FLFSR.field/index.html
@@ -7738,7 +7738,7 @@
-
-property galois.FLFSR.field : type[FieldArray]
+property galois.FLFSR.field : type[FieldArray]
The FieldArray
subclass for the finite field that defines the linear arithmetic.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.FLFSR.order/index.html b/v0.3.x/api/galois.FLFSR.order/index.html
index 2261209f8..665cf8205 100644
--- a/v0.3.x/api/galois.FLFSR.order/index.html
+++ b/v0.3.x/api/galois.FLFSR.order/index.html
@@ -7688,7 +7688,7 @@
-
-property galois.FLFSR.order : int
+property galois.FLFSR.order : int
The order of the linear recurrence/linear recurrent sequence. The order of a sequence is defined by the
degree of the minimal polynomial that produces it.
diff --git a/v0.3.x/api/galois.FLFSR.reset/index.html b/v0.3.x/api/galois.FLFSR.reset/index.html
index d43dcc04c..17ac17777 100644
--- a/v0.3.x/api/galois.FLFSR.reset/index.html
+++ b/v0.3.x/api/galois.FLFSR.reset/index.html
@@ -7778,12 +7778,12 @@
-
-galois.FLFSR.reset(state: ArrayLike | None =
None
)
+galois.FLFSR.reset(state: ArrayLike | None = None
)
Resets the Fibonacci LFSR state to the specified state.
- Parameters:¶
-- state: ArrayLike | None =
None
¶ The state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which
+
- state: ArrayLike | None =
None
¶ The state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which
corresponds to the initial state.
diff --git a/v0.3.x/api/galois.FLFSR.step/index.html b/v0.3.x/api/galois.FLFSR.step/index.html
index 4f6cf1c62..d95f05e81 100644
--- a/v0.3.x/api/galois.FLFSR.step/index.html
+++ b/v0.3.x/api/galois.FLFSR.step/index.html
@@ -7792,12 +7792,12 @@
-
-galois.FLFSR.step(steps: int =
1
) FieldArray
+galois.FLFSR.step(steps: int = 1
) FieldArray
Produces the next steps
output symbols.
- Parameters:¶
-
diff --git a/v0.3.x/api/galois.FLFSR/index.html b/v0.3.x/api/galois.FLFSR/index.html
index c25a5790d..a6f551ccc 100644
--- a/v0.3.x/api/galois.FLFSR/index.html
+++ b/v0.3.x/api/galois.FLFSR/index.html
@@ -8167,7 +8167,7 @@
Constructors¶
-
-FLFSR(feedback_poly: Poly, state: ArrayLike | None =
None
)
+FLFSR(feedback_poly: Poly, state: ArrayLike | None = None
)
Constructs a Fibonacci LFSR from its feedback polynomial \(f(x)\).
@@ -8182,13 +8182,13 @@
String representation¶
@@ -8197,13 +8197,13 @@ String representationMethods¶
-
-reset(state: ArrayLike | None =
None
)
+reset(state: ArrayLike | None = None
)
Resets the Fibonacci LFSR state to the specified state.
-
-step(steps: int =
1
) FieldArray
+step(steps: int = 1
) FieldArray
Produces the next steps
output symbols.
@@ -8218,13 +8218,13 @@ MethodsProperties¶
-
-property field : type[FieldArray]
+property field : type[FieldArray]
The FieldArray
subclass for the finite field that defines the linear arithmetic.
-
-property order : int
+property order : int
The order of the linear recurrence/linear recurrent sequence. The order of a sequence is defined by the
degree of the minimal polynomial that produces it.
diff --git a/v0.3.x/api/galois.Field/index.html b/v0.3.x/api/galois.Field/index.html
index a19adf6a8..cd8343740 100644
--- a/v0.3.x/api/galois.Field/index.html
+++ b/v0.3.x/api/galois.Field/index.html
@@ -7684,9 +7684,9 @@
-
-galois.Field(order: int, *, irreducible_poly: PolyLike | None =
None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
+galois.Field(order: int, *, irreducible_poly: PolyLike | None = None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
-
-galois.Field(characteristic: int, degree: int, *, irreducible_poly: PolyLike | None =
None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
+galois.Field(characteristic: int, degree: int, *, irreducible_poly: PolyLike | None = None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
Alias of GF()
.
diff --git a/v0.3.x/api/galois.FieldArray.Identity/index.html b/v0.3.x/api/galois.FieldArray.Identity/index.html
index 8ec55fa3a..7286fb1c0 100644
--- a/v0.3.x/api/galois.FieldArray.Identity/index.html
+++ b/v0.3.x/api/galois.FieldArray.Identity/index.html
@@ -7806,14 +7806,14 @@
-
-classmethod galois.FieldArray.Identity(size: int, dtype: DTypeLike | None =
None
) Self
+classmethod galois.FieldArray.Identity(size: int, dtype: DTypeLike | None = None
) Self
Creates an \(n \times n\) identity matrix.
- Parameters:¶
-- size: int¶
The size \(n\) along one dimension of the identity matrix.
+- size: int¶
The size \(n\) along one dimension of the identity matrix.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.Ones/index.html b/v0.3.x/api/galois.FieldArray.Ones/index.html
index c46503c9a..c11f66151 100644
--- a/v0.3.x/api/galois.FieldArray.Ones/index.html
+++ b/v0.3.x/api/galois.FieldArray.Ones/index.html
@@ -7806,14 +7806,14 @@
-
-classmethod galois.FieldArray.Ones(shape: ShapeLike, dtype: DTypeLike | None =
None
) Self
+classmethod galois.FieldArray.Ones(shape: ShapeLike, dtype: DTypeLike | None = None
) Self
Creates an array of all ones.
- Parameters:¶
- shape: ShapeLike¶
A NumPy-compliant shape
tuple.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.Random/index.html b/v0.3.x/api/galois.FieldArray.Random/index.html
index 4cf7db52d..cd9c98425 100644
--- a/v0.3.x/api/galois.FieldArray.Random/index.html
+++ b/v0.3.x/api/galois.FieldArray.Random/index.html
@@ -7848,7 +7848,7 @@
-
-classmethod galois.FieldArray.Random(shape: ShapeLike =
()
, low: ElementLike = 0
, high: ElementLike | None = None
, seed: int | Generator | None = None
, dtype: DTypeLike | None = None
) Self
+classmethod galois.FieldArray.Random(shape: ShapeLike = ()
, low: ElementLike = 0
, high: ElementLike | None = None
, seed: int | Generator | None = None
, dtype: DTypeLike | None = None
) Self
Creates an array with random elements.
- Parameters:¶
@@ -7857,13 +7857,13 @@
- low: ElementLike =
0
¶ The smallest element (inclusive). The default is 0.
-- high: ElementLike | None =
None
¶ The largest element (exclusive). The default is None
which represents order
.
+- high: ElementLike | None =
None
¶ The largest element (exclusive). The default is None
which represents order
.
-- seed: int | Generator | None =
None
¶ Non-negative integer used to initialize the PRNG. The default is None
which means that
+
- seed: int | Generator | None =
None
¶ Non-negative integer used to initialize the PRNG. The default is None
which means that
unpredictable entropy will be pulled from the OS to be used as the seed.
A numpy.random.Generator
can also be passed.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
@@ -7879,8 +7879,8 @@
In [2]: GF.Random((2, 5))
Out[2]:
-GF([[18, 30, 16, 10, 21],
- [ 9, 22, 26, 5, 30]], order=31)
+GF([[ 1, 27, 15, 18, 25],
+ [29, 8, 19, 11, 25]], order=31)
Generate a random array with a specified seed. This produces repeatable outputs.
diff --git a/v0.3.x/api/galois.FieldArray.Range/index.html b/v0.3.x/api/galois.FieldArray.Range/index.html
index 3fb22fc31..bf4fa1bc1 100644
--- a/v0.3.x/api/galois.FieldArray.Range/index.html
+++ b/v0.3.x/api/galois.FieldArray.Range/index.html
@@ -7834,7 +7834,7 @@
-
-classmethod galois.FieldArray.Range(start: ElementLike, stop: ElementLike, step: int =
1
, dtype: DTypeLike | None = None
) Self
+classmethod galois.FieldArray.Range(start: ElementLike, stop: ElementLike, step: int = 1
, dtype: DTypeLike | None = None
) Self
Creates a 1-D array with a range of elements.
- Parameters:¶
@@ -7843,9 +7843,9 @@
- stop: ElementLike¶
The stopping element (exclusive).
-- step: int =
1
¶ The increment between elements. The default is 1.
+- step: int =
1
¶ The increment between elements. The default is 1.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.Vandermonde/index.html b/v0.3.x/api/galois.FieldArray.Vandermonde/index.html
index a8edf325a..22d32de8f 100644
--- a/v0.3.x/api/galois.FieldArray.Vandermonde/index.html
+++ b/v0.3.x/api/galois.FieldArray.Vandermonde/index.html
@@ -7834,18 +7834,18 @@
-
-classmethod galois.FieldArray.Vandermonde(element: ElementLike, rows: int, cols: int, dtype: DTypeLike | None =
None
) Self
+classmethod galois.FieldArray.Vandermonde(element: ElementLike, rows: int, cols: int, dtype: DTypeLike | None = None
) Self
Creates an \(m \times n\) Vandermonde matrix of \(a \in \mathrm{GF}(q)\).
- Parameters:¶
- element: ElementLike¶
An element \(a\) of \(\mathrm{GF}(q)\).
-- rows: int¶
The number of rows \(m\) in the Vandermonde matrix.
+- rows: int¶
The number of rows \(m\) in the Vandermonde matrix.
-- cols: int¶
The number of columns \(n\) in the Vandermonde matrix.
+- cols: int¶
The number of columns \(n\) in the Vandermonde matrix.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.Vector/index.html b/v0.3.x/api/galois.FieldArray.Vector/index.html
index 3c849c0e9..80e70a263 100644
--- a/v0.3.x/api/galois.FieldArray.Vector/index.html
+++ b/v0.3.x/api/galois.FieldArray.Vector/index.html
@@ -7820,7 +7820,7 @@
-
-classmethod galois.FieldArray.Vector(array: ArrayLike, dtype: DTypeLike | None =
None
) FieldArray
+classmethod galois.FieldArray.Vector(array: ArrayLike, dtype: DTypeLike | None = None
) FieldArray
Converts length-\(m\) vectors over the prime subfield \(\mathrm{GF}(p)\) to an array
over \(\mathrm{GF}(p^m)\).
@@ -7830,7 +7830,7 @@
(n1, n2, m)
has output shape (n1, n2)
. By convention, the vectors are ordered from degree
\(m-1\) to degree 0.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.Zeros/index.html b/v0.3.x/api/galois.FieldArray.Zeros/index.html
index 5af02da89..bc0b77d57 100644
--- a/v0.3.x/api/galois.FieldArray.Zeros/index.html
+++ b/v0.3.x/api/galois.FieldArray.Zeros/index.html
@@ -7806,14 +7806,14 @@
-
-classmethod galois.FieldArray.Zeros(shape: ShapeLike, dtype: DTypeLike | None =
None
) Self
+classmethod galois.FieldArray.Zeros(shape: ShapeLike, dtype: DTypeLike | None = None
) Self
Creates an array of all zeros.
- Parameters:¶
- shape: ShapeLike¶
A NumPy-compliant shape
tuple.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray.__init__/index.html b/v0.3.x/api/galois.FieldArray.__init__/index.html
index ebc3d10c5..1630740d9 100644
--- a/v0.3.x/api/galois.FieldArray.__init__/index.html
+++ b/v0.3.x/api/galois.FieldArray.__init__/index.html
@@ -7834,22 +7834,22 @@
-
-galois.FieldArray(x: ElementLike | ArrayLike, dtype: DTypeLike | None =
None
, copy: bool = True
, order: 'K' | 'A' | 'C' | 'F' = 'K'
, ndmin: int = 0
)
+galois.FieldArray(x: ElementLike | ArrayLike, dtype: DTypeLike | None = None
, copy: bool = True
, order: 'K' | 'A' | 'C' | 'F' = 'K'
, ndmin: int = 0
)
Creates an array over \(\mathrm{GF}(p^m)\).
- Parameters:¶
- x: ElementLike | ArrayLike¶
A finite field scalar or array.
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
-- copy: bool =
True
¶ The copy
keyword argument from numpy.array()
. The default is True
.
+- copy: bool =
True
¶ The copy
keyword argument from numpy.array()
. The default is True
.
- order: 'K' | 'A' | 'C' | 'F' =
'K'
¶ The order
keyword argument from numpy.array()
. The default is "K"
.
-- ndmin: int =
0
¶ The ndmin
keyword argument from numpy.array()
. The default is 0.
+- ndmin: int =
0
¶ The ndmin
keyword argument from numpy.array()
. The default is 0.
diff --git a/v0.3.x/api/galois.FieldArray.__repr__/index.html b/v0.3.x/api/galois.FieldArray.__repr__/index.html
index f898baf9a..e399bcb5f 100644
--- a/v0.3.x/api/galois.FieldArray.__repr__/index.html
+++ b/v0.3.x/api/galois.FieldArray.__repr__/index.html
@@ -7752,7 +7752,7 @@
-
-galois.FieldArray.__repr__() str
+galois.FieldArray.__repr__() str
Displays the array specifying the class and finite field order.
Notes
This function prepends GF(
and appends , order=p^m)
.
diff --git a/v0.3.x/api/galois.FieldArray.__str__/index.html b/v0.3.x/api/galois.FieldArray.__str__/index.html
index 13ad9435e..bcc7c8654 100644
--- a/v0.3.x/api/galois.FieldArray.__str__/index.html
+++ b/v0.3.x/api/galois.FieldArray.__str__/index.html
@@ -7752,7 +7752,7 @@
-
-galois.FieldArray.__str__() str
+galois.FieldArray.__str__() str
Displays the array without specifying the class or finite field order.
Notes
This function does not prepend GF(
and or append , order=p^m)
. It also omits the comma separators.
diff --git a/v0.3.x/api/galois.FieldArray.additive_order/index.html b/v0.3.x/api/galois.FieldArray.additive_order/index.html
index d8980d651..998ce28a9 100644
--- a/v0.3.x/api/galois.FieldArray.additive_order/index.html
+++ b/v0.3.x/api/galois.FieldArray.additive_order/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.additive_order() int | numpy.ndarray
+galois.FieldArray.additive_order() int | numpy.ndarray
Computes the additive order of each element in \(x\).
- Returns:¶
diff --git a/v0.3.x/api/galois.FieldArray.arithmetic_table/index.html b/v0.3.x/api/galois.FieldArray.arithmetic_table/index.html
index bbf96f1c9..08f19ccdd 100644
--- a/v0.3.x/api/galois.FieldArray.arithmetic_table/index.html
+++ b/v0.3.x/api/galois.FieldArray.arithmetic_table/index.html
@@ -7820,17 +7820,17 @@
-
-classmethod galois.FieldArray.arithmetic_table(operation: '+' | '-' | '*' | '/', x: galois._fields._array.FieldArray | None =
None
, y: galois._fields._array.FieldArray | None = None
) str
+classmethod galois.FieldArray.arithmetic_table(operation: '+' | '-' | '*' | '/', x: galois._fields._array.FieldArray | None = None
, y: galois._fields._array.FieldArray | None = None
) str
Generates the specified arithmetic table for the finite field.
- Parameters:¶
- operation: '+' | '-' | '*' | '/'¶
The arithmetic operation.
-- x: galois._fields._array.FieldArray | None =
None
¶ Optionally specify the \(x\) values for the arithmetic table. The default is None
+
- x: galois._fields._array.FieldArray | None =
None
¶ Optionally specify the \(x\) values for the arithmetic table. The default is None
which represents \(\{0, \dots, p^m - 1\}\).
-- y: galois._fields._array.FieldArray | None =
None
¶ Optionally specify the \(y\) values for the arithmetic table. The default is None
+
- y: galois._fields._array.FieldArray | None =
None
¶ Optionally specify the \(y\) values for the arithmetic table. The default is None
which represents \(\{0, \dots, p^m - 1\}\) for addition, subtraction, and multiplication and
\(\{1, \dots, p^m - 1\}\) for division.
diff --git a/v0.3.x/api/galois.FieldArray.characteristic/index.html b/v0.3.x/api/galois.FieldArray.characteristic/index.html
index 79260dd75..5b9bcd17e 100644
--- a/v0.3.x/api/galois.FieldArray.characteristic/index.html
+++ b/v0.3.x/api/galois.FieldArray.characteristic/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.characteristic : int
+class property galois.FieldArray.characteristic : int
The prime characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\).
Notes
Adding \(p\) copies of any element will always result in 0.
diff --git a/v0.3.x/api/galois.FieldArray.characteristic_poly/index.html b/v0.3.x/api/galois.FieldArray.characteristic_poly/index.html
index 02f1040a8..35fe84352 100644
--- a/v0.3.x/api/galois.FieldArray.characteristic_poly/index.html
+++ b/v0.3.x/api/galois.FieldArray.characteristic_poly/index.html
@@ -7804,7 +7804,7 @@
polynomial \(c_A(x)\) of \(\mathbf{A}\) over \(\mathrm{GF}(p^m)\).
- Raises:¶
-ValueError – If the array is not a single finite field element (scalar 0-D array) or a square
+
ValueError – If the array is not a single finite field element (scalar 0-D array) or a square
\(n \times n\) matrix (2-D array).
@@ -7835,10 +7835,10 @@
In [1]: GF = galois.GF(3**5)
In [2]: a = GF.Random(); a
-Out[2]: GF(204, order=3^5)
+Out[2]: GF(105, order=3^5)
In [3]: poly = a.characteristic_poly(); poly
-Out[3]: Poly(x^5 + x^4 + x^2 + 1, GF(3))
+Out[3]: Poly(x^5 + 2x^4 + 2x^3 + 2, GF(3))
# The characteristic polynomial annihilates a
In [4]: poly(a, field=GF)
@@ -7850,10 +7850,10 @@
In [5]: GF = galois.GF(3**5, repr="poly")
In [6]: a = GF.Random(); a
-Out[6]: GF(2α^4 + 2α, order=3^5)
+Out[6]: GF(2α^4 + α^3 + 2α^2 + α + 2, order=3^5)
In [7]: poly = a.characteristic_poly(); poly
-Out[7]: Poly(x^5 + x^4 + 2x^3 + 1, GF(3))
+Out[7]: Poly(x^5 + x^3 + 2x^2 + 1, GF(3))
# The characteristic polynomial annihilates a
In [8]: poly(a, field=GF)
@@ -7865,10 +7865,10 @@
In [9]: GF = galois.GF(3**5, repr="power")
In [10]: a = GF.Random(); a
-Out[10]: GF(α^228, order=3^5)
+Out[10]: GF(α^225, order=3^5)
In [11]: poly = a.characteristic_poly(); poly
-Out[11]: Poly(x^5 + 2x^4 + x^3 + 2x^2 + 2x + 2, GF(3))
+Out[11]: Poly(x^5 + x^3 + 2x^2 + 2x + 1, GF(3))
# The characteristic polynomial annihilates a
In [12]: poly(a, field=GF)
@@ -7890,12 +7890,12 @@
In [14]: A = GF.Random((3,3)); A
Out[14]:
-GF([[185, 194, 118],
- [177, 228, 226],
- [ 76, 35, 135]], order=3^5)
+GF([[ 27, 13, 217],
+ [154, 140, 80],
+ [190, 102, 192]], order=3^5)
In [15]: poly = A.characteristic_poly(); poly
-Out[15]: Poly(x^3 + 139x^2 + 4x + 240, GF(3^5))
+Out[15]: Poly(x^3 + 58x^2 + 232x + 13, GF(3^5))
# The x^0 coefficient is det(-A)
In [16]: poly.coeffs[-1] == np.linalg.det(-A)
@@ -7919,15 +7919,13 @@
In [20]: A = GF.Random((3,3)); A
Out[20]:
-GF([[2α^4 + 2α^3 + 2α^2 + 2α + 1, α^4 + 2α^3 + 2α^2 + 2,
- 2α^3 + 2α^2 + α],
- [ α^4 + α^3 + 2α^2 + 2, α + 2,
- α^2 + 1],
- [ 2α^3 + 2α^2 + 2α + 1, α^4 + α^2 + 1,
- 2α^4 + α^2 + 2]], order=3^5)
+GF([[α^4 + 2α^3 + 2α^2 + 2, 2α^3 + α^2 + 2, 2α^3 + α^2 + α + 2],
+ [ α^4 + α^3 + 2α^2, 2α^3 + α^2, α^3 + α],
+ [ α^4 + 2α + 1, α^4 + α^3 + 2α + 1, α^4 + α^3 + α^2 + 2α]],
+ order=3^5)
In [21]: poly = A.characteristic_poly(); poly
-Out[21]: Poly(x^3 + (2α^4 + α^3 + 1)x^2 + (α^4 + 2α^2 + 2α + 1)x + (α^4 + α^3 + α^2 + 2α), GF(3^5))
+Out[21]: Poly(x^3 + (α^4 + α^3 + 2α^2 + α + 1)x^2 + (α^2 + α + 2)x + (α^4 + α^3 + 2α^2 + 2α), GF(3^5))
# The x^0 coefficient is det(-A)
In [22]: poly.coeffs[-1] == np.linalg.det(-A)
@@ -7951,12 +7949,12 @@
In [26]: A = GF.Random((3,3)); A
Out[26]:
-GF([[α^238, α^56, α^160],
- [α^204, α^62, α^214],
- [α^122, α^193, α^171]], order=3^5)
+GF([[ α^38, α^196, α^149],
+ [ α^61, α^101, α^31],
+ [α^139, α^32, α^233]], order=3^5)
In [27]: poly = A.characteristic_poly(); poly
-Out[27]: Poly(x^3 + (α^57)x^2 + (α^44)x + α^234, GF(3^5))
+Out[27]: Poly(x^3 + (α^64)x^2 + (α^212)x + α^37, GF(3^5))
# The x^0 coefficient is det(-A)
In [28]: poly.coeffs[-1] == np.linalg.det(-A)
diff --git a/v0.3.x/api/galois.FieldArray.column_space/index.html b/v0.3.x/api/galois.FieldArray.column_space/index.html
index 01588fb3f..b0f9b895a 100644
--- a/v0.3.x/api/galois.FieldArray.column_space/index.html
+++ b/v0.3.x/api/galois.FieldArray.column_space/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.column_space() Self
+galois.FieldArray.column_space() Self
Computes the column space of the matrix \(\mathbf{A}\).
- Returns:¶
@@ -7790,9 +7790,9 @@
In [3]: A = GF.Random((m, n)); A
Out[3]:
-GF([[ 9, 15, 16, 30, 17],
- [17, 22, 24, 24, 4],
- [ 9, 28, 1, 8, 15]], order=31)
+GF([[24, 14, 29, 29, 0],
+ [ 7, 9, 8, 5, 4],
+ [ 6, 26, 15, 11, 17]], order=31)
In [4]: C = A.column_space(); C
Out[4]:
@@ -7804,8 +7804,8 @@
The dimension of the column space and null space sum to \(n\).
In [5]: N = A.null_space(); N
Out[5]:
-GF([[ 1, 0, 25, 29, 5],
- [ 0, 1, 18, 28, 13]], order=31)
+GF([[ 1, 0, 16, 27, 10],
+ [ 0, 1, 9, 29, 21]], order=31)
In [6]: C.shape[0] + N.shape[0] == n
Out[6]: True
diff --git a/v0.3.x/api/galois.FieldArray.compile/index.html b/v0.3.x/api/galois.FieldArray.compile/index.html
index d176f46c0..8c71fbf83 100644
--- a/v0.3.x/api/galois.FieldArray.compile/index.html
+++ b/v0.3.x/api/galois.FieldArray.compile/index.html
@@ -7783,7 +7783,7 @@
the "jit-calculate"
mode is slower than "jit-lookup"
.
"python-calculate"
: Uses pure-Python ufuncs with explicit calculation. This is reserved for fields
whose elements cannot be represented with numpy.int64
and instead use numpy.object_
-with Python int
(which has arbitrary precision).
+with Python int
(which has arbitrary precision).
diff --git a/v0.3.x/api/galois.FieldArray.degree/index.html b/v0.3.x/api/galois.FieldArray.degree/index.html
index 8673a591b..9ca7c0069 100644
--- a/v0.3.x/api/galois.FieldArray.degree/index.html
+++ b/v0.3.x/api/galois.FieldArray.degree/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.degree : int
+class property galois.FieldArray.degree : int
The extension degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\).
Notes
The degree is a positive integer. For prime fields, the degree is 1.
diff --git a/v0.3.x/api/galois.FieldArray.dtypes/index.html b/v0.3.x/api/galois.FieldArray.dtypes/index.html
index cf39e0c9c..9b6b187a4 100644
--- a/v0.3.x/api/galois.FieldArray.dtypes/index.html
+++ b/v0.3.x/api/galois.FieldArray.dtypes/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.dtypes : list[numpy.dtype]
+class property galois.FieldArray.dtypes : list[numpy.dtype]
List of valid integer numpy.dtype
values that are compatible with this finite field.
Notes
Creating an array with an unsupported dtype will raise a TypeError
exception.
@@ -7778,7 +7778,7 @@
Out[2]: [numpy.uint16, numpy.uint32, numpy.int16, numpy.int32, numpy.int64]
-Large fields must use numpy.object_
which uses Python int
for its unlimited size.
+Large fields must use numpy.object_
which uses Python int
for its unlimited size.
In [3]: GF = galois.GF(2**100); GF.dtypes
Out[3]: [numpy.object_]
diff --git a/v0.3.x/api/galois.FieldArray.is_extension_field/index.html b/v0.3.x/api/galois.FieldArray.is_extension_field/index.html
index 25fa5752c..445cc914a 100644
--- a/v0.3.x/api/galois.FieldArray.is_extension_field/index.html
+++ b/v0.3.x/api/galois.FieldArray.is_extension_field/index.html
@@ -7738,7 +7738,7 @@
-
-class property galois.FieldArray.is_extension_field : bool
+class property galois.FieldArray.is_extension_field : bool
Indicates if the finite field is an extension field, having prime power order.
Examples
In [1]: galois.GF(2).is_extension_field
diff --git a/v0.3.x/api/galois.FieldArray.is_prime_field/index.html b/v0.3.x/api/galois.FieldArray.is_prime_field/index.html
index fd5e3b417..d6146d48e 100644
--- a/v0.3.x/api/galois.FieldArray.is_prime_field/index.html
+++ b/v0.3.x/api/galois.FieldArray.is_prime_field/index.html
@@ -7738,7 +7738,7 @@
-
-class property galois.FieldArray.is_prime_field : bool
+class property galois.FieldArray.is_prime_field : bool
Indicates if the finite field is a prime field, having prime order.
Examples
In [1]: galois.GF(2).is_prime_field
diff --git a/v0.3.x/api/galois.FieldArray.is_primitive_poly/index.html b/v0.3.x/api/galois.FieldArray.is_primitive_poly/index.html
index a6d971523..48949b981 100644
--- a/v0.3.x/api/galois.FieldArray.is_primitive_poly/index.html
+++ b/v0.3.x/api/galois.FieldArray.is_primitive_poly/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.is_primitive_poly : bool
+class property galois.FieldArray.is_primitive_poly : bool
Indicates whether the irreducible_poly
is a primitive polynomial.
Notes
If the irreducible polynomial is primitive, then \(x\) is a primitive element of the finite field.
diff --git a/v0.3.x/api/galois.FieldArray.is_square/index.html b/v0.3.x/api/galois.FieldArray.is_square/index.html
index 4942e01bc..bdb6c6918 100644
--- a/v0.3.x/api/galois.FieldArray.is_square/index.html
+++ b/v0.3.x/api/galois.FieldArray.is_square/index.html
@@ -7780,7 +7780,7 @@
-
-galois.FieldArray.is_square() bool | numpy.ndarray
+galois.FieldArray.is_square() bool | numpy.ndarray
Determines if the elements of \(x\) are squares in the finite field.
- Returns:¶
diff --git a/v0.3.x/api/galois.FieldArray.left_null_space/index.html b/v0.3.x/api/galois.FieldArray.left_null_space/index.html
index c880f5ea0..ea865a9fe 100644
--- a/v0.3.x/api/galois.FieldArray.left_null_space/index.html
+++ b/v0.3.x/api/galois.FieldArray.left_null_space/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.left_null_space() Self
+galois.FieldArray.left_null_space() Self
Computes the left null space of the matrix \(\mathbf{A}\).
- Returns:¶
@@ -7789,16 +7789,16 @@
In [3]: A = GF.Random((m, n)); A
Out[3]:
-GF([[ 1, 3, 27],
- [22, 13, 1],
- [12, 3, 22],
- [17, 4, 7],
- [ 1, 17, 3]], order=31)
+GF([[ 7, 27, 8],
+ [27, 2, 10],
+ [ 7, 14, 7],
+ [23, 1, 29],
+ [ 5, 13, 30]], order=31)
In [4]: LN = A.left_null_space(); LN
Out[4]:
-GF([[ 1, 0, 6, 24, 15],
- [ 0, 1, 21, 1, 19]], order=31)
+GF([[ 1, 0, 19, 28, 23],
+ [ 0, 1, 15, 10, 2]], order=31)
The left null space is the set of vectors that sum the rows to 0.
diff --git a/v0.3.x/api/galois.FieldArray.log/index.html b/v0.3.x/api/galois.FieldArray.log/index.html
index 1e8baa23c..c586a9103 100644
--- a/v0.3.x/api/galois.FieldArray.log/index.html
+++ b/v0.3.x/api/galois.FieldArray.log/index.html
@@ -7792,12 +7792,12 @@
-
-galois.FieldArray.log(base: ElementLike | ArrayLike | None =
None
) int | ndarray
+galois.FieldArray.log(base: ElementLike | ArrayLike | None = None
) int | ndarray
Computes the discrete logarithm of the array \(x\) base \(\beta\).
- Parameters:¶
-- base: ElementLike | ArrayLike | None =
None
¶ A primitive element or elements \(\beta\) of the finite field that is the base of the logarithm.
+
- base: ElementLike | ArrayLike | None =
None
¶ A primitive element or elements \(\beta\) of the finite field that is the base of the logarithm.
The default is None
which uses primitive_element
.
Slower performance
@@ -7831,10 +7831,10 @@
Out[2]: GF(3, order=3^5)
In [3]: x = GF.Random(10, low=1); x
-Out[3]: GF([160, 65, 219, 100, 189, 191, 163, 110, 99, 32], order=3^5)
+Out[3]: GF([ 52, 238, 29, 83, 6, 242, 148, 79, 41, 84], order=3^5)
In [4]: i = x.log(); i
-Out[4]: array([184, 233, 110, 92, 129, 220, 241, 119, 76, 49])
+Out[4]: array([ 79, 186, 15, 120, 122, 185, 54, 95, 216, 208])
In [5]: np.array_equal(alpha ** i, x)
Out[5]: True
@@ -7849,13 +7849,14 @@
In [8]: x = GF.Random(10, low=1); x
Out[8]:
-GF([ 2α^4 + 2α^2 + 1, α^4 + 2α^3 + α^2 + 2α, α^4 + α^2 + 2α + 1,
- 2α^4 + α^3 + 2α^2, 2α^3 + 2α, 2α^4 + α,
- 2α^4 + 2α, α + 2, α^3,
- α^4 + 2α^2 + 1], order=3^5)
+GF([ α^4 + α + 2, 2α^2 + 2,
+ 2α^4 + 2α^3, 2α^4 + α^2 + α + 1,
+ α^4 + 2α^3 + 2, α^4 + 2α^3 + α^2 + α + 2,
+ α^4 + 2α^3 + α + 2, 2α,
+ 2α^3 + α^2 + α, α^4 + 2], order=3^5)
In [9]: i = x.log(); i
-Out[9]: array([135, 52, 159, 19, 168, 137, 87, 5, 3, 92])
+Out[9]: array([ 73, 167, 193, 226, 67, 32, 212, 122, 102, 120])
In [10]: np.array_equal(alpha ** i, x)
Out[10]: True
@@ -7870,11 +7871,11 @@
In [13]: x = GF.Random(10, low=1); x
Out[13]:
-GF([α^187, α^58, α^9, α^90, α^11, α^70, α^75, α^26, α^95, α^210],
+GF([α^165, α^117, α^31, α^183, α^144, α^65, α^163, α^159, α^176, α^72],
order=3^5)
In [14]: i = x.log(); i
-Out[14]: array([187, 58, 9, 90, 11, 70, 75, 26, 95, 210])
+Out[14]: array([165, 117, 31, 183, 144, 65, 163, 159, 176, 72])
In [15]: np.array_equal(alpha ** i, x)
Out[15]: True
@@ -7901,7 +7902,7 @@
Out[17]: GF(242, order=3^5)
In [18]: i = x.log(beta); i
-Out[18]: array([209, 224, 89, 164, 55, 20, 177, 42, 79, 60])
+Out[18]: array([ 99, 189, 199, 35, 214, 105, 133, 201, 154, 228])
In [19]: np.array_equal(beta ** i, x)
Out[19]: True
@@ -7913,7 +7914,7 @@
Out[20]: GF(2α^4 + 2α^3 + 2α^2 + 2α + 2, order=3^5)
In [21]: i = x.log(beta); i
-Out[21]: array([209, 224, 89, 164, 55, 20, 177, 42, 79, 60])
+Out[21]: array([ 99, 189, 199, 35, 214, 105, 133, 201, 154, 228])
In [22]: np.array_equal(beta ** i, x)
Out[22]: True
@@ -7925,7 +7926,7 @@
Out[23]: GF(α^185, order=3^5)
In [24]: i = x.log(beta); i
-Out[24]: array([209, 224, 89, 164, 55, 20, 177, 42, 79, 60])
+Out[24]: array([ 99, 189, 199, 35, 214, 105, 133, 201, 154, 228])
In [25]: np.array_equal(beta ** i, x)
Out[25]: True
@@ -7943,21 +7944,21 @@
In [26]: x = GF.Random(low=1); x
-Out[26]: GF(193, order=3^5)
+Out[26]: GF(44, order=3^5)
In [27]: bases = GF.primitive_elements
In [28]: i = x.log(bases); i
Out[28]:
-array([147, 181, 223, 13, 105, 211, 85, 35, 151, 111, 51, 49, 141,
- 155, 137, 3, 31, 217, 135, 87, 157, 21, 109, 173, 131, 5,
- 57, 25, 115, 145, 41, 139, 37, 17, 241, 189, 235, 65, 129,
- 119, 179, 101, 127, 81, 69, 221, 195, 229, 123, 63, 175, 149,
- 39, 73, 167, 93, 75, 125, 27, 23, 89, 159, 183, 79, 161,
- 233, 43, 201, 67, 95, 47, 213, 97, 227, 29, 45, 197, 191,
- 177, 71, 113, 107, 7, 215, 1, 207, 225, 133, 83, 203, 237,
- 61, 53, 219, 205, 117, 239, 153, 91, 171, 15, 59, 185, 199,
- 9, 169, 103, 193, 19, 163])
+array([143, 209, 77, 11, 33, 11, 165, 11, 165, 187, 99, 209, 231,
+ 187, 209, 77, 231, 165, 77, 55, 77, 55, 55, 165, 55, 209,
+ 11, 77, 209, 11, 165, 99, 143, 33, 55, 11, 143, 55, 165,
+ 231, 77, 11, 33, 143, 77, 187, 165, 231, 11, 165, 55, 33,
+ 33, 99, 11, 209, 231, 143, 209, 187, 187, 209, 99, 11, 99,
+ 11, 55, 77, 187, 99, 77, 143, 231, 99, 99, 187, 55, 143,
+ 187, 209, 77, 165, 99, 33, 187, 231, 209, 187, 33, 209, 33,
+ 33, 231, 55, 99, 99, 165, 55, 77, 33, 143, 143, 231, 187,
+ 231, 143, 143, 33, 165, 231])
In [29]: np.all(bases ** i == x)
Out[29]: True
@@ -7966,21 +7967,21 @@
In [30]: x = GF.Random(low=1); x
-Out[30]: GF(α^4 + α^3 + α^2 + α + 1, order=3^5)
+Out[30]: GF(2α^3 + α^2 + 2α + 2, order=3^5)
In [31]: bases = GF.primitive_elements
In [32]: i = x.log(bases); i
Out[32]:
-array([ 64, 36, 158, 32, 184, 54, 172, 142, 18, 236, 200, 102, 12,
- 214, 58, 26, 188, 106, 202, 28, 70, 182, 138, 128, 6, 124,
- 10, 136, 190, 208, 194, 156, 240, 228, 72, 186, 20, 160, 150,
- 144, 180, 230, 52, 218, 114, 60, 238, 210, 98, 62, 226, 162,
- 96, 68, 76, 80, 166, 196, 234, 38, 126, 168, 134, 120, 24,
- 164, 50, 48, 16, 178, 4, 152, 34, 112, 90, 148, 94, 42,
- 82, 212, 92, 40, 222, 8, 170, 100, 14, 104, 74, 146, 118,
- 206, 56, 204, 2, 46, 216, 116, 224, 30, 130, 108, 232, 192,
- 78, 174, 86, 140, 84, 122])
+array([182, 178, 230, 212, 130, 146, 232, 124, 210, 172, 236, 222, 140,
+ 238, 112, 142, 96, 188, 98, 4, 10, 26, 158, 122, 70, 156,
+ 36, 54, 200, 168, 166, 126, 138, 240, 114, 234, 72, 92, 56,
+ 228, 164, 102, 42, 204, 120, 216, 34, 30, 14, 78, 136, 196,
+ 152, 148, 80, 46, 162, 28, 68, 40, 18, 24, 192, 190, 38,
+ 58, 180, 76, 106, 60, 208, 160, 74, 16, 82, 194, 48, 6,
+ 150, 134, 186, 144, 170, 174, 128, 118, 2, 84, 218, 90, 86,
+ 64, 8, 202, 104, 214, 100, 224, 32, 108, 226, 50, 206, 62,
+ 184, 94, 116, 20, 12, 52])
In [33]: np.all(bases ** i == x)
Out[33]: True
@@ -7989,21 +7990,21 @@
In [34]: x = GF.Random(low=1); x
-Out[34]: GF(α^83, order=3^5)
+Out[34]: GF(α^167, order=3^5)
In [35]: bases = GF.primitive_elements
In [36]: i = x.log(bases); i
Out[36]:
-array([ 83, 145, 65, 223, 163, 157, 155, 135, 133, 117, 93, 189, 129,
- 183, 79, 219, 85, 111, 175, 59, 87, 81, 213, 45, 125, 123,
- 47, 131, 167, 179, 89, 225, 39, 31, 169, 3, 215, 147, 221,
- 217, 241, 113, 75, 105, 197, 161, 199, 19, 25, 1, 191, 229,
- 185, 5, 91, 13, 151, 171, 35, 227, 205, 233, 49, 201, 137,
- 69, 235, 153, 51, 159, 43, 61, 63, 115, 181, 139, 103, 149,
- 95, 101, 21, 67, 27, 207, 73, 107, 211, 29, 9, 57, 119,
- 97, 239, 15, 203, 71, 23, 37, 109, 141, 127, 193, 195, 7,
- 173, 237, 17, 53, 177, 41])
+array([167, 41, 227, 23, 223, 1, 169, 155, 81, 215, 53, 217, 175,
+ 237, 19, 117, 241, 235, 183, 5, 73, 93, 137, 213, 27, 195,
+ 45, 7, 129, 89, 147, 97, 233, 179, 203, 111, 211, 115, 191,
+ 43, 205, 67, 113, 13, 29, 149, 103, 219, 199, 37, 49, 3,
+ 69, 185, 221, 239, 21, 35, 85, 171, 83, 151, 119, 177, 229,
+ 133, 225, 95, 193, 75, 139, 79, 153, 141, 163, 61, 181, 189,
+ 127, 107, 51, 59, 31, 157, 39, 87, 63, 105, 91, 173, 47,
+ 201, 131, 71, 9, 207, 125, 159, 161, 135, 101, 123, 197, 17,
+ 109, 57, 145, 25, 15, 65])
In [37]: np.all(bases ** i == x)
Out[37]: True
diff --git a/v0.3.x/api/galois.FieldArray.lu_decompose/index.html b/v0.3.x/api/galois.FieldArray.lu_decompose/index.html
index e15be3e5d..87fedd59a 100644
--- a/v0.3.x/api/galois.FieldArray.lu_decompose/index.html
+++ b/v0.3.x/api/galois.FieldArray.lu_decompose/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.lu_decompose() tuple[Self, Self]
+galois.FieldArray.lu_decompose() tuple[Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices.
- Returns:¶
diff --git a/v0.3.x/api/galois.FieldArray.minimal_poly/index.html b/v0.3.x/api/galois.FieldArray.minimal_poly/index.html
index 53aeb96e3..a10dda743 100644
--- a/v0.3.x/api/galois.FieldArray.minimal_poly/index.html
+++ b/v0.3.x/api/galois.FieldArray.minimal_poly/index.html
@@ -7802,8 +7802,8 @@
- Raises:¶
-NotImplementedError – If the array is a a square \(n \times n\) matrix (2-D array).
-ValueError – If the array is not a single finite field element (scalar 0-D array).
+NotImplementedError – If the array is a a square \(n \times n\) matrix (2-D array).
+ValueError – If the array is not a single finite field element (scalar 0-D array).
@@ -7831,10 +7831,10 @@
In [1]: GF = galois.GF(3**5)
In [2]: a = GF.Random(); a
-Out[2]: GF(15, order=3^5)
+Out[2]: GF(225, order=3^5)
In [3]: poly = a.minimal_poly(); poly
-Out[3]: Poly(x^5 + x^3 + x + 2, GF(3))
+Out[3]: Poly(x^5 + x^4 + 2x^3 + 2x + 2, GF(3))
# The minimal polynomial annihilates a
In [4]: poly(a, field=GF)
@@ -7850,10 +7850,10 @@
In [6]: GF = galois.GF(3**5, repr="poly")
In [7]: a = GF.Random(); a
-Out[7]: GF(α^4 + α^3 + 2α + 2, order=3^5)
+Out[7]: GF(α^4 + 2α^2 + α + 2, order=3^5)
In [8]: poly = a.minimal_poly(); poly
-Out[8]: Poly(x^5 + x^4 + 2x^3 + 2x + 2, GF(3))
+Out[8]: Poly(x^5 + x^4 + x^2 + 2x + 2, GF(3))
# The minimal polynomial annihilates a
In [9]: poly(a, field=GF)
@@ -7869,10 +7869,10 @@
In [11]: GF = galois.GF(3**5, repr="power")
In [12]: a = GF.Random(); a
-Out[12]: GF(α^19, order=3^5)
+Out[12]: GF(α^181, order=3^5)
In [13]: poly = a.minimal_poly(); poly
-Out[13]: Poly(x^5 + x^4 + 2x^3 + 1, GF(3))
+Out[13]: Poly(x^5 + 2x^3 + 2x^2 + x + 1, GF(3))
# The minimal polynomial annihilates a
In [14]: poly(a, field=GF)
diff --git a/v0.3.x/api/galois.FieldArray.multiplicative_order/index.html b/v0.3.x/api/galois.FieldArray.multiplicative_order/index.html
index 126f08c51..71a425f19 100644
--- a/v0.3.x/api/galois.FieldArray.multiplicative_order/index.html
+++ b/v0.3.x/api/galois.FieldArray.multiplicative_order/index.html
@@ -7780,7 +7780,7 @@
-
-galois.FieldArray.multiplicative_order() int | numpy.ndarray
+galois.FieldArray.multiplicative_order() int | numpy.ndarray
Computes the multiplicative order \(\textrm{ord}(x)\) of each element in \(x\).
- Returns:¶
@@ -7788,7 +7788,7 @@
integer if the input array \(x\) is a scalar.
- Raises:¶
-ArithmeticError – If zero is provided as an input. The multiplicative order of 0 is not defined. There is
+
ArithmeticError – If zero is provided as an input. The multiplicative order of 0 is not defined. There is
no power of 0 that ever results in 1.
diff --git a/v0.3.x/api/galois.FieldArray.name/index.html b/v0.3.x/api/galois.FieldArray.name/index.html
index ff3ca36b3..88a141add 100644
--- a/v0.3.x/api/galois.FieldArray.name/index.html
+++ b/v0.3.x/api/galois.FieldArray.name/index.html
@@ -7738,7 +7738,7 @@
-
-class property galois.FieldArray.name : str
+class property galois.FieldArray.name : str
The finite field’s name as a string GF(p)
or GF(p^m)
.
Examples
In [1]: galois.GF(2).name
diff --git a/v0.3.x/api/galois.FieldArray.null_space/index.html b/v0.3.x/api/galois.FieldArray.null_space/index.html
index 1afdfca6a..e6fcc3618 100644
--- a/v0.3.x/api/galois.FieldArray.null_space/index.html
+++ b/v0.3.x/api/galois.FieldArray.null_space/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.null_space() Self
+galois.FieldArray.null_space() Self
Computes the null space of the matrix \(\mathbf{A}\).
- Returns:¶
@@ -7789,14 +7789,14 @@
In [3]: A = GF.Random((m, n)); A
Out[3]:
-GF([[ 0, 15, 8, 1, 28],
- [30, 27, 15, 13, 8],
- [14, 3, 3, 7, 8]], order=31)
+GF([[14, 20, 5, 27, 22],
+ [28, 18, 3, 21, 0],
+ [ 9, 16, 24, 11, 29]], order=31)
In [4]: N = A.null_space(); N
Out[4]:
-GF([[ 1, 0, 12, 25, 30],
- [ 0, 1, 26, 6, 4]], order=31)
+GF([[ 1, 0, 9, 21, 11],
+ [ 0, 1, 19, 23, 6]], order=31)
The null space is the set of vectors that sum the columns to 0.
diff --git a/v0.3.x/api/galois.FieldArray.order/index.html b/v0.3.x/api/galois.FieldArray.order/index.html
index 251d52912..1a3b972cd 100644
--- a/v0.3.x/api/galois.FieldArray.order/index.html
+++ b/v0.3.x/api/galois.FieldArray.order/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.order : int
+class property galois.FieldArray.order : int
The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\).
Notes
The order of the field is equal to the field’s size.
diff --git a/v0.3.x/api/galois.FieldArray.plu_decompose/index.html b/v0.3.x/api/galois.FieldArray.plu_decompose/index.html
index 2025f5a0b..fcac36eed 100644
--- a/v0.3.x/api/galois.FieldArray.plu_decompose/index.html
+++ b/v0.3.x/api/galois.FieldArray.plu_decompose/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.plu_decompose() tuple[Self, Self, Self]
+galois.FieldArray.plu_decompose() tuple[Self, Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices using partial pivoting.
- Returns:¶
diff --git a/v0.3.x/api/galois.FieldArray.prime_subfield/index.html b/v0.3.x/api/galois.FieldArray.prime_subfield/index.html
index 8a99bb0f6..4c4e15e4d 100644
--- a/v0.3.x/api/galois.FieldArray.prime_subfield/index.html
+++ b/v0.3.x/api/galois.FieldArray.prime_subfield/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.prime_subfield : type[FieldArray]
+class property galois.FieldArray.prime_subfield : type[FieldArray]
The prime subfield \(\mathrm{GF}(p)\) of the extension field \(\mathrm{GF}(p^m)\).
Notes
For the prime field \(\mathrm{GF}(p)\), the prime subfield is itself.
diff --git a/v0.3.x/api/galois.FieldArray.primitive_root_of_unity/index.html b/v0.3.x/api/galois.FieldArray.primitive_root_of_unity/index.html
index 1971ce7bc..08eb20a28 100644
--- a/v0.3.x/api/galois.FieldArray.primitive_root_of_unity/index.html
+++ b/v0.3.x/api/galois.FieldArray.primitive_root_of_unity/index.html
@@ -7820,12 +7820,12 @@
-
-classmethod galois.FieldArray.primitive_root_of_unity(n: int) Self
+classmethod galois.FieldArray.primitive_root_of_unity(n: int) Self
Finds a primitive \(n\)-th root of unity in the finite field.
- Parameters:¶
-
@@ -7833,7 +7833,7 @@
The primitive \(n\)-th root of unity, a 0-D scalar array.
- Raises:¶
-ValueError – If no primitive \(n\)-th roots of unity exist. This happens when \(n\) is not a
+
ValueError – If no primitive \(n\)-th roots of unity exist. This happens when \(n\) is not a
divisor of \(p^m - 1\).
diff --git a/v0.3.x/api/galois.FieldArray.primitive_roots_of_unity/index.html b/v0.3.x/api/galois.FieldArray.primitive_roots_of_unity/index.html
index e4ec96e4f..b15b57323 100644
--- a/v0.3.x/api/galois.FieldArray.primitive_roots_of_unity/index.html
+++ b/v0.3.x/api/galois.FieldArray.primitive_roots_of_unity/index.html
@@ -7820,12 +7820,12 @@
-
-classmethod galois.FieldArray.primitive_roots_of_unity(n: int) Self
+classmethod galois.FieldArray.primitive_roots_of_unity(n: int) Self
Finds all primitive \(n\)-th roots of unity in the finite field.
- Parameters:¶
-
@@ -7833,7 +7833,7 @@
All primitive \(n\)-th roots of unity, a 1-D array. The roots are sorted in lexicographical order.
- Raises:¶
-ValueError – If no primitive \(n\)-th roots of unity exist. This happens when \(n\) is not a
+
ValueError – If no primitive \(n\)-th roots of unity exist. This happens when \(n\) is not a
divisor of \(p^m - 1\).
diff --git a/v0.3.x/api/galois.FieldArray.properties/index.html b/v0.3.x/api/galois.FieldArray.properties/index.html
index 3ffc1a961..a250a2f20 100644
--- a/v0.3.x/api/galois.FieldArray.properties/index.html
+++ b/v0.3.x/api/galois.FieldArray.properties/index.html
@@ -7738,7 +7738,7 @@
-
-class property galois.FieldArray.properties : str
+class property galois.FieldArray.properties : str
A formatted string of relevant properties of the Galois field.
Examples
In [1]: GF = galois.GF(7**5)
diff --git a/v0.3.x/api/galois.FieldArray.repr/index.html b/v0.3.x/api/galois.FieldArray.repr/index.html
index 7ff9d48d6..bf13a70f0 100644
--- a/v0.3.x/api/galois.FieldArray.repr/index.html
+++ b/v0.3.x/api/galois.FieldArray.repr/index.html
@@ -7806,7 +7806,7 @@
-
-classmethod galois.FieldArray.repr(element_repr: 'int' | 'poly' | 'power' =
'int'
) Generator[None, None, None]
+classmethod galois.FieldArray.repr(element_repr: 'int' | 'poly' | 'power' = 'int'
) Generator[None, None, None]
Sets the element representation for all arrays from this FieldArray
subclass.
- Parameters:¶
diff --git a/v0.3.x/api/galois.FieldArray.repr_table/index.html b/v0.3.x/api/galois.FieldArray.repr_table/index.html
index 85cbbc43d..bb94b33ff 100644
--- a/v0.3.x/api/galois.FieldArray.repr_table/index.html
+++ b/v0.3.x/api/galois.FieldArray.repr_table/index.html
@@ -7806,13 +7806,13 @@
-
-classmethod galois.FieldArray.repr_table(element: ElementLike | None =
None
, sort: 'power' | 'poly' | 'vector' | 'int' = 'power'
) str
+classmethod galois.FieldArray.repr_table(element: ElementLike | None = None
, sort: 'power' | 'poly' | 'vector' | 'int' = 'power'
) str
Generates a finite field element representation table comparing the power, polynomial, vector, and
integer representations.
- Parameters:¶
-- element: ElementLike | None =
None
¶ An element to use as the exponent base in the power representation. The default is None
which
+
- element: ElementLike | None =
None
¶ An element to use as the exponent base in the power representation. The default is None
which
corresponds to primitive_element
.
- sort: 'power' | 'poly' | 'vector' | 'int' =
'power'
¶ The sorting method for the table. The default is "power"
. Sorting by "power"
will order the rows
diff --git a/v0.3.x/api/galois.FieldArray.row_reduce/index.html b/v0.3.x/api/galois.FieldArray.row_reduce/index.html
index 783a1d511..f383b1c6c 100644
--- a/v0.3.x/api/galois.FieldArray.row_reduce/index.html
+++ b/v0.3.x/api/galois.FieldArray.row_reduce/index.html
@@ -7820,12 +7820,12 @@
-
-galois.FieldArray.row_reduce(ncols: int | None =
None
, eye: 'left' | 'right' = 'left'
) Self
+galois.FieldArray.row_reduce(ncols: int | None = None
, eye: 'left' | 'right' = 'left'
) Self
Performs Gaussian elimination on the matrix to achieve reduced row echelon form (RREF).
- Parameters:¶
-- ncols: int | None =
None
¶ The number of columns to perform Gaussian elimination over. The default is None
which represents
+
- ncols: int | None =
None
¶ The number of columns to perform Gaussian elimination over. The default is None
which represents
the number of columns of the matrix.
- eye: 'left' | 'right' =
'left'
¶ The location of the identity matrix \(\mathbf{I}\), either on the left or the right.
diff --git a/v0.3.x/api/galois.FieldArray.row_space/index.html b/v0.3.x/api/galois.FieldArray.row_space/index.html
index 29e375479..7cdb35fbd 100644
--- a/v0.3.x/api/galois.FieldArray.row_space/index.html
+++ b/v0.3.x/api/galois.FieldArray.row_space/index.html
@@ -7766,7 +7766,7 @@
-
-galois.FieldArray.row_space() Self
+galois.FieldArray.row_space() Self
Computes the row space of the matrix \(\mathbf{A}\).
- Returns:¶
@@ -7790,11 +7790,11 @@
In [3]: A = GF.Random((m, n)); A
Out[3]:
-GF([[18, 16, 25],
- [19, 0, 16],
- [ 0, 17, 20],
- [ 0, 0, 22],
- [18, 30, 4]], order=31)
+GF([[ 7, 6, 14],
+ [27, 29, 4],
+ [14, 19, 1],
+ [ 8, 24, 24],
+ [ 3, 24, 24]], order=31)
In [4]: R = A.row_space(); R
Out[4]:
@@ -7806,8 +7806,8 @@
The dimension of the row space and left null space sum to \(m\).
In [5]: LN = A.left_null_space(); LN
Out[5]:
-GF([[ 1, 0, 30, 7, 30],
- [ 0, 1, 28, 0, 11]], order=31)
+GF([[ 1, 0, 28, 22, 15],
+ [ 0, 1, 21, 24, 15]], order=31)
In [6]: R.shape[0] + LN.shape[0] == m
Out[6]: True
diff --git a/v0.3.x/api/galois.FieldArray.ufunc_modes/index.html b/v0.3.x/api/galois.FieldArray.ufunc_modes/index.html
index 1f89a5785..c93650165 100644
--- a/v0.3.x/api/galois.FieldArray.ufunc_modes/index.html
+++ b/v0.3.x/api/galois.FieldArray.ufunc_modes/index.html
@@ -7752,7 +7752,7 @@
-
-class property galois.FieldArray.ufunc_modes : list[str]
+class property galois.FieldArray.ufunc_modes : list[str]
All supported ufunc compilation modes for this FieldArray
subclass.
Notes
The ufuncs may be recompiled with compile()
.
diff --git a/v0.3.x/api/galois.FieldArray.vector/index.html b/v0.3.x/api/galois.FieldArray.vector/index.html
index d70642935..ca80de4e5 100644
--- a/v0.3.x/api/galois.FieldArray.vector/index.html
+++ b/v0.3.x/api/galois.FieldArray.vector/index.html
@@ -7806,13 +7806,13 @@
-
-galois.FieldArray.vector(dtype: DTypeLike | None =
None
) FieldArray
+galois.FieldArray.vector(dtype: DTypeLike | None = None
) FieldArray
Converts an array over \(\mathrm{GF}(p^m)\) to length-\(m\) vectors over the prime subfield
\(\mathrm{GF}(p)\).
- Parameters:¶
-- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
+
- dtype: DTypeLike | None =
None
¶ The numpy.dtype
of the array elements. The default is None
which represents the smallest
unsigned data type for this FieldArray
subclass (the first element in
dtypes
).
diff --git a/v0.3.x/api/galois.FieldArray/index.html b/v0.3.x/api/galois.FieldArray/index.html
index 74b509d3a..8f4d97037 100644
--- a/v0.3.x/api/galois.FieldArray/index.html
+++ b/v0.3.x/api/galois.FieldArray/index.html
@@ -8431,7 +8431,7 @@
-
-classmethod Identity(size: int, ...) Self
+classmethod Identity(size: int, ...) Self
Creates an \(n \times n\) identity matrix.
@@ -8477,7 +8477,7 @@ Conversions
-
-vector(dtype: DTypeLike | None =
None
) FieldArray
+vector(dtype: DTypeLike | None = None
) FieldArray
Converts an array over \(\mathrm{GF}(p^m)\) to length-\(m\) vectors over the prime subfield
\(\mathrm{GF}(p)\).
@@ -8511,13 +8511,13 @@ Elements
-
-classmethod primitive_root_of_unity(n: int) Self
+classmethod primitive_root_of_unity(n: int) Self
Finds a primitive \(n\)-th root of unity in the finite field.
-
-classmethod primitive_roots_of_unity(n: int) Self
+classmethod primitive_roots_of_unity(n: int) Self
Finds all primitive \(n\)-th roots of unity in the finite field.
@@ -8538,31 +8538,31 @@ ElementsString representation¶
-
-__str__() str
+__str__() str
Displays the array without specifying the class or finite field order.
-
-classmethod arithmetic_table(operation, ...) str
+classmethod arithmetic_table(operation, ...) str
Generates the specified arithmetic table for the finite field.
-
-class property properties : str
+class property properties : str
A formatted string of relevant properties of the Galois field.
-
-classmethod repr_table(...) str
+classmethod repr_table(...) str
Generates a finite field element representation table comparing the power, polynomial, vector, and
integer representations.
@@ -8578,7 +8578,7 @@ Element representation
-
-classmethod repr(...) Generator[None, None, None]
+classmethod repr(...) Generator[None, None, None]
Sets the element representation for all arrays from this FieldArray
subclass.
@@ -8593,7 +8593,7 @@ Arithmetic compilation
-
-class property dtypes : list[numpy.dtype]
+class property dtypes : list[numpy.dtype]
List of valid integer numpy.dtype
values that are compatible with this finite field.
@@ -8605,7 +8605,7 @@ Arithmetic compilation
-
-class property ufunc_modes : list[str]
+class property ufunc_modes : list[str]
All supported ufunc compilation modes for this FieldArray
subclass.
@@ -8620,7 +8620,7 @@ Arithmetic compilationMethods¶
-
-additive_order() int | numpy.ndarray
+additive_order() int | numpy.ndarray
Computes the additive order of each element in \(x\).
@@ -8645,7 +8645,7 @@ Methods
-
-log(base: ElementLike | ArrayLike | None =
None
) int | ndarray
+log(base: ElementLike | ArrayLike | None = None
) int | ndarray
Computes the discrete logarithm of the array \(x\) base \(\beta\).
@@ -8657,7 +8657,7 @@ Methods
-
-multiplicative_order() int | numpy.ndarray
+multiplicative_order() int | numpy.ndarray
Computes the multiplicative order \(\textrm{ord}(x)\) of each element in \(x\).
@@ -8666,43 +8666,43 @@ MethodsLinear algebra¶
-
-column_space() Self
+column_space() Self
Computes the column space of the matrix \(\mathbf{A}\).
-
-left_null_space() Self
+left_null_space() Self
Computes the left null space of the matrix \(\mathbf{A}\).
-
-lu_decompose() tuple[Self, Self]
+lu_decompose() tuple[Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices.
-
-null_space() Self
+null_space() Self
Computes the null space of the matrix \(\mathbf{A}\).
-
-plu_decompose() tuple[Self, Self, Self]
+plu_decompose() tuple[Self, Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices using partial pivoting.
-
-row_reduce(ncols: int | None =
None
, ...) Self
+row_reduce(ncols: int | None = None
, ...) Self
Performs Gaussian elimination on the matrix to achieve reduced row echelon form (RREF).
@@ -8711,13 +8711,13 @@ Linear algebraProperties¶
-
-class property characteristic : int
+class property characteristic : int
The prime characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\).
-
-class property degree : int
+class property degree : int
The extension degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\).
@@ -8729,19 +8729,19 @@ Properties
-
-class property name : str
+class property name : str
The finite field’s name as a string GF(p)
or GF(p^m)
.
-
-class property order : int
+class property order : int
The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\).
-
-class property prime_subfield : type[FieldArray]
+class property prime_subfield : type[FieldArray]
The prime subfield \(\mathrm{GF}(p)\) of the extension field \(\mathrm{GF}(p^m)\).
@@ -8750,25 +8750,25 @@ PropertiesAttributes¶
-
-class property is_extension_field : bool
+class property is_extension_field : bool
Indicates if the finite field is an extension field, having prime power order.
-
-class property is_prime_field : bool
+class property is_prime_field : bool
Indicates if the finite field is a prime field, having prime order.
-
-class property is_primitive_poly : bool
+class property is_primitive_poly : bool
Indicates whether the irreducible_poly
is a primitive polynomial.
-
-is_square() bool | numpy.ndarray
+is_square() bool | numpy.ndarray
Determines if the elements of \(x\) are squares in the finite field.
diff --git a/v0.3.x/api/galois.GF/index.html b/v0.3.x/api/galois.GF/index.html
index 0354ef179..cc22e94f3 100644
--- a/v0.3.x/api/galois.GF/index.html
+++ b/v0.3.x/api/galois.GF/index.html
@@ -7872,25 +7872,25 @@
-
-galois.GF(order: int, *, irreducible_poly: PolyLike | None =
None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
+galois.GF(order: int, *, irreducible_poly: PolyLike | None = None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
-
-galois.GF(characteristic: int, degree: int, *, irreducible_poly: PolyLike | None =
None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
+galois.GF(characteristic: int, degree: int, *, irreducible_poly: PolyLike | None = None
, primitive_element: int | PolyLike | None = None
, verify: bool = True
, compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None = None
, repr: 'int' | 'poly' | 'power' | None = None
) type[FieldArray]
Creates a FieldArray
subclass for \(\mathrm{GF}(p^m)\).
- Parameters:¶
-- order: int¶
The order \(p^m\) of the field \(\mathrm{GF}(p^m)\). The order must be a prime power.
+- order: int¶
The order \(p^m\) of the field \(\mathrm{GF}(p^m)\). The order must be a prime power.
-- characteristic: int
The characteristic \(p\) of the field \(\mathrm{GF}(p^m)\). The characteristic must
+
- characteristic: int
The characteristic \(p\) of the field \(\mathrm{GF}(p^m)\). The characteristic must
be prime.
-- degree: int
The degree \(m\) of the field \(\mathrm{GF}(p^m)\). The degree must be a positive integer.
+- degree: int
The degree \(m\) of the field \(\mathrm{GF}(p^m)\). The degree must be a positive integer.
-- irreducible_poly: PolyLike | None =
None
¶ Optionally specify an irreducible polynomial of degree \(m\) over \(\mathrm{GF}(p)\)
+
- irreducible_poly: PolyLike | None =
None
¶ Optionally specify an irreducible polynomial of degree \(m\) over \(\mathrm{GF}(p)\)
that defines the finite field arithmetic. The default is None
which uses the Conway polynomial
\(C_{p,m}\), see conway_poly()
.
-- primitive_element: int | PolyLike | None =
None
¶ Optionally specify a primitive element of the field. This value is used when building the
+
- primitive_element: int | PolyLike | None =
None
¶ Optionally specify a primitive element of the field. This value is used when building the
exponential and logarithm lookup tables and as the base of numpy.log
. A primitive element is a
generator of the multiplicative group of the field.
For prime fields \(\mathrm{GF}(p)\), the primitive element must be an integer and is a primitive root
@@ -7899,7 +7899,7 @@
\(m\) over \(\mathrm{GF}(p)\). The default is None
which uses primitive_element()
.
-- verify: bool =
True
¶ Indicates whether to verify that the user-provided irreducible polynomial is in fact irreducible and
+
- verify: bool =
True
¶ Indicates whether to verify that the user-provided irreducible polynomial is in fact irreducible and
that the user-provided primitive element is in fact a generator of the multiplicative group.
The default is True
.
For large fields and irreducible polynomials that are already known to be irreducible (which may take a
@@ -7908,7 +7908,7 @@
to be irreducible and a multiplicative generator, respectively.
-- compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None =
None
¶ The ufunc calculation mode. This can be modified after class construction with the
+
- compile: 'auto' | 'jit-lookup' | 'jit-calculate' | 'python-calculate' | None =
None
¶ The ufunc calculation mode. This can be modified after class construction with the
compile()
method. See Compilation Modes for a further
discussion.
@@ -7926,11 +7926,11 @@
"jit-calculate"
mode is slower than "jit-lookup"
.
"python-calculate"
: Uses pure-Python ufuncs with explicit calculation. This is reserved for fields
whose elements cannot be represented with numpy.int64
and instead use numpy.object_
with
-Python int
(which has arbitrary precision).
+Python int
(which has arbitrary precision).
-- repr: 'int' | 'poly' | 'power' | None =
None
¶ The field element representation. This can be modified after class construction with the
+
- repr: 'int' | 'poly' | 'power' | None =
None
¶ The field element representation. This can be modified after class construction with the
repr()
method. See Element Representation for a further
discussion.
diff --git a/v0.3.x/api/galois.GF2/index.html b/v0.3.x/api/galois.GF2/index.html
index 91d3694e6..d40822fbd 100644
--- a/v0.3.x/api/galois.GF2/index.html
+++ b/v0.3.x/api/galois.GF2/index.html
@@ -7912,13 +7912,13 @@
Constructors¶
-
-GF2(x: ElementLike | ArrayLike, dtype: DTypeLike | None =
None
, ...)
+GF2(x: ElementLike | ArrayLike, dtype: DTypeLike | None = None
, ...)
Creates an array over \(\mathrm{GF}(p^m)\).
-
-classmethod Identity(size: int, ...) Self
+classmethod Identity(size: int, ...) Self
Creates an \(n \times n\) identity matrix.
@@ -7962,7 +7962,7 @@ Conversions
-
-vector(dtype: DTypeLike | None =
None
) FieldArray
+vector(dtype: DTypeLike | None = None
) FieldArray
Converts an array over \(\mathrm{GF}(p^m)\) to length-\(m\) vectors over the prime subfield
\(\mathrm{GF}(p)\).
@@ -7994,13 +7994,13 @@ Elements
-
-classmethod primitive_root_of_unity(n: int) Self
+classmethod primitive_root_of_unity(n: int) Self
Finds a primitive \(n\)-th root of unity in the finite field.
-
-classmethod primitive_roots_of_unity(n: int) Self
+classmethod primitive_roots_of_unity(n: int) Self
Finds all primitive \(n\)-th roots of unity in the finite field.
@@ -8019,31 +8019,31 @@ ElementsString representation¶
-
-__str__() str
+__str__() str
Displays the array without specifying the class or finite field order.
-
-classmethod arithmetic_table(operation, ...) str
+classmethod arithmetic_table(operation, ...) str
Generates the specified arithmetic table for the finite field.
-
-class property properties : str
+class property properties : str
A formatted string of relevant properties of the Galois field.
-
-classmethod repr_table(...) str
+classmethod repr_table(...) str
Generates a finite field element representation table comparing the power, polynomial, vector, and
integer representations.
@@ -8057,7 +8057,7 @@ Element representation
-
-classmethod repr(...) Generator[None, None, None]
+classmethod repr(...) Generator[None, None, None]
Sets the element representation for all arrays from this FieldArray
subclass.
@@ -8070,7 +8070,7 @@ Arithmetic compilation
-
-class property dtypes : list[numpy.dtype]
+class property dtypes : list[numpy.dtype]
List of valid integer numpy.dtype
values that are compatible with this finite field.
@@ -8082,7 +8082,7 @@ Arithmetic compilation
-
-class property ufunc_modes : list[str]
+class property ufunc_modes : list[str]
All supported ufunc compilation modes for this FieldArray
subclass.
@@ -8095,7 +8095,7 @@ Arithmetic compilationMethods¶
-
-additive_order() int | numpy.ndarray
+additive_order() int | numpy.ndarray
Computes the additive order of each element in \(x\).
@@ -8120,7 +8120,7 @@ Methods
-
-log(base: ElementLike | ArrayLike | None =
None
) int | ndarray
+log(base: ElementLike | ArrayLike | None = None
) int | ndarray
Computes the discrete logarithm of the array \(x\) base \(\beta\).
@@ -8132,63 +8132,63 @@ Methods
-
-multiplicative_order() int | numpy.ndarray
+multiplicative_order() int | numpy.ndarray
Computes the multiplicative order \(\textrm{ord}(x)\) of each element in \(x\).
Linear algebra¶
-
-column_space() Self
+column_space() Self
Computes the column space of the matrix \(\mathbf{A}\).
-
-left_null_space() Self
+left_null_space() Self
Computes the left null space of the matrix \(\mathbf{A}\).
-
-lu_decompose() tuple[Self, Self]
+lu_decompose() tuple[Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices.
-
-null_space() Self
+null_space() Self
Computes the null space of the matrix \(\mathbf{A}\).
-
-plu_decompose() tuple[Self, Self, Self]
+plu_decompose() tuple[Self, Self, Self]
Decomposes the input array into the product of lower and upper triangular matrices using partial pivoting.
-
-row_reduce(ncols: int | None =
None
, ...) Self
+row_reduce(ncols: int | None = None
, ...) Self
Performs Gaussian elimination on the matrix to achieve reduced row echelon form (RREF).
Properties¶
-
-class property characteristic : int
+class property characteristic : int
The prime characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\).
-
-class property degree : int
+class property degree : int
The extension degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\).
@@ -8200,44 +8200,44 @@ Properties
-
-class property name : str
+class property name : str
The finite field’s name as a string GF(p)
or GF(p^m)
.
-
-class property order : int
+class property order : int
The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\).
-
-class property prime_subfield : type[FieldArray]
+class property prime_subfield : type[FieldArray]
The prime subfield \(\mathrm{GF}(p)\) of the extension field \(\mathrm{GF}(p^m)\).
Attributes¶
-
-class property is_extension_field : bool
+class property is_extension_field : bool
Indicates if the finite field is an extension field, having prime power order.
-
-class property is_prime_field : bool
+class property is_prime_field : bool
Indicates if the finite field is a prime field, having prime order.
-
-class property is_primitive_poly : bool
+class property is_primitive_poly : bool
Indicates whether the irreducible_poly
is a primitive polynomial.
-
-is_square() bool | numpy.ndarray
+is_square() bool | numpy.ndarray
Determines if the elements of \(x\) are squares in the finite field.
diff --git a/v0.3.x/api/galois.GLFSR.Taps/index.html b/v0.3.x/api/galois.GLFSR.Taps/index.html
index b29537318..c08541986 100644
--- a/v0.3.x/api/galois.GLFSR.Taps/index.html
+++ b/v0.3.x/api/galois.GLFSR.Taps/index.html
@@ -7806,14 +7806,14 @@
-
-classmethod galois.GLFSR.Taps(taps: FieldArray, state: ArrayLike | None =
None
) Self
+classmethod galois.GLFSR.Taps(taps: FieldArray, state: ArrayLike | None = None
) Self
Constructs a Galois LFSR from its taps \(T = [c_0, c_1, \dots, c_{n-2}, c_{n-1}]\).
- Parameters:¶
- taps: FieldArray¶
The shift register taps \(T = [c_0, c_1, \dots, c_{n-2}, c_{n-1}]\).
-- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
+
- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which corresponds to all ones.
diff --git a/v0.3.x/api/galois.GLFSR.__init__/index.html b/v0.3.x/api/galois.GLFSR.__init__/index.html
index 4ae736826..5c8e7bf1e 100644
--- a/v0.3.x/api/galois.GLFSR.__init__/index.html
+++ b/v0.3.x/api/galois.GLFSR.__init__/index.html
@@ -7792,7 +7792,7 @@
-
-galois.GLFSR(feedback_poly: Poly, state: ArrayLike | None =
None
)
+galois.GLFSR(feedback_poly: Poly, state: ArrayLike | None = None
)
Constructs a Galois LFSR from its feedback polynomial \(f(x)\).
- Parameters:¶
@@ -7800,7 +7800,7 @@
- feedback_poly: Poly¶
The feedback polynomial
\(f(x) = -c_{0}x^{n} - c_{1}x^{n-1} - \dots - c_{n-2}x^{2} - c_{n-1}x + 1\).
-- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
+
- state: ArrayLike | None =
None
¶ The initial state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which corresponds to all ones.
diff --git a/v0.3.x/api/galois.GLFSR.__repr__/index.html b/v0.3.x/api/galois.GLFSR.__repr__/index.html
index c02eba398..8a82e586d 100644
--- a/v0.3.x/api/galois.GLFSR.__repr__/index.html
+++ b/v0.3.x/api/galois.GLFSR.__repr__/index.html
@@ -7738,7 +7738,7 @@
-
-galois.GLFSR.__repr__() str
+galois.GLFSR.__repr__() str
A terse representation of the Galois LFSR.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.GLFSR.__str__/index.html b/v0.3.x/api/galois.GLFSR.__str__/index.html
index db3b3cff0..978b7b0cf 100644
--- a/v0.3.x/api/galois.GLFSR.__str__/index.html
+++ b/v0.3.x/api/galois.GLFSR.__str__/index.html
@@ -7738,7 +7738,7 @@
-
-galois.GLFSR.__str__() str
+galois.GLFSR.__str__() str
A formatted string of relevant properties of the Galois LFSR.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.GLFSR.field/index.html b/v0.3.x/api/galois.GLFSR.field/index.html
index 1bfb7c09d..37012868f 100644
--- a/v0.3.x/api/galois.GLFSR.field/index.html
+++ b/v0.3.x/api/galois.GLFSR.field/index.html
@@ -7738,7 +7738,7 @@
-
-property galois.GLFSR.field : type[FieldArray]
+property galois.GLFSR.field : type[FieldArray]
The FieldArray
subclass for the finite field that defines the linear arithmetic.
Examples
In [1]: c = galois.primitive_poly(7, 4); c
diff --git a/v0.3.x/api/galois.GLFSR.order/index.html b/v0.3.x/api/galois.GLFSR.order/index.html
index 751e2c843..562fe9bf0 100644
--- a/v0.3.x/api/galois.GLFSR.order/index.html
+++ b/v0.3.x/api/galois.GLFSR.order/index.html
@@ -7688,7 +7688,7 @@
-
-property galois.GLFSR.order : int
+property galois.GLFSR.order : int
The order of the linear recurrence/linear recurrent sequence. The order of a sequence is defined by the
degree of the minimal polynomial that produces it.
diff --git a/v0.3.x/api/galois.GLFSR.reset/index.html b/v0.3.x/api/galois.GLFSR.reset/index.html
index 4099b8b71..5d30b1671 100644
--- a/v0.3.x/api/galois.GLFSR.reset/index.html
+++ b/v0.3.x/api/galois.GLFSR.reset/index.html
@@ -7778,12 +7778,12 @@
-
-galois.GLFSR.reset(state: ArrayLike | None =
None
)
+galois.GLFSR.reset(state: ArrayLike | None = None
)
Resets the Galois LFSR state to the specified state.
- Parameters:¶
-- state: ArrayLike | None =
None
¶ The state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which
+
- state: ArrayLike | None =
None
¶ The state vector \(S = [S_0, S_1, \dots, S_{n-2}, S_{n-1}]\). The default is None
which
corresponds to the initial state.
diff --git a/v0.3.x/api/galois.GLFSR.step/index.html b/v0.3.x/api/galois.GLFSR.step/index.html
index 85d7b8cb9..81496ec6a 100644
--- a/v0.3.x/api/galois.GLFSR.step/index.html
+++ b/v0.3.x/api/galois.GLFSR.step/index.html
@@ -7792,12 +7792,12 @@
-
-galois.GLFSR.step(steps: int =
1
) FieldArray
+galois.GLFSR.step(steps: int = 1
) FieldArray
Produces the next steps
output symbols.
- Parameters:¶
-
diff --git a/v0.3.x/api/galois.GLFSR/index.html b/v0.3.x/api/galois.GLFSR/index.html
index 1932a5bab..ec96d4f56 100644
--- a/v0.3.x/api/galois.GLFSR/index.html
+++ b/v0.3.x/api/galois.GLFSR/index.html
@@ -8164,7 +8164,7 @@
Constructors¶
-
-GLFSR(feedback_poly: Poly, state: ArrayLike | None =
None
)
+GLFSR(feedback_poly: Poly, state: ArrayLike | None = None
)
Constructs a Galois LFSR from its feedback polynomial \(f(x)\).
@@ -8179,13 +8179,13 @@
String representation¶
@@ -8194,13 +8194,13 @@ String representationMethods¶
-
-reset(state: ArrayLike | None =
None
)
+reset(state: ArrayLike | None = None
)
Resets the Galois LFSR state to the specified state.
-
-step(steps: int =
1
) FieldArray
+step(steps: int = 1
) FieldArray
Produces the next steps
output symbols.
@@ -8215,13 +8215,13 @@ MethodsProperties¶
-
-property field : type[FieldArray]
+property field : type[FieldArray]
The FieldArray
subclass for the finite field that defines the linear arithmetic.
-
-property order : int
+property order : int
The order of the linear recurrence/linear recurrent sequence. The order of a sequence is defined by the
degree of the minimal polynomial that produces it.
diff --git a/v0.3.x/api/galois.Poly.Degrees/index.html b/v0.3.x/api/galois.Poly.Degrees/index.html
index 1958f7e76..6883cc98d 100644
--- a/v0.3.x/api/galois.Poly.Degrees/index.html
+++ b/v0.3.x/api/galois.Poly.Degrees/index.html
@@ -7820,19 +7820,19 @@
-
-classmethod galois.Poly.Degrees(degrees: Sequence[int] | ndarray, coeffs: ArrayLike | None =
None
, field: type[Array] | None = None
) Self
+classmethod galois.Poly.Degrees(degrees: Sequence[int] | ndarray, coeffs: ArrayLike | None = None
, field: type[Array] | None = None
) Self
Constructs a polynomial over \(\mathrm{GF}(p^m)\) from its non-zero degrees.
- Parameters:¶
-- degrees: Sequence[int] | ndarray¶
The polynomial degrees with non-zero coefficients.
+- degrees: Sequence[int] | ndarray¶
The polynomial degrees with non-zero coefficients.
-- coeffs: ArrayLike | None =
None
¶ The corresponding non-zero polynomial coefficients. The default is None
which corresponds to
+
- coeffs: ArrayLike | None =
None
¶ The corresponding non-zero polynomial coefficients. The default is None
which corresponds to
all ones.
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over.
+- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over.
-None
(default): If the coefficients are an Array
, they won’t be modified.
+
None
(default): If the coefficients are an Array
, they won’t be modified.
If the coefficients are not explicitly in a Galois field, they are assumed to be from
\(\mathrm{GF}(2)\) and are converted using galois.GF2(coeffs)
.
Array
subclass: The coefficients are explicitly converted to this Galois field
diff --git a/v0.3.x/api/galois.Poly.Identity/index.html b/v0.3.x/api/galois.Poly.Identity/index.html
index cbd73f69c..7b58d469d 100644
--- a/v0.3.x/api/galois.Poly.Identity/index.html
+++ b/v0.3.x/api/galois.Poly.Identity/index.html
@@ -7792,12 +7792,12 @@
-
-classmethod galois.Poly.Identity(field: type[Array] | None =
None
) Self
+classmethod galois.Poly.Identity(field: type[Array] | None = None
) Self
Constructs the polynomial \(f(x) = x\) over \(\mathrm{GF}(p^m)\).
- Parameters:¶
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
+
- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
corresponds to GF2
.
diff --git a/v0.3.x/api/galois.Poly.Int/index.html b/v0.3.x/api/galois.Poly.Int/index.html
index cfd1b70e5..16a6f8dcb 100644
--- a/v0.3.x/api/galois.Poly.Int/index.html
+++ b/v0.3.x/api/galois.Poly.Int/index.html
@@ -7820,14 +7820,14 @@
-
-classmethod galois.Poly.Int(integer: int, field: type[Array] | None =
None
) Self
+classmethod galois.Poly.Int(integer: int, field: type[Array] | None = None
) Self
Constructs a polynomial over \(\mathrm{GF}(p^m)\) from its integer representation.
- Parameters:¶
-- integer: int¶
The integer representation of the polynomial \(f(x)\).
+- integer: int¶
The integer representation of the polynomial \(f(x)\).
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
+
- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
corresponds to GF2
.
diff --git a/v0.3.x/api/galois.Poly.One/index.html b/v0.3.x/api/galois.Poly.One/index.html
index f1390d971..c4eeec38d 100644
--- a/v0.3.x/api/galois.Poly.One/index.html
+++ b/v0.3.x/api/galois.Poly.One/index.html
@@ -7792,12 +7792,12 @@
-
-classmethod galois.Poly.One(field: type[Array] | None =
None
) Self
+classmethod galois.Poly.One(field: type[Array] | None = None
) Self
Constructs the polynomial \(f(x) = 1\) over \(\mathrm{GF}(p^m)\).
- Parameters:¶
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
+
- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
corresponds to GF2
.
diff --git a/v0.3.x/api/galois.Poly.Random/index.html b/v0.3.x/api/galois.Poly.Random/index.html
index d6e10b71d..6309fc67b 100644
--- a/v0.3.x/api/galois.Poly.Random/index.html
+++ b/v0.3.x/api/galois.Poly.Random/index.html
@@ -7820,18 +7820,18 @@
-
-classmethod galois.Poly.Random(degree: int, seed: int | numpy.integer | numpy.random._generator.Generator | None =
None
, field: type[Array] | None = None
) Self
+classmethod galois.Poly.Random(degree: int, seed: int | numpy.integer | numpy.random._generator.Generator | None = None
, field: type[Array] | None = None
) Self
Constructs a random polynomial over \(\mathrm{GF}(p^m)\) with degree \(d\).
- Parameters:¶
-- degree: int¶
The degree of the polynomial.
+- degree: int¶
The degree of the polynomial.
-- seed: int | numpy.integer | numpy.random._generator.Generator | None =
None
¶ Non-negative integer used to initialize the PRNG. The default is None
which means that
+
- seed: int | numpy.integer | numpy.random._generator.Generator | None =
None
¶ Non-negative integer used to initialize the PRNG. The default is None
which means that
unpredictable entropy will be pulled from the OS to be used as the seed.
A numpy.random.Generator
can also be passed.
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
+
- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over. The default is None
which
corresponds to GF2
.
@@ -7843,7 +7843,7 @@
Examples
Construct a random degree-5 polynomial over \(\mathrm{GF}(2)\).
In [1]: galois.Poly.Random(5)
-Out[1]: Poly(x^5 + x^3 + x^2, GF(2))
+Out[1]: Poly(x^5 + x^4 + x^3 + x^2 + x + 1, GF(2))
Construct a random degree-5 polynomial over \(\mathrm{GF}(3^5)\) with a given seed. This produces
diff --git a/v0.3.x/api/galois.Poly.Roots/index.html b/v0.3.x/api/galois.Poly.Roots/index.html
index 1d33652ad..d5e766063 100644
--- a/v0.3.x/api/galois.Poly.Roots/index.html
+++ b/v0.3.x/api/galois.Poly.Roots/index.html
@@ -7834,19 +7834,19 @@
-
-classmethod galois.Poly.Roots(roots: ArrayLike, multiplicities: Sequence[int] | ndarray | None =
None
, field: type[Array] | None = None
) Self
+classmethod galois.Poly.Roots(roots: ArrayLike, multiplicities: Sequence[int] | ndarray | None = None
, field: type[Array] | None = None
) Self
Constructs a monic polynomial over \(\mathrm{GF}(p^m)\) from its roots.
- Parameters:¶
- roots: ArrayLike¶
The roots of the desired polynomial.
-- multiplicities: Sequence[int] | ndarray | None =
None
¶ The corresponding root multiplicities. The default is None
which corresponds to
+
- multiplicities: Sequence[int] | ndarray | None =
None
¶ The corresponding root multiplicities. The default is None
which corresponds to
all ones.
-- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over.
+- field: type[Array] | None =
None
¶ The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over.
-None
(default): If the roots are an Array
, they won’t be modified. If the
+
None
(default): If the roots are an Array
, they won’t be modified. If the
roots are not explicitly in a Galois field, they are assumed to be from \(\mathrm{GF}(2)\) and
are converted using galois.GF2(roots)
.
Array
subclass: The roots are explicitly converted to this Galois field using
diff --git a/v0.3.x/api/galois.Poly.Str/index.html b/v0.3.x/api/galois.Poly.Str/index.html
index 1853c23f6..dffd8f7c3 100644
--- a/v0.3.x/api/galois.Poly.Str/index.html
+++ b/v0.3.x/api/galois.Poly.Str/index.html
@@ -7820,14 +7820,14 @@