Matrices and polynomials over field Z/2Z. Documentation for files will be found here.
Example 1
a = F2Polynomial([1, 1, 1, 0])
b = F2Polynomial([0, 1, 0, 0])
c = F2Polynomial([1, 1, 1, 1])
d = F2Polynomial([1, 0, 1, 1])
f = F2Matrix([[a, b],
[c, d]])
g = F2Matrix([[d, c],
[b, a]])
h = f + g
print(str(f), " + \n")
print(str(g), " = \n")
print(str(h), "\n")
will print out:
| 1 + D + D^2, D|
|1 + D + D^2 + D^3, 1 + D^2 + D^3| +
| 1 + D^2 + D^3, 1 + D + D^2 + D^3|
| D, 1 + D + D^2| =
| D + D^3, 1 + D^2 + D^3|
|1 + D^2 + D^3, D + D^3|
Example 2
a = F2Polynomial([1, 0, 0, 0])
b = F2Polynomial([1, 1, 0, 0])
c = F2Polynomial([1, 1, 1, 0])
d = F2Polynomial([1, 1, 1, 1])
f = F2Matrix([[a, b],
[c, d]])
g = F2Matrix([[d, c],
[b, a]])
h = f * g
print(str(f), " * \n")
print(str(g), " = \n")
print(str(h), "\n")
will print out:
| 1, 1 + D|
| 1 + D + D^2, 1 + D + D^2 + D^3| *
|1 + D + D^2 + D^3, 1 + D + D^2|
| 1 + D, 1| =
| D + D^3, D^2|
|D^2 + D^3 + D^4 + D^5, D + D^3 + D^4|
Example 3
a = F2Polynomial([1, 0, 0, 0])
b = F2Polynomial([1, 1, 0, 0])
c = F2Polynomial([1, 1, 1, 0])
d = F2Polynomial([1, 1, 1, 1])
f = F2Matrix([[a, b],
[c, d]])
h = f ** 2
print(str(f), " ** 2 = \n")
print(str(h), "\n")
will print out:
| 1, 1 + D|
| 1 + D + D^2, 1 + D + D^2 + D^3| ** 2 =
| D^3, D + D^4|
| D + D^3 + D^5, D^2 + D^3 + D^4 + D^6|
-
F2Polynomial
-
__init__
-
__str__
-
degree
-
__add__
-
__iadd__
-
__mul__
-
__imul__
-
__pow__
-
evaluate
-
-
dotProduct
-
F2Matrix
-
__init__
-
__str__
-
__add__
-
__iadd__
-
transpose
-
__mul__
-
__imul__
-
__pow__
-
changeColumns
-
changeRows
-
addColumns
-
-
findPivot
-
smithNormalForm