Skip to content

Commit

Permalink
Deploy 737239b
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter authored and github-actions[bot] committed Oct 1, 2023
1 parent 1bd061b commit b29f312
Show file tree
Hide file tree
Showing 78 changed files with 411 additions and 365 deletions.
Binary file modified v0.3.x/.doctrees/api/galois.BCH.decode.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.BCH.detect.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.BCH.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.BCH.encode.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.Random.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.characteristic_poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.column_space.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.left_null_space.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.log.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.minimal_poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.null_space.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.FieldArray.row_space.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.Poly.Random.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.Poly.derivative.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.Poly.field.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.Poly.is_irreducible.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.ReedSolomon.decode.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.ReedSolomon.detect.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.ReedSolomon.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.ReedSolomon.encode.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.crt.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.fermat_primality_test.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.irreducible_poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.irreducible_polys.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.lagrange_poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.primitive_element.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.primitive_poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.primitive_polys.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.primitive_root.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.primitive_roots.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.prod.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/api/galois.typing.ShapeLike.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/basic-usage/array-creation.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/basic-usage/element-representation.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/basic-usage/poly.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/environment.pickle
Binary file not shown.
Binary file modified v0.3.x/.doctrees/getting-started.doctree
Binary file not shown.
Binary file modified v0.3.x/.doctrees/release-notes/v0.3.doctree
Binary file not shown.
17 changes: 17 additions & 0 deletions v0.3.x/_sources/release-notes/v0.3.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,20 @@ tocdepth: 2
### Contributors

- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))

## v0.3.6

*Released October 1, 2023*

### Changes

