-true</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/BlockSparseArrays.jl/blob/6f297cb22ee3765b91bbe69e9c3993823bec0f2d/src/factorizations/svd.jl#L15-L69">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="BlockSparseArrays.svd!-Tuple{Any}" href="#BlockSparseArrays.svd!-Tuple{Any}"><code>BlockSparseArrays.svd!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">svd!(A; full::Bool = false, alg::Algorithm = default_svd_alg(A)) -> SVD</code></pre><p><code>svd!</code> is the same as <a href="#BlockSparseArrays.svd-Tuple{Any}"><code>svd</code></a>, but saves space by overwriting the input <code>A</code>, instead of creating a copy. See documentation of <a href="#BlockSparseArrays.svd-Tuple{Any}"><code>svd</code></a> for details.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/BlockSparseArrays.jl/blob/6f297cb22ee3765b91bbe69e9c3993823bec0f2d/src/factorizations/svd.jl#L147-L152">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="BlockSparseArrays.svd-Tuple{Any}" href="#BlockSparseArrays.svd-Tuple{Any}"><code>BlockSparseArrays.svd</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">svd(A; full::Bool = false, alg::Algorithm = default_svd_alg(A)) -> SVD</code></pre><p>Compute the singular value decomposition (SVD) of <code>A</code> and return an <code>SVD</code> object.</p><p><code>U</code>, <code>S</code>, <code>V</code> and <code>Vt</code> can be obtained from the factorization <code>F</code> with <code>F.U</code>, <code>F.S</code>, <code>F.V</code> and <code>F.Vt</code>, such that <code>A = U * Diagonal(S) * Vt</code>. The algorithm produces <code>Vt</code> and hence <code>Vt</code> is more efficient to extract than <code>V</code>. The singular values in <code>S</code> are sorted in descending order.</p><p>Iterating the decomposition produces the components <code>U</code>, <code>S</code>, and <code>V</code>.</p><p>If <code>full = false</code> (default), a "thin" SVD is returned. For an <span>$M \times N$</span> matrix <code>A</code>, in the full factorization <code>U</code> is <span>$M \times M$</span> and <code>V</code> is <span>$N \times N$</span>, while in the thin factorization <code>U</code> is <span>$M \times K$</span> and <code>V</code> is <span>$N \times K$</span>, where <span>$K = \min(M,N)$</span> is the number of singular values.</p><p><code>alg</code> specifies which algorithm and LAPACK method to use for SVD:</p><ul><li><code>alg = DivideAndConquer()</code> (default): Calls <code>LAPACK.gesdd!</code>.</li><li><code>alg = QRIteration()</code>: Calls <code>LAPACK.gesvd!</code> (typically slower but more accurate) .</li></ul><div class="admonition is-compat"><header class="admonition-header">Julia 1.3</header><div class="admonition-body"><p>The <code>alg</code> keyword argument requires Julia 1.3 or later.</p></div></div><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia> A = rand(4,3);
0 commit comments