Add GF2 type for Galois field elements

- add `GF2` class in the `lalib.elements` sub-package
  implementing a typical Galois field with two elements
- the singleton objects `one` and `zero` are the concrete
  instances of the `GF2` type for the end users
- besides the typical Galois arithmetic, `one` and `zero`
  behave like the built-in numbers `1` and `0`
  and implement the `numbers.Rational` interface
- add exhaustive docstrings with usage examples
- add (unit) test cases with 100% coverage
This commit is contained in:
Alexander Hess 2024-09-18 18:04:35 +02:00
commit 3cecf0d989
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
6 changed files with 1381 additions and 1 deletions

2
poetry.lock generated
View file

@ -1674,4 +1674,4 @@ type = ["pytest-mypy"]
[metadata]
lock-version = "2.0"
python-versions = "^3.9"
content-hash = "3a34bd29eb4226a6054fe5ddba556605fcd621ceff7661334edf429d715c320f"
content-hash = "e9e490a864511852844926112978e57c1421328f6231437f8f280ddfc88cecde"