- Added support for NumPy 1.25. ([#507](https://github.com/mhostetter/galois/pull/507))
- Added support for Numba 0.58. ([#507](https://github.com/mhostetter/galois/pull/507))
- Fixed rare overflow with computing a large modular exponentiation of polynomials. ([#488](https://github.com/mhostetter/galois/pull/488))
- Resolved various deprecations warnings with NumPy 1.25. ([#492](https://github.com/mhostetter/galois/pull/492))

### Contributors

- Iyán Méndez Veiga ([@iyanmv](https://github.com/iyanmv))
- [@Lasagnenator](https://github.com/Lasagnenator)
- Matt Hostetter ([@mhostetter](https://github.com/mhostetter))
80 changes: 40 additions & 40 deletions v0.3.x/api/galois.BCH.decode/index.html

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions v0.3.x/api/galois.BCH.detect/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7828,10 +7828,10 @@
<span class="gp">In [2]: </span><span class="n">GF</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">field</span>

<span class="gp">In [3]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">(</span><span class="n">bch</span><span class="o">.</span><span class="n">k</span><span class="p">);</span> <span class="n">m</span>
<span class="gh">Out[3]: </span><span class="go">GF([0, 0, 0, 0, 1, 1, 1], order=2)</span>
<span class="gh">Out[3]: </span><span class="go">GF([0, 0, 0, 1, 0, 1, 1], order=2)</span>

<span class="gp">In [4]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[4]: </span><span class="go">GF([0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], order=2)</span>
<span class="gh">Out[4]: </span><span class="go">GF([0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], order=2)</span>
</code></pre></div>
</div>
<p>Detect no errors in the valid codeword.</p>
Expand All @@ -7844,7 +7844,7 @@
<span class="gh">Out[6]: </span><span class="go">5</span>

<span class="gp">In [7]: </span><span class="n">c</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="n">bch</span><span class="o">.</span><span class="n">d</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">^=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">c</span>
<span class="gh">Out[7]: </span><span class="go">GF([1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], order=2)</span>
<span class="gh">Out[7]: </span><span class="go">GF([1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], order=2)</span>

<span class="gp">In [8]: </span><span class="n">bch</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
<span class="gh">Out[8]: </span><span class="go">True</span>
Expand All @@ -7858,10 +7858,10 @@
<span class="gp">In [10]: </span><span class="n">GF</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">field</span>

<span class="gp">In [11]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">(</span><span class="n">bch</span><span class="o">.</span><span class="n">k</span> <span class="o">-</span> <span class="mi">3</span><span class="p">);</span> <span class="n">m</span>
<span class="gh">Out[11]: </span><span class="go">GF([0, 1, 0, 0], order=2)</span>
<span class="gh">Out[11]: </span><span class="go">GF([0, 0, 0, 0], order=2)</span>

<span class="gp">In [12]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[12]: </span><span class="go">GF([0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], order=2)</span>
<span class="gh">Out[12]: </span><span class="go">GF([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], order=2)</span>
</code></pre></div>
</div>
<p>Detect no errors in the valid codeword.</p>
Expand All @@ -7874,7 +7874,7 @@
<span class="gh">Out[14]: </span><span class="go">5</span>

<span class="gp">In [15]: </span><span class="n">c</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="n">bch</span><span class="o">.</span><span class="n">d</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">^=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">c</span>
<span class="gh">Out[15]: </span><span class="go">GF([1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0], order=2)</span>
<span class="gh">Out[15]: </span><span class="go">GF([1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], order=2)</span>

<span class="gp">In [16]: </span><span class="n">bch</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
<span class="gh">Out[16]: </span><span class="go">True</span>
Expand All @@ -7889,15 +7889,15 @@

<span class="gp">In [19]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="n">bch</span><span class="o">.</span><span class="n">k</span><span class="p">));</span> <span class="n">m</span>
<span class="gh">Out[19]: </span>
<span class="go">GF([[0, 0, 1, 1, 0, 1, 1],</span>
<span class="go"> [0, 0, 1, 0, 1, 0, 0],</span>
<span class="go"> [1, 1, 1, 0, 0, 0, 1]], order=2)</span>
<span class="go">GF([[0, 0, 1, 0, 1, 0, 1],</span>
<span class="go"> [0, 0, 1, 1, 1, 1, 0],</span>
<span class="go"> [0, 1, 0, 0, 1, 1, 1]], order=2)</span>

<span class="gp">In [20]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[20]: </span>
<span class="go">GF([[0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1],</span>
<span class="go"> [0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0],</span>
<span class="go"> [1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1]], order=2)</span>
<span class="go">GF([[0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1],</span>
<span class="go"> [0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0],</span>
<span class="go"> [0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0]], order=2)</span>
</code></pre></div>
</div>
<p>Detect no errors in the valid codewords.</p>
Expand All @@ -7917,9 +7917,9 @@

<span class="gp">In [26]: </span><span class="n">c</span>
<span class="gh">Out[26]: </span>
<span class="go">GF([[1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1],</span>
<span class="go"> [1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0],</span>
<span class="go"> [0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1]], order=2)</span>
<span class="go">GF([[1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1],</span>
<span class="go"> [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0],</span>
<span class="go"> [1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0]], order=2)</span>

<span class="gp">In [27]: </span><span class="n">bch</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
<span class="gh">Out[27]: </span><span class="go">array([ True, True, True])</span>
Expand All @@ -7935,14 +7935,14 @@
<span class="gp">In [30]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="n">bch</span><span class="o">.</span><span class="n">k</span> <span class="o">-</span> <span class="mi">3</span><span class="p">));</span> <span class="n">m</span>
<span class="gh">Out[30]: </span>
<span class="go">GF([[0, 0, 0, 0],</span>
<span class="go"> [0, 0, 1, 1],</span>
<span class="go"> [1, 0, 0, 0]], order=2)</span>
<span class="go"> [0, 1, 1, 0],</span>
<span class="go"> [0, 1, 0, 1]], order=2)</span>

<span class="gp">In [31]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[31]: </span>
<span class="go">GF([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],</span>
<span class="go"> [0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0],</span>
<span class="go"> [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1]], order=2)</span>
<span class="go"> [0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1],</span>
<span class="go"> [0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]], order=2)</span>
</code></pre></div>
</div>
<p>Detect no errors in the valid codewords.</p>
Expand All @@ -7963,8 +7963,8 @@
<span class="gp">In [37]: </span><span class="n">c</span>
<span class="gh">Out[37]: </span>
<span class="go">GF([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],</span>
<span class="go"> [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0],</span>
<span class="go"> [0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1]], order=2)</span>
<span class="go"> [1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1],</span>
<span class="go"> [1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]], order=2)</span>

<span class="gp">In [38]: </span><span class="n">bch</span><span class="o">.</span><span class="n">detect</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
<span class="gh">Out[38]: </span><span class="go">array([ True, True, True])</span>
Expand Down
48 changes: 24 additions & 24 deletions v0.3.x/api/galois.BCH.encode/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7885,15 +7885,15 @@
<span class="gp">In [2]: </span><span class="n">GF</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">field</span>

<span class="gp">In [3]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">(</span><span class="n">bch</span><span class="o">.</span><span class="n">k</span><span class="p">);</span> <span class="n">m</span>
<span class="gh">Out[3]: </span><span class="go">GF([0, 1, 1, 1, 1, 1, 1], order=2)</span>
<span class="gh">Out[3]: </span><span class="go">GF([0, 1, 0, 1, 1, 0, 0], order=2)</span>

<span class="gp">In [4]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[4]: </span><span class="go">GF([0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1], order=2)</span>
<span class="gh">Out[4]: </span><span class="go">GF([0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1], order=2)</span>
</code></pre></div>
</div>
<p>Compute the parity symbols only.</p>
<div class="highlight-ipython notranslate"><div class="highlight"><pre><span></span><code><span class="gp">In [5]: </span><span class="n">p</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">output</span><span class="o">=</span><span class="s2">&quot;parity&quot;</span><span class="p">);</span> <span class="n">p</span>
<span class="gh">Out[5]: </span><span class="go">GF([0, 0, 0, 1, 0, 1, 1, 1], order=2)</span>
<span class="gh">Out[5]: </span><span class="go">GF([1, 0, 0, 0, 1, 1, 1, 1], order=2)</span>
</code></pre></div>
</div>
</div>
Expand All @@ -7904,15 +7904,15 @@
<span class="gp">In [7]: </span><span class="n">GF</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">field</span>

<span class="gp">In [8]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">(</span><span class="n">bch</span><span class="o">.</span><span class="n">k</span> <span class="o">-</span> <span class="mi">3</span><span class="p">);</span> <span class="n">m</span>
<span class="gh">Out[8]: </span><span class="go">GF([1, 0, 1, 0], order=2)</span>
<span class="gh">Out[8]: </span><span class="go">GF([0, 1, 1, 0], order=2)</span>

<span class="gp">In [9]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[9]: </span><span class="go">GF([1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0], order=2)</span>
<span class="gh">Out[9]: </span><span class="go">GF([0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1], order=2)</span>
</code></pre></div>
</div>
<p>Compute the parity symbols only.</p>
<div class="highlight-ipython notranslate"><div class="highlight"><pre><span></span><code><span class="gp">In [10]: </span><span class="n">p</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">output</span><span class="o">=</span><span class="s2">&quot;parity&quot;</span><span class="p">);</span> <span class="n">p</span>
<span class="gh">Out[10]: </span><span class="go">GF([0, 1, 1, 0, 1, 1, 1, 0], order=2)</span>
<span class="gh">Out[10]: </span><span class="go">GF([1, 0, 0, 1, 0, 1, 0, 1], order=2)</span>
</code></pre></div>
</div>
</div>
Expand All @@ -7924,23 +7924,23 @@

<span class="gp">In [13]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="n">bch</span><span class="o">.</span><span class="n">k</span><span class="p">));</span> <span class="n">m</span>
<span class="gh">Out[13]: </span>
<span class="go">GF([[1, 0, 1, 0, 0, 0, 0],</span>
<span class="go"> [1, 1, 0, 0, 0, 1, 1],</span>
<span class="go"> [1, 1, 1, 1, 0, 0, 1]], order=2)</span>
<span class="go">GF([[1, 0, 0, 1, 0, 0, 0],</span>
<span class="go"> [1, 0, 0, 0, 0, 1, 1],</span>
<span class="go"> [0, 0, 0, 1, 0, 0, 0]], order=2)</span>

