galois v0.0.28
Released May 11, 2022
Changes
- Modified JIT-compiled functions to use explicit calculation or lookup tables. Previously, JIT functions only used explicit calculation routines. Now all ufuncs and functions are JIT-compiled once on first invocation, but use the current
ufunc_mode
to determine the arithmetic used. This provides a significant performance boost for fields which use lookup tables by default. The greatest performance improvement can be seen in$\mathrm{GF}(p^m)$ fields. (#354)- Polynomial multiplication is 210% faster.
In [2]: GF = galois.GF(7**5) In [3]: f = galois.Poly.Random(10, seed=1, field=GF) In [4]: g = galois.Poly.Random(5, seed=2, field=GF) # v0.0.27 In [6]: %timeit f * g 168 µs ± 722 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each) # v0.0.28 In [6]: %timeit f * g 54 µs ± 574 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
- Polynomial modular exponentiation is 5,310% faster.
# v0.0.27 In [8]: %timeit pow(f, 123456789, g) 5.9 ms ± 9.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) # v0.0.28 In [8]: %timeit pow(f, 123456789, g) 109 µs ± 527 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
- Matrix multiplication is 6,690% faster.
In [9]: A = GF.Random((100, 100), seed=1) In [10]: B = GF.Random((100, 100), seed=2) # v0.0.27 In [12]: %timeit A @ B 1.1 s ± 4.76 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # v0.0.28 In [12]: %timeit A @ B 16.2 ms ± 50.1 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
- Polynomial multiplication is 210% faster.
- Simplified
FieldArray
subclasses'repr()
andstr()
. Since these classes may be displayed in error logs, a concise representation is necessary. (#350)>>> GF = galois.GF(3**5) >>> GF <class 'galois.GF(3^5)'>
- Added back
FieldArray.properties
for a detailed description of the finite field's relevant properties. (#350)>>> GF = galois.GF(3**5) >>> print(GF.properties) Galois Field: name: GF(3^5) characteristic: 3 degree: 5 order: 243 irreducible_poly: x^5 + 2x + 1 is_primitive_poly: True primitive_element: x
- Increased code coverage.
- Various documentation fixes.
Contributors
- Matt Hostetter (@mhostetter)
Commits
4e0a68b Version bump to 0.0.28
ab0163f Add release notes for v0.0.28
7a4b6b2 Ensure GF(2)
is compiled by default
d488ceb Add polynomial "right" arithmetic
662e294 Add remainder unit test
0bc0198 Add divmod
unit test
0f2c7ea Indicate no test coverage where necessary
c98df85 Fix indentation of code blocks in bulleted lists
8d71f8a Fix hiding dot()
method from Array
API docs
2078aa9 Provide an additional benchmark example
b5493e9 Adjust benchmark run array lengths
ffae1ae Create and utilize ufunc and function dispatchers
fc9265f Rework polynomial JIT function structure
2ca4d16 Rework FEC code JIT function structure
220a669 Fix Literal
defaults in overloaded functions
b8f0839 Rename Ufuncs
to UFuncs
25064e9 Always dynamically compile ufuncs
e356fb9 Update sphinx-immaterial
version
bcc8cba Fix incorrect reference
f828267 Clean up explicit calculation inheritance
aee74b7 Clean up class str()
and repr()
c8372bb Clean up API table of contents
1ddbfeb Prevent "Parameters" sections in docs API
657326f Update API TOC structure
0788cf3 Fix galois.typing
module documentation links
c8ab245 Clean up Array default monkey patching
8885574 Improve type hints
6b34647 Rename mixin classes
6aa410a Move polynomial JIT functions into their own file
6d5b872 Restructure linear algebra code
124aeb1 Inherit from ABC
for abstract base classes
152366a Move ufunc- and function-overridding code
01cd714 Use public properties instead of internal attributes
e9d6806 Move placeholder factory functions into _factory.py
eefce37 Move all type aliases into typing.py
97a391d Move ArrayMeta
to _meta.py
03919da Merge metaclasses into one in _meta.py
39ec643 Additional fix when monkey-patching for docs
55c5d8c Fix missing type signatures