class galois.Array(numpy.ndarray)

An abstract ndarray subclass over a Galois field or Galois ring.

Abstract

Array is an abstract base class for FieldArray and cannot be instantiated directly.

Constructors

classmethod Identity(size: int, ...) Self

Creates an \(n \times n\) identity matrix.

classmethod Ones(shape: ShapeLike, ...) Self

Creates an array of all ones.

classmethod Random(shape: ShapeLike = (), ...) Self

Creates an array with random elements.

classmethod Range(start: ElementLike, stop, ...) Self

Creates a 1-D array with a range of elements.

classmethod Zeros(shape: ShapeLike, ...) Self

Creates an array of all zeros.

Methods

classmethod compile(mode)

Recompile the just-in-time compiled ufuncs for a new calculation mode.

classmethod repr(...) Generator[None, None, None]

Sets the element representation for all arrays from this FieldArray subclass.

Properties

class property characteristic : int

The characteristic \(p\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^e\) of the Galois ring \(\mathrm{GR}(p^e, m)\).

class property default_ufunc_mode : Literal[jit - lookup] | typing.Literal[jit - calculate] | typing.Literal[python - calculate]

The default compilation mode of the Galois field or Galois ring.

class property degree : int

The degree \(m\) of the Galois field \(\mathrm{GF}(p^m)\) or Galois ring \(\mathrm{GR}(p^e, m)\).

class property dtypes : list[np.dtype]

List of valid integer numpy.dtype values that are compatible with this Galois field or Galois ring.

class property element_repr : Literal[int] | Literal[poly] | Literal[power]

The current element representation of the Galois field or Galois ring.

class property elements : Array

All elements of the Galois field or Galois ring.

class property irreducible_poly : Poly

The irreducible polynomial of the Galois field or Galois ring.

class property name : str

The name of the Galois field or Galois ring.

class property order : int

The order \(p^m\) of the Galois field \(\mathrm{GF}(p^m)\) or \(p^{em}\) of the Galois ring \(\mathrm{GR}(p^e, m)\).

class property primitive_element : Array

A primitive element of the Galois field or Galois ring.

class property ufunc_mode : Literal[jit - lookup] | typing.Literal[jit - calculate] | typing.Literal[python - calculate]

The current compilation mode of the Galois field or Galois ring.

class property ufunc_modes : list[str]

All supported compilation modes of the Galois field or Galois ring.

class property units : Array

All units of the Galois field or Galois ring.