galois v0.1.2
Released November 9, 2022
Changes
- Fixed major inefficiency when dividing an array by a scalar or smaller (broadcasted) array. (#429)
In [1]: import galois In [2]: GF = galois.GF(31**5) In [3]: x = GF.Random(10_000, seed=1); x Out[3]: GF([13546990, 14653018, 21619804, ..., 15507037, 24669161, 19116362], order=31^5) In [4]: y = GF.Random(1, seed=2); y Out[4]: GF([23979074], order=31^5) # v0.1.1 In [5]: %timeit x / y 261 ms ± 5.67 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # v0.1.2 In [5]: %timeit x / y 8.23 ms ± 51 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
- Optimized
lagrange_poly()
by adding a custom JIT-compilable routine. (#432)In [1]: import galois In [2]: GF = galois.GF(13693) In [3]: x = GF.Random(100, seed=1) In [4]: y = GF.Random(100, seed=2) # v0.1.1 In [5]: %timeit galois.lagrange_poly(x, y) 2.85 s ± 3.25 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # v0.1.2 In [5]: %timeit galois.lagrange_poly(x, y) 4.77 ms ± 190 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
- Added ability in
FieldArray.row_reduce()
to solve for an identity matrix on the right side of a matrix using theeye
keyword argument. (#426)>>> import galois >>> GF = galois.GF(31) >>> A = GF([[16, 12, 1, 25], [1, 10, 27, 29], [1, 0, 3, 19]]) >>> A.row_reduce() GF([[ 1, 0, 0, 11], [ 0, 1, 0, 7], [ 0, 0, 1, 13]], order=31) >>> A.row_reduce(eye="right") GF([[ 5, 1, 0, 0], [27, 0, 1, 0], [17, 0, 0, 1]], order=31)
- Removed comma separators in
FieldArray.__str__()
to be consistent with NumPy's use ofstr()
andrepr()
. (#432)>>> import galois >>> GF = galois.GF(3**5, display="power") >>> x = GF.Random((3, 4), seed=1) >>> x GF([[α^185, α^193, α^49, α^231], [ α^81, α^60, α^5, α^41], [ α^50, α^161, α^151, α^171]], order=3^5) >>> print(x) [[α^185 α^193 α^49 α^231] [ α^81 α^60 α^5 α^41] [ α^50 α^161 α^151 α^171]]
- Modernized type annotations to use abbreviated notation. For example,
a | b
instead ofUnion[a, b]
. (#418) - Added
Self
type annotation where appropriate. (#420) - Updated documentation and improved examples. (#424, #430)
Contributors
- Matt Hostetter (@mhostetter)
Commits
e07461b Add release notes for v0.1.2
db88a80 Don't display comma separator in FieldArray.__str__()
81dfe9a JIT compile construction of Lagrange polys
7eed640 JIT compile polynomial subtraction routine
3d090c8 JIT compile polynomial addition routine
7e8a688 Make lagrange_poly()
unit tests more robust
8b8a40e Add documentation about NumPy's subok
kwarg
b02314f Fix typo in release notes
2a27178 Better support for np.convolve()
for prime fields
8a692ff Add unit tests for np.convolve()
b131da1 Add dropdown tips to docs
6e08914 Add polynomial composition example
83cf2fc Add additional ipython-with-reprs
usage
01f86f1 Clean up arithmetic examples
6ee9d79 Convert docs to use new ipython-with-reprs
directive
670600d Add custom ipython-with-reprs
Sphinx directive
c17cd6a Fix inefficiency when dividing by a scalar
0e317c3 Add ability to row_reduce()
to solve for I on the right side
f165b02 Add verify_literal
helper function
eb007cf Fix typo in array divmod example
a973c5d Change admonition styling
251954e Fix <details>
sections for arithmetic examples
abdb71b Upgrade to latest Sphinx Immaterial
85b1b4e Upgrade to Sphinx 5.3
dc49c7c Use built-in Material for Mkdocs linked content tabs instead of sphinx-design
tabs
d06d385 Upgrade to latest version of sphinx-immaterial
9e25955 Remove pytest-benchmark
from [dev]
dependencies until fixed
4fbc26f Add more debug for docs build on package release
954742d Upgrade actions/download-artifact
to v3
10aefa1 Upgrade actions/upload-artifact
to v3
e3dc09a Upgrade codecov/codecov-action
to v3
4f4b4c3 Upgrade tj-action/glob
action to v15
6fe28de Upgrade GitHub Actions set-output
command
29f2ff5 Upgrade setup-python
action to v4
e3af994 Fix NumPy set_printoptions()
demo
bc72d18 Fix display of union "short" type annotations in Sphinx
bee9b75 Use PEP 585 type annotations in documentation
bbc06f1 Add SPHINX_BUILD
flag back
5991ae2 Use Self
type hint throughout library
2a4d945 Require typing_extensions
4.0.0 or greater for Self
46ef7be Minor modification to ValueError
messages
8677e90 Fix potentially unbound variable
78ec48c Fix dangerous default value of empty dict
f7b5c8e Convert List[a, b]
to list[a, b]
3aefcea Convert Tuple[a, b]
to tuple[a, b]
0a4ec79 Convert Optional[a]
to a | None
a9a765e Convert Union[a, b]
to a | b
79655f2 Move view without verification to Array
to fix type hinting
0eacac3 Run unit tests for code coverage on master
05f8c5e Run package build CI on master
76a9822 Run linting CI on master
72ee31d Use v3 of the checkout
GitHub action
5e50c81 Add workflow dispatch to build versioned docs on demand