-
classmethod galois.FieldArray.Vector(array: ArrayLike, dtype: DTypeLike | None =
None
) FieldArray Converts length-\(m\) vectors over the prime subfield \(\mathrm{GF}(p)\) to an array over \(\mathrm{GF}(p^m)\).
- Parameters:¶
- array: ArrayLike¶
An array over \(\mathrm{GF}(p)\) with last dimension \(m\). An array with shape
(n1, n2, m)
has output shape(n1, n2)
. By convention, the vectors are ordered from degree \(m-1\) to degree 0.- dtype: DTypeLike | None =
None
¶ The
numpy.dtype
of the array elements. The default isNone
which represents the smallest unsigned data type for thisFieldArray
subclass (the first element indtypes
).
- Returns:¶
An array over \(\mathrm{GF}(p^m)\).
Notes¶
This method is the inverse of the
vector()
method.Examples¶
In [1]: GF = galois.GF(3**3) In [2]: a = GF.Vector([[1, 0, 2], [0, 2, 1]]); a Out[2]: GF([11, 7], order=3^3) In [3]: a.vector() Out[3]: GF([[1, 0, 2], [0, 2, 1]], order=3)
In [4]: GF = galois.GF(3**3, repr="poly") In [5]: a = GF.Vector([[1, 0, 2], [0, 2, 1]]); a Out[5]: GF([α^2 + 2, 2α + 1], order=3^3) In [6]: a.vector() Out[6]: GF([[1, 0, 2], [0, 2, 1]], order=3)
In [7]: GF = galois.GF(3**3, repr="power") In [8]: a = GF.Vector([[1, 0, 2], [0, 2, 1]]); a Out[8]: GF([α^12, α^16], order=3^3) In [9]: a.vector() Out[9]: GF([[1, 0, 2], [0, 2, 1]], order=3)