galois¶
Subpackages¶
A subpackage containing type hints for the |
Class factory functions¶
|
Alias of |
|
Creates a |
Abstract base classes¶
|
A |
|
A |
Classes¶
|
A primitive, narrow-sense binary \(\textrm{BCH}(n, k)\) code. |
|
A Fibonacci linear-feedback shift register (LFSR). |
|
A |
|
A Galois linear-feedback shift register (LFSR). |
|
A univariate polynomial \(f(x)\) over \(\mathrm{GF}(p^m)\). |
|
A general \(\textrm{RS}(n, k)\) code. |
Functions¶
Determines if the arguments are pairwise coprime. |
|
|
Returns a list of \((n, k, t)\) tuples of valid primitive binary BCH codes. |
Finds the minimal polynomial \(c(x)\) that produces the linear recurrent sequence \(y\). |
|
Finds the smallest positive integer \(m\) such that \(a^m \equiv 1\ (\textrm{mod}\ n)\) for every integer \(a\) in \([1, n)\) that is coprime to \(n\). |
|
|
Returns the Conway polynomial \(C_{p,m}(x)\) over \(\mathrm{GF}(p)\) with degree \(m\). |
|
Solves the simultaneous system of congruences for \(x\). |
|
Returns the sum of \(k\)-th powers of the positive divisors of \(n\). |
|
Computes all positive integer divisors \(d\) of the integer \(n\) such that \(d\ |\ n\). |
|
Finds the multiplicands of \(a\) and \(b\) such that \(a s + b t = \mathrm{gcd}(a, b)\). |
|
Counts the positive integers (totatives) in \([1, n)\) that are coprime to \(n\). |
|
Computes the prime factors of a positive integer or the irreducible factors of a non-constant, monic polynomial. |
|
Determines if \(n\) is composite using Fermat's primality test. |
|
Finds the greatest common divisor of \(a\) and \(b\). |
Converts the generator matrix \(\mathbf{G}\) of a linear \([n, k]\) code into its parity-check matrix \(\mathbf{H}\). |
|
Returns the current print options for the package. |
|
|
Computes \(x = \lfloor\textrm{log}_b(n)\rfloor\) such that \(b^x \le n < b^{x + 1}\). |
|
Computes the Inverse Number-Theoretic Transform (INTT) of \(X\). |
|
Computes \(x = \lfloor n^{\frac{1}{k}} \rfloor\) such that \(x^k \le n < (x + 1)^k\). |
|
Returns a monic irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\). |
|
Iterates through all monic irreducible polynomials \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\). |
|
Determines if \(n\) is composite. |
|
Determines whether the multiplicative group \((\mathbb{Z}/n\mathbb{Z}){^\times}\) is cyclic. |
Determines if \(n\) is a perfect power \(n = c^e\) with \(e > 1\). |
|
|
Determines if the integer \(n\) is \(B\)-powersmooth. |
|
Determines if \(n\) is prime. |
Determines if \(n\) is a prime power \(n = p^k\) for prime \(p\) and \(k \ge 1\). |
|
|
Determines if \(g\) is a primitive element of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\). |
|
Determines if \(g\) is a primitive root modulo \(n\). |
|
Determines if the integer \(n\) is \(B\)-smooth. |
Determines if an integer or polynomial is square-free. |
|
|
Computes \(x = \lfloor\sqrt{n}\rfloor\) such that \(x^2 \le n < (x + 1)^2\). |
|
Computes the Jacobi symbol \((\frac{a}{n})\). |
|
Computes the Kronecker symbol \((\frac{a}{n})\). |
|
Returns the \(k\)-th prime. |
|
Computes the Lagrange interpolating polynomial \(L(x)\) such that \(L(x_i) = y_i\). |
|
Computes the least common multiple of the arguments. |
|
Computes the Legendre symbol \((\frac{a}{p})\). |
|
Returns Matlab's default primitive polynomial \(f(x)\) over \(\mathrm{GF}(p)\) with degree \(m\). |
|
Returns all known Mersenne exponents \(e\) for \(e \le n\). |
|
Returns all known Mersenne primes \(p\) for \(p \le 2^n - 1\). |
|
Determines if \(n\) is composite using the Miller-Rabin primality test. |
|
Returns the nearest prime \(p\), such that \(p > n\). |
|
Computes the Number-Theoretic Transform (NTT) of \(x\). |
Converts the parity-check matrix \(\mathbf{H}\) of a linear \([n, k]\) code into its generator matrix \(\mathbf{G}\). |
|
Returns the integer base \(c\) and exponent \(e\) of \(n = c^e\). |
|
|
Attempts to find a non-trivial factor of \(n\) if it has a prime factor \(p\) such that \(p-1\) is \(B\)-smooth. |
|
Attempts to find a non-trivial factor of \(n\) using cycle detection. |
|
Converts the generator polynomial \(g(x)\) into the generator matrix \(\mathbf{G}\) for an \([n, k]\) cyclic code. |
|
Returns the nearest prime \(p\), such that \(p \le n\). |
|
Returns all primes \(p\) for \(p \le n\). |
|
Finds a primitive element \(g\) of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\). |
|
Finds all primitive elements \(g\) of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\). |
|
Returns a monic primitive polynomial \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\). |
|
Iterates through all monic primitive polynomials \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\). |
|
Finds a primitive root modulo \(n\) in the range |
|
Iterates through all primitive roots modulo \(n\) in the range |
|
A context manager to temporarily modify the print options for the package. |
|
Computes the product of the arguments. |
|
Returns a random prime \(p\) with \(b\) bits, such that \(2^b \le p < 2^{b+1}\). |
|
Converts the generator polynomial roots into the parity-check matrix \(\mathbf{H}\) for an \([n, k]\) cyclic code. |
|
Modifies the print options for the package. |
|
Returns the positive integers (totatives) in \([1, n)\) that are coprime to \(n\). |
|
Finds all the prime factors \(p_i^{e_i}\) of \(n\) for \(p_i \le B\). |