<span class="gp">In [14]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[14]: </span>
<span class="go">GF([[1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0],</span>
<span class="go"> [1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0],</span>
<span class="go"> [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0]], order=2)</span>
<span class="go">GF([[1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1],</span>
<span class="go"> [1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0],</span>
<span class="go"> [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1]], order=2)</span>
</code></pre></div>
</div>
<p>Compute the parity symbols only.</p>
<div class="highlight-ipython notranslate"><div class="highlight"><pre><span></span><code><span class="gp">In [15]: </span><span class="n">p</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">output</span><span class="o">=</span><span class="s2">&quot;parity&quot;</span><span class="p">);</span> <span class="n">p</span>
<span class="gh">Out[15]: </span>
<span class="go">GF([[1, 1, 0, 1, 0, 0, 1, 0],</span>
<span class="go"> [0, 0, 1, 1, 1, 1, 1, 0],</span>
<span class="go"> [0, 1, 1, 0, 1, 0, 1, 0]], order=2)</span>
<span class="go">GF([[1, 1, 1, 1, 0, 1, 0, 1],</span>
<span class="go"> [0, 1, 0, 0, 1, 0, 1, 0],</span>
<span class="go"> [0, 0, 0, 1, 1, 1, 0, 1]], order=2)</span>
</code></pre></div>
</div>
</div>
Expand All @@ -7952,23 +7952,23 @@

