Skip to content

Commit

Permalink
More doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Dec 29, 2023
1 parent 2e1e334 commit 3a01d26
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 115 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

[![](https://img.shields.io/badge/docs-quarto-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAABDCAMAAADwFEhBAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB2lBMVEUAAABxvP90vP9zu/90u/90u/90u/90u/91uv91vP9zuv91v/91uv91u/9zvP90u/90uv92uv+As/91u/91u/90u/90u/90vP+Aqv90u/91u/9zuv90uf90u/90u/90u/9zuf9ttv90u/90u/91vP8A//92uv90u/95tv9zuv90u/90vP9zuv90u/91uv91u/90u/90vP90uf9zvP90u/93vv90u/90u/93u/9qv/90u/9zu/91vP90u/90vP95vP9Vqv90u/90u/91u/90u/90uf+Av/91u/90u/9xvf90u/91vP92vv90u/+AgP90u/9zu/91vP9vvP90u/90uv90u/94tP90u/9zvP90uv90u/90u/91u/90vP9zu/90uv91u/90uv9zvP9zuv9xu/9zvP90u/90u/90vP9zvP90uf9xxv90u/90uv90u/9zvf90u/90u/90u/90uv91uv90vP90uf90u/91vP90u/9wuP9zu/9zvP9zuv90u/92v/90uv90vP9yvP90uv90u/9mzP91u/90vP90u/92vP90vP9zvP90u/90u/90u/90u/9yuv91uv90u/91vP91u/90u/90u/9zu/91vf90u/90u/91u/90u//////Zz6urAAAAnHRSTlMAImOdxOv+4LqQWRgwjt/NdxoKadL8uUQGcOjJTUvbvygOpfh2ATTaFV3kLnPvP4P3ckJb8Cv12Q8M16ibWjkTA8+VYvshBJdWG8OBJ+ICfzyMF9FR/RGERauW9LHBvqfHhp9vLTWwqWdUFgm1kU8f+taeXCWIC+FI7BmHU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OhjVaPPmDCsT56qGc8yLuv8PKBivCh3nfjBbnlj6KXHd6LllaQReu39VxjpD8sYb96SX0rfFTdqo+Sf5PsP/kbwIxVPa90nb+Pzl4gEYaZq+GvWzYgnvskBdtLtI9+dxo/Ez4yKYOdXz+8/Q9bFSNnfVFr9fpX8A/gO4x9ExakgAAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABDoAMABAAAAAEAAABDAAAAAEC2TfoAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjMtMDgtMjJUMDI6MDg6MTgrMDA6MDDjF9jVAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIzLTA4LTIyVDAyOjA4OjE4KzAwOjAwkkpgaQAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyMy0wOC0yMlQwMjowODoxOSswMDowMGMoSgIAAAARdEVYdGV4aWY6Q29sb3JTcGFjZQAxD5sCSQAAABJ0RVh0ZXhpZjpFeGlmT2Zmc2V0ADM4rbi+IwAAABd0RVh0ZXhpZjpQaXhlbFhEaW1lbnNpb24ANjeFsWfdAAAAF3RFWHRleGlmOlBpeGVsWURpbWVuc2lvbgA2N1gnvlgAAAASdEVYdHRpZmY6T3JpZW50YXRpb24AMber/DsAAAAASUVORK5CYII=)](https://peekxc.github.io/primate/)
<!-- [![coverage_badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/peekxc/ef42349965f40edf4232737026690c5f/raw/coverage_info.json)](https://coveralls.io/github/peekxc/simplextree-py) -->
[![build_macos](https://img.shields.io/github/actions/workflow/status/peekxc/primate/build_macos.yml?logo=apple&logoColor=white)](https://github.com/peekxc/primate/actions/workflows/build_macos.yml)
[![build_windows](https://img.shields.io/github/actions/workflow/status/peekxc/primate/build_windows.yml?logo=windows&logoColor=white)](https://github.com/peekxc/primate/actions/workflows/build_windows.yml)
[![build_linux](https://img.shields.io/github/actions/workflow/status/peekxc/primate/build_linux.yml?logo=linux&logoColor=white)](https://github.com/peekxc/primate/actions/workflows/build_linux.yml)
<!-- [![PyPI Version](https://img.shields.io/pypi/v/simplextree)](https://pypi.org/project/simplextree) -->
[![Python versions](https://img.shields.io/badge/python-%E2%89%A5%203.8-blue.svg)](https://github.com/peekxc/primate/actions)

<!-- [![coverage_badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/peekxc/ef42349965f40edf4232737026690c5f/raw/coverage_info.json)](https://coveralls.io/github/peekxc/simplextree-py) -->
<!-- [![PyPI Version](https://img.shields.io/pypi/v/simplextree)](https://pypi.org/project/simplextree) -->

`primate`, short for **Pr**obabalistic **I**mplicit **Ma**trix **T**race **E**stimator, is a Python package that provides estimators of quantities derived from [matrix functions](https://en.wikipedia.org/wiki/Analytic_function_of_a_matrix); that is, matrices parameterized by functions:

Expand Down
10 changes: 6 additions & 4 deletions docs/basic/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ <h1 class="title">Installation</h1>
<!-- https://stackoverflow.com/questions/122906s39/quantifiable-metrics-benchmarks-on-the-usage-of-header-only-c-libraries/13593041#13593041 -->
<section id="platform-support" class="level3">
<h3 class="anchored" data-anchor-id="platform-support">Platform support</h3>
<p>Platform-specific wheels are currently built with cibuildwheel and uploaded to PyPI. These enable <code>primate</code> to be installed on supported architecture / CPython implementations without compilation. As of 12/29/23, native <code>primate</code> wheels are buitl for the following platforms:</p>
<!-- Platform-specific wheels are currently built with cibuildwheel and uploaded to PyPI. -->
<p>For certain platforms, <code>primate</code> can be installed from PyPi without compilation. As of 12/29/23, native <code>primate</code> wheels are built for the following platforms:</p>
<table class="table">
<thead>
<tr class="header">
Expand Down Expand Up @@ -402,11 +403,12 @@ <h3 class="anchored" data-anchor-id="platform-support">Platform support</h3>
</tr>
</tbody>
</table>
<p>Wheels are currently built with <a href="https://cibuildwheel.readthedocs.io/en/stable/">cibuildwheel</a>. Currently no support is offered for PyPy, 32-bit runtimes, or <a href="https://devguide.python.org/versions/#supported-versions">unsupported versions of CPython</a>. If your platform isn’t on this list, feel free to make an issue requesting support.</p>
<p>Wheels are currently built with <a href="https://cibuildwheel.readthedocs.io/en/stable/">cibuildwheel</a>. Currently no support is offered for <a href="https://www.pypy.org/">PyPy</a>, 32-bit systems, or <a href="https://devguide.python.org/versions/#supported-versions">unsupported versions of CPython</a>.</p>
<p>If your platform isn’t on this table but you would like it to be supported, feel free to <a href="https://github.com/peekxc/primate">make an issue</a>.</p>
</section>
<section id="compiling-from-source" class="level3">
<h3 class="anchored" data-anchor-id="compiling-from-source">Compiling from source</h3>
<p>To install the package from its source distribution, a C++20 compiler is required; the current builds are all built with some variant of <a href="https://clang.llvm.org/">clang</a>. For platform- and compiler-specific settings, consult the build scripts and CI configuration files.</p>
<p>To install the package from its source distribution, a C++20 compiler is required; the current builds are all built with some variant of <a href="https://clang.llvm.org/">clang</a>, preferably version 15.0 or higher. For platform- and compiler-specific settings, consult the build scripts and CI configuration files.</p>
</section>
<section id="c-installation" class="level3">
<h3 class="anchored" data-anchor-id="c-installation">C++ Installation</h3>
Expand Down Expand Up @@ -445,7 +447,7 @@ <h3 class="anchored" data-anchor-id="c-installation">C++ Installation</h3>
<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Single-thread execution only; ARM-based OSX runners come stocked with Apple’s clang, which doesn’t natively ship with <code>libomp.dylib</code>, though this <a href="https://mac.r-project.org/openmp/">may be fixable</a>. Feel free to file an PR if you can get this working.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn1"><p>Single-thread execution only; ARM-based OSX runners compile with Apple’s clang, which doesn’t natively ship with <code>libomp.dylib</code>, though this <a href="https://mac.r-project.org/openmp/">may be fixable</a>. Feel free to file an PR if you can get this working.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>Single-thread execution only; <code>primate</code> depends on OpenMP 4.5+, which isn’t supported on any Windows compiler I’m aware of.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section></div></main> <!-- /main -->
Expand Down
6 changes: 1 addition & 5 deletions docs/basic/integration.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@
<h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#python-usage" id="toc-python-usage" class="nav-link active" data-scroll-target="#python-usage">Python usage</a></li>
<li><a href="#c-usage" id="toc-c-usage" class="nav-link" data-scroll-target="#c-usage">C++ usage</a></li>
<li><a href="#c-usage" id="toc-c-usage" class="nav-link active" data-scroll-target="#c-usage">C++ usage</a></li>
</ul>
</nav>
</div>
Expand All @@ -364,8 +363,6 @@ <h1 class="title">Integration</h1>
</header>


<section id="python-usage" class="level2">
<h2 class="anchored" data-anchor-id="python-usage">Python usage</h2>
<p><code>primate</code> supports a variety of matrix-types of the box, including numpy <code>ndarray</code>’s, compressed <a href="https://docs.scipy.org/doc/scipy/reference/sparse.html">sparse matrices</a> (a lá SciPy), and <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html">LinearOperators</a>—the latter enables the use of <em>matrix free</em> operators.</p>
<p>Outside of the natively types above, the basic requirements for any operator <code>A</code> to be used with e.g.&nbsp;the <code>Lanczos</code> method in <code>primate</code> are:</p>
<ol type="1">
Expand Down Expand Up @@ -402,7 +399,6 @@ <h2 class="anchored" data-anchor-id="python-usage">Python usage</h2>
)
## True
``` -->
</section>
<section id="c-usage" class="level2">
<h2 class="anchored" data-anchor-id="c-usage">C++ usage</h2>
<p>Similarly, to get started calling any matrix-free function provided by <code>primate</code> on the C++ side, such <code>hutch</code> or <code>lanczos</code>, simply pass any type with <code>.shape()</code> and <code>.matvec()</code> member functions:</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/basic/performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ <h1 class="title">Performance</h1>
<p><code>primate</code> provides a variety of efficient algorithms for estimating quantities derived from matrix functions. These algorithms are largely implemented in C++ to minimize overhead, and for some computational problems <code>primate</code> can out-perform the standard algorithms for estimating spectral quantities by several orders of magnitude. Nonetheless, there are some performance-related caveats to be aware of.</p>
<!-- The main -->
<!-- To illustrate this, we give an example below using Toeplitz matrices. -->
<div id="a5cf844d" class="cell" data-execution_count="1">
<div id="a4792004" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> scipy.linalg <span class="im">import</span> toeplitz</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> primate.trace <span class="im">import</span> hutch </span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -386,7 +386,7 @@ <h1 class="title">Performance</h1>
<span id="cb1-41"><a href="#cb1-41" aria-hidden="true" tabindex="-1"></a>a, b <span class="op">=</span> lanczos(T, deg<span class="op">=</span><span class="dv">499</span>, orth<span class="op">=</span><span class="dv">150</span>)</span>
<span id="cb1-42"><a href="#cb1-42" aria-hidden="true" tabindex="-1"></a>np.<span class="bu">sum</span>(np.<span class="bu">abs</span>(eigvalsh_tridiagonal(a,b)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="87320ce5" class="cell" data-execution_count="2">
<div id="e2cabf3d" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> timeit </span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>timeit.timeit(<span class="kw">lambda</span>: hutch(A, maxiter<span class="op">=</span><span class="dv">20</span>, deg<span class="op">=</span><span class="dv">5</span>, fun<span class="op">=</span><span class="st">"log"</span>, quad<span class="op">=</span><span class="st">"fttr"</span>), number <span class="op">=</span> <span class="dv">1000</span>)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>timeit.timeit(<span class="kw">lambda</span>: np.<span class="bu">sum</span>(np.log(np.linalg.eigvalsh(A))), number <span class="op">=</span> <span class="dv">1000</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/basic/todo.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@



<div id="7e43e6e6" class="cell" data-execution_count="1">
<div id="690056ed" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># a, b = 0.8, 2</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co"># x = np.random.uniform(low=0, high=10, size=40)</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co"># eps = np.random.normal(loc=0, scale=1.0, size=40)</span></span>
Expand Down
Loading

0 comments on commit 3a01d26

Please sign in to comment.