Skip to content

Commit

Permalink
Clean up vector space method docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jul 14, 2022
1 parent d9f6fdb commit 9fc2b29
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions galois/_fields/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,14 +1627,18 @@ def row_space(self) -> FieldArray:
Examples
--------
The :func:`row_space` method defines basis vectors (its rows) that span the row space of :math:`\mathbf{A}`.
The dimension of the row space and left null space sum to :math:`m`.
.. ipython:: python
m, n = 5, 3
GF = galois.GF(31)
A = GF.Random((m, n)); A
R = A.row_space(); R
The dimension of the row space and left null space sum to :math:`m`.
.. ipython:: python
LN = A.left_null_space(); LN
R.shape[0] + LN.shape[0] == m
"""
Expand Down Expand Up @@ -1670,14 +1674,18 @@ def column_space(self) -> FieldArray:
Examples
--------
The :func:`column_space` method defines basis vectors (its rows) that span the column space of :math:`\mathbf{A}`.
The dimension of the column space and null space sum to :math:`n`.
.. ipython:: python
m, n = 3, 5
GF = galois.GF(31)
A = GF.Random((m, n)); A
C = A.column_space(); C
The dimension of the column space and null space sum to :math:`n`.
.. ipython:: python
N = A.null_space(); N
C.shape[0] + N.shape[0] == n
"""
Expand Down Expand Up @@ -1709,22 +1717,26 @@ def left_null_space(self) -> FieldArray:
Examples
--------
The :func:`left_null_space` method defines basis vectors (its rows) that span the left null space of :math:`\mathbf{A}`.
The dimension of the row space and left null space sum to :math:`m`.
.. ipython:: python
m, n = 5, 3
GF = galois.GF(31)
A = GF.Random((m, n)); A
R = A.row_space(); R
LN = A.left_null_space(); LN
R.shape[0] + LN.shape[0] == m
The left null space is the set of vectors that sum the rows to 0.
.. ipython:: python
LN @ A
The dimension of the row space and left null space sum to :math:`m`.
.. ipython:: python
R = A.row_space(); R
R.shape[0] + LN.shape[0] == m
"""
field = type(self)
A = self
Expand Down Expand Up @@ -1768,22 +1780,26 @@ def null_space(self) -> FieldArray:
Examples
--------
The :func:`null_space` method defines basis vectors (its rows) that span the null space of :math:`\mathbf{A}`.
The dimension of the column space and null space sum to :math:`n`.
.. ipython:: python
m, n = 3, 5
GF = galois.GF(31)
A = GF.Random((m, n)); A
C = A.column_space(); C
N = A.null_space(); N
C.shape[0] + N.shape[0] == n
The null space is the set of vectors that sum the columns to 0.
.. ipython:: python
A @ N.T
The dimension of the column space and null space sum to :math:`n`.
.. ipython:: python
C = A.column_space(); C
C.shape[0] + N.shape[0] == n
"""
A = self
if not A.ndim == 2:
Expand Down

0 comments on commit 9fc2b29

Please sign in to comment.