<span class="gp">In [18]: </span><span class="n">m</span> <span class="o">=</span> <span class="n">GF</span><span class="o">.</span><span class="n">Random</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="n">bch</span><span class="o">.</span><span class="n">k</span> <span class="o">-</span> <span class="mi">3</span><span class="p">));</span> <span class="n">m</span>
<span class="gh">Out[18]: </span>
<span class="go">GF([[0, 0, 0, 0],</span>
<span class="go"> [1, 1, 1, 1],</span>
<span class="go"> [1, 1, 1, 0]], order=2)</span>
<span class="go">GF([[1, 1, 0, 0],</span>
<span class="go"> [1, 0, 1, 0],</span>
<span class="go"> [0, 1, 1, 1]], order=2)</span>

<span class="gp">In [19]: </span><span class="n">c</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">);</span> <span class="n">c</span>
<span class="gh">Out[19]: </span>
<span class="go">GF([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],</span>
<span class="go"> [1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1],</span>
<span class="go"> [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0]], order=2)</span>
<span class="go">GF([[1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1],</span>
<span class="go"> [1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0],</span>
<span class="go"> [0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0]], order=2)</span>
</code></pre></div>
</div>
<p>Compute the parity symbols only.</p>
<div class="highlight-ipython notranslate"><div class="highlight"><pre><span></span><code><span class="gp">In [20]: </span><span class="n">p</span> <span class="o">=</span> <span class="n">bch</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">output</span><span class="o">=</span><span class="s2">&quot;parity&quot;</span><span class="p">);</span> <span class="n">p</span>
<span class="gh">Out[20]: </span>
<span class="go">GF([[0, 0, 0, 0, 0, 0, 0, 0],</span>
<span class="go"> [0, 1, 0, 1, 1, 0, 0, 1],</span>
<span class="go"> [1, 0, 0, 0, 1, 0, 0, 0]], order=2)</span>
<span class="go">GF([[1, 1, 1, 1, 1, 0, 1, 1],</span>
<span class="go"> [0, 1, 1, 0, 1, 1, 1, 0],</span>
<span class="go"> [0, 1, 0, 0, 0, 1, 0, 0]], order=2)</span>
</code></pre></div>
</div>
</div>
Expand Down
Loading

0 comments on commit b29f312

Please sign in to comment.