From 153614a59645752aac472b4e92f03d48a4272e12 Mon Sep 17 00:00:00 2001 From: mhostetter Date: Thu, 8 Dec 2022 13:52:19 -0500 Subject: [PATCH] Document ways to speed up large field construction --- docs/basic-usage/array-classes.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/basic-usage/array-classes.rst b/docs/basic-usage/array-classes.rst index dff93dc87..19a2f0185 100644 --- a/docs/basic-usage/array-classes.rst +++ b/docs/basic-usage/array-classes.rst @@ -21,6 +21,27 @@ A :obj:`~galois.FieldArray` subclass is created using the class factory function GF = galois.GF(3**5) print(GF.properties) +.. tip:: + :title: Speed up creation of large finite field classes + :collapsible: + + For very large finite fields, the :obj:`~galois.FieldArray` subclass creation time can be reduced by explicitly specifying + :math:`p` and :math:`m`. This eliminates the need to factor the order :math:`p^m`. + + .. ipython:: python + + GF = galois.GF(2, 100) + print(GF.properties) + + Furthermore, if you already know the desired irreducible polynomial is irreducible and the primitive element is a generator of + the multiplicative group, you can specify `verify=False` to skip the verification step. This eliminates the need to factor + :math:`p^m - 1`. + + .. ipython:: python + + GF = galois.GF(109987, 4, irreducible_poly="x^4 + 3x^2 + 100525x + 3", primitive_element="x", verify=False) + print(GF.properties) + The `GF` class is a subclass of :obj:`~galois.FieldArray` and a subclasses of :obj:`~numpy.ndarray`. .. ipython:: python