-
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)\).
This function is the inverse operation of the
Vector()constructor. For an array with shape(n1, n2), the output shape is(n1, n2, m). By convention, the vectors are ordered from degree \(m-1\) to degree 0.- Parameters¶
- dtype: DTypeLike | None =
None¶ The
numpy.dtypeof the array elements. The default isNonewhich represents the smallest unsigned data type for thisFieldArraysubclass (the first element indtypes).
- dtype: DTypeLike | None =
- Returns¶
An array over \(\mathrm{GF}(p)\) with last dimension \(m\).
Examples¶
In [1]: GF = galois.GF(3**3, display="poly") In [2]: a = GF([11, 7]); a Out[2]: GF([α^2 + 2, 2α + 1], order=3^3) In [3]: vec = a.vector(); vec Out[3]: GF([[1, 0, 2], [0, 2, 1]], order=3) In [4]: GF.Vector(vec) Out[4]: GF([α^2 + 2, 2α + 1], order=3^3)