Skip to content

Commit

Permalink
Fix equations using |
Browse files Browse the repository at this point in the history
Fixes #554
  • Loading branch information
mhostetter committed Jul 6, 2024
1 parent 2a68e25 commit 11e5102
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/basic-usage/array-arithmetic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Advanced arithmetic
:collapsible:

The Discrete Fourier Transform (DFT) of size $n$ over the finite field $\mathrm{GF}(p^m)$ exists when
there exists a primitive $n$-th root of unity. This occurs when $n\ |\ p^m - 1$.
there exists a primitive $n$-th root of unity. This occurs when $n \mid p^m - 1$.

.. ipython-with-reprs:: int,poly,power

Expand All @@ -310,7 +310,7 @@ Advanced arithmetic
:collapsible:

The inverse Discrete Fourier Transform (DFT) of size $n$ over the finite field $\mathrm{GF}(p^m)$
exists when there exists a primitive $n$-th root of unity. This occurs when $n\ |\ p^m - 1$.
exists when there exists a primitive $n$-th root of unity. This occurs when $n \mid p^m - 1$.

.. ipython-with-reprs:: int,poly,power

Expand Down
8 changes: 4 additions & 4 deletions src/galois/_codes/_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ def generator_to_parity_check_matrix(G: FieldArray) -> FieldArray:
Arguments:
G: The $(k, n)$ generator matrix $\mathbf{G}$ in systematic form
$\mathbf{G} = [\mathbf{I}_{k,k}\ |\ \mathbf{P}_{k,n-k}]$.
$\mathbf{G} = [\mathbf{I}_{k,k} \mid \mathbf{P}_{k,n-k}]$.
Returns:
The $(n-k, n)$ parity-check matrix
$\mathbf{H} = [-\mathbf{P}_{k,n-k}^T\ |\ \mathbf{I}_{n-k,n-k}]$`.
$\mathbf{H} = [-\mathbf{P}_{k,n-k}^T \mid \mathbf{I}_{n-k,n-k}]$`.
Examples:
.. ipython:: python
Expand Down Expand Up @@ -423,10 +423,10 @@ def parity_check_to_generator_matrix(H: FieldArray) -> FieldArray:
Arguments:
H: The $(n-k, n)$ parity-check matrix $\mathbf{G}$ in systematic form
$\mathbf{H} = [-\mathbf{P}_{k,n-k}^T\ |\ \mathbf{I}_{n-k,n-k}]$`.
$\mathbf{H} = [-\mathbf{P}_{k,n-k}^T \mid \mathbf{I}_{n-k,n-k}]$`.
Returns:
The $(k, n)$ generator matrix $\mathbf{G} = [\mathbf{I}_{k,k}\ |\ \mathbf{P}_{k,n-k}]$.
The $(k, n)$ generator matrix $\mathbf{G} = [\mathbf{I}_{k,k} \mid \mathbf{P}_{k,n-k}]$.
Examples:
.. ipython:: python
Expand Down
2 changes: 1 addition & 1 deletion src/galois/_modular.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def euler_phi(n: int) -> int:
Notes:
This function implements the Euler totient function
$$\phi(n) = n \prod_{p\ |\ n} \bigg(1 - \frac{1}{p}\bigg) = \prod_{i=1}^{k} p_i^{e_i-1} \big(p_i - 1\big)$$
$$\phi(n) = n \prod_{p \mid n} \bigg(1 - \frac{1}{p}\bigg) = \prod_{i=1}^{k} p_i^{e_i-1} \big(p_i - 1\big)$$
for prime $p$ and the prime factorization $n = p_1^{e_1} \dots p_k^{e_k}$.
Expand Down
14 changes: 7 additions & 7 deletions src/galois/_polys/_conway.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def is_conway(f: Poly, search: bool = False) -> bool:
Notes:
A degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(p)$ is the *Conway polynomial*
$C_{p,m}(x)$ if it is monic, primitive, compatible with Conway polynomials $C_{p,n}(x)$ for all
$n\ |\ m$, and is lexicographically first according to a special ordering.
$n \mid m$, and is lexicographically first according to a special ordering.
A Conway polynomial $C_{p,m}(x)$ is *compatible* with Conway polynomials $C_{p,n}(x)$ for
$n\ |\ m$ if $C_{p,n}(x^r)$ divides $C_{p,m}(x)$, where $r = \frac{p^m - 1}{p^n - 1}$.
$n \mid m$ if $C_{p,n}(x^r)$ divides $C_{p,m}(x)$, where $r = \frac{p^m - 1}{p^n - 1}$.
The Conway lexicographic ordering is defined as follows. Given two degree-$m$ polynomials
$g(x) = \sum_{i=0}^m g_i x^i$ and $h(x) = \sum_{i=0}^m h_i x^i$, then $g < h$ if and only if
Expand Down Expand Up @@ -106,7 +106,7 @@ def is_conway(f: Poly, search: bool = False) -> bool:
def is_conway_consistent(f: Poly, search: bool = False) -> bool:
r"""
Determines whether the degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(p)$ is consistent
with smaller Conway polynomials $C_{p,n}(x)$ for all $n\ |\ m$.
with smaller Conway polynomials $C_{p,n}(x)$ for all $n \mid m$.
.. question:: Why is this a method and not a property?
:collapsible:
Expand All @@ -123,7 +123,7 @@ def is_conway_consistent(f: Poly, search: bool = False) -> bool:
Returns:
`True` if the polynomial $f(x)$ is primitive and consistent with smaller Conway polynomials
$C_{p,n}(x)$ for all $n\ |\ m$.
$C_{p,n}(x)$ for all $n \mid m$.
Raises:
LookupError: If `search=False` and a smaller Conway polynomial $C_{p,n}$ is not found in Frank Luebeck's
Expand All @@ -134,7 +134,7 @@ def is_conway_consistent(f: Poly, search: bool = False) -> bool:
Notes:
A degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(p)$ is *compatible* with Conway polynomials
$C_{p,n}(x)$ for $n\ |\ m$ if $C_{p,n}(x^r)$ divides $f(x)$, where
$C_{p,n}(x)$ for $n \mid m$ if $C_{p,n}(x^r)$ divides $f(x)$, where
$r = \frac{p^m - 1}{p^n - 1}$.
A Conway-consistent polynomial has all the properties of a Conway polynomial except that it is not
Expand Down Expand Up @@ -230,10 +230,10 @@ def conway_poly(characteristic: int, degree: int, search: bool = False) -> Poly:
Notes:
A degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(p)$ is the *Conway polynomial*
$C_{p,m}(x)$ if it is monic, primitive, compatible with Conway polynomials $C_{p,n}(x)$ for all
$n\ |\ m$, and is lexicographically first according to a special ordering.
$n \mid m$, and is lexicographically first according to a special ordering.
A Conway polynomial $C_{p,m}(x)$ is *compatible* with Conway polynomials $C_{p,n}(x)$ for
$n\ |\ m$ if $C_{p,n}(x^r)$ divides $C_{p,m}(x)$, where $r = \frac{p^m - 1}{p^n - 1}$.
$n \mid m$ if $C_{p,n}(x^r)$ divides $C_{p,m}(x)$, where $r = \frac{p^m - 1}{p^n - 1}$.
The Conway lexicographic ordering is defined as follows. Given two degree-$m$ polynomials
$g(x) = \sum_{i=0}^m g_i x^i$ and $h(x) = \sum_{i=0}^m h_i x^i$, then $g < h$ if and only if
Expand Down
2 changes: 1 addition & 1 deletion src/galois/_polys/_irreducible.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def is_irreducible(f: Poly) -> bool:
This function implements Rabin's irreducibility test. It says a degree-$m$ polynomial $f(x)$
over $\mathrm{GF}(q)$ for prime power $q$ is irreducible if and only if
$f(x)\ |\ (x^{q^m} - x)$ and $\textrm{gcd}(f(x),\ x^{q^{m_i}} - x) = 1$ for
$f(x) \mid (x^{q^m} - x)$ and $\textrm{gcd}(f(x),\ x^{q^{m_i}} - x) = 1$ for
$1 \le i \le k$, where $m_i = m/p_i$ for the $k$ prime divisors $p_i$ of $m$.
References:
Expand Down
2 changes: 1 addition & 1 deletion src/galois/_polys/_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def is_conway(self) -> bool:
def is_conway_consistent(self) -> bool:
r"""
Determines whether the degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(p)$ is consistent
with smaller Conway polynomials $C_{p,n}(x)$ for all $n\ |\ m$.
with smaller Conway polynomials $C_{p,n}(x)$ for all $n \mid m$.
"""
# Will be monkey-patched in `_conway.py`
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion src/galois/_polys/_primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def is_primitive(f: Poly) -> bool:
Notes:
A degree-$m$ polynomial $f(x)$ over $\mathrm{GF}(q)$ is *primitive* if it is
irreducible and $f(x)\ |\ (x^k - 1)$ for $k = q^m - 1$ and no $k$ less than
irreducible and $f(x) \mid (x^k - 1)$ for $k = q^m - 1$ and no $k$ less than
$q^m - 1$.
References:
Expand Down
4 changes: 2 additions & 2 deletions src/galois/_prime.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def legendre_symbol(a: int, p: int) -> int:
.. math::
\bigg(\frac{a}{p}\bigg) =
\begin{cases}
0, & p\ |\ a
0, & p \mid a
1, & a \in Q_p
Expand Down Expand Up @@ -1278,7 +1278,7 @@ def f(x):
@export
def divisors(n: int) -> list[int]:
r"""
Computes all positive integer divisors $d$ of the integer $n$ such that $d\ |\ n$.
Computes all positive integer divisors $d$ of the integer $n$ such that $d \mid n$.
Arguments:
n: An integer.
Expand Down

0 comments on commit 11e5102

Please sign in to comment.