From f7b70c8a3aef99f02c73be14912bc680a39fe649 Mon Sep 17 00:00:00 2001 From: John E Date: Sat, 17 Oct 2026 15:53:18 -0400 Subject: [PATCH] docs: fix some typos Signed-off-by: John E --- docs/src/user_interface/decompositions.md | 5 ++--- src/common/regularinv.jl | 4 ++-- src/implementations/batched_svd.jl | 6 +++--- src/interface/decompositions.jl | 6 +++--- src/interface/orthnull.jl | 2 +- src/pullbacks/eig.jl | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/src/user_interface/decompositions.md b/docs/src/user_interface/decompositions.md index 0c9048154..6bd6a9d3d 100644 --- a/docs/src/user_interface/decompositions.md +++ b/docs/src/user_interface/decompositions.md @@ -164,7 +164,7 @@ Filter = t -> t isa Type && t <: MatrixAlgebraKit.SVDAlgorithms The [Polar Decomposition](https://en.wikipedia.org/wiki/Polar_decomposition) of a matrix `A` is a factorization `A = W * P`, where `W` is unitary and `P` is positive semi-definite. If `A` is invertible (and therefore square), the polar decomposition always exists and is unique. For non-square matrices `A` of size `(m, n)`, the decomposition `A = W * P` with `P` positive semi-definite of size `(n, n)` and `W` isometric of size `(m, n)` exists only if `m >= n`, and is unique if `A` and thus `P` is full rank. -For `m <= n`, we can analoguously decompose `A` as `A = P * Wᴴ` with `P` positive semi-definite of size `(m, m)` and `Wᴴ` of size `(m, n)` such that `W = (Wᴴ)'` is isometric. Only in the case `m = n` do both decompositions exist. +For `m <= n`, we can analogously decompose `A` as `A = P * Wᴴ` with `P` positive semi-definite of size `(m, m)` and `Wᴴ` of size `(m, n)` such that `W = (Wᴴ)'` is isometric. Only in the case `m = n` do both decompositions exist. The decompositions `A = W * P` or `A = P * Wᴴ` can be computed with the [`left_polar`](@ref) and [`right_polar`](@ref) functions, respectively. @@ -173,7 +173,7 @@ left_polar right_polar ``` -These functions can be implemented by first computing a singular value decomposition, and then constructing the polar decomposition from the singular values and vectors. Alternatively, the polar decomposition can be computed using an +These functions can be implemented by first computing a singular value decomposition, and then constructing the polar decomposition from the singular values and vectors. Alternatively, the polar decomposition can be computed using an iterative method based on Newton's method, that can be more efficient for large matrices, especially if they are close to being isometric already. @@ -430,4 +430,3 @@ Additionally, the default value can also be controlled with a global toggle usin MatrixAlgebraKit.gaugefix! MatrixAlgebraKit.default_fixgauge ``` - diff --git a/src/common/regularinv.jl b/src/common/regularinv.jl index 3f42303df..7b94835b0 100644 --- a/src/common/regularinv.jl +++ b/src/common/regularinv.jl @@ -6,12 +6,12 @@ inv_regularized(a::Number, tol = defaulttol(a)) inv_regularized(A::Matrix, tol = defaulttol(A); isposdef = false, kwargs...) -Compute a smooth regularised inverse (L2 Tikhonov regularisation) of a number or square +Compute a smooth regularised inverse (L2 Tikhonov regularisation) of a number or square matrix a. * For numbers, this is given by `inv(hypot(a, tol))`. -* For matrices, this is computed using the singular value decomposition and aplying +* For matrices, this is computed using the singular value decomposition and applying `inv_regularized` to the singular values. If `isposdef = true`, the singular value decomposition is equivalent to the (Hermitian) eigenvalue decomposition of `A` and the latter is used instead. diff --git a/src/implementations/batched_svd.jl b/src/implementations/batched_svd.jl index 421401556..1e34b5aa3 100644 --- a/src/implementations/batched_svd.jl +++ b/src/implementations/batched_svd.jl @@ -194,7 +194,7 @@ for (f, f_lapack!, Alg) in ( check_input(batched_svd_compact!, A, USVᴴ, alg) driver = get(alg.kwargs, :driver, default_driver(alg, eltype(A))) supports_pointer_batch(alg, driver, eltype(A)) || - throw(ArgumentError(LazyString("driver ", driver, " does not suppport ragged (non-uniform) batches"))) + throw(ArgumentError(LazyString("driver ", driver, " does not support ragged (non-uniform) batches"))) return $svd_compact_f!(A, USVᴴ...; alg.kwargs...) end function batched_svd_compact!(A::AbstractArray{T, 3}, USVᴴ, alg::$Alg) where {T} @@ -205,7 +205,7 @@ for (f, f_lapack!, Alg) in ( check_input(batched_svd_full!, A, USVᴴ, alg) driver = get(alg.kwargs, :driver, default_driver(alg, eltype(A))) supports_pointer_batch(alg, driver, eltype(A)) || - throw(ArgumentError(LazyString("driver ", driver, " does not suppport ragged (non-uniform) batches"))) + throw(ArgumentError(LazyString("driver ", driver, " does not support ragged (non-uniform) batches"))) return $svd_full_f!(A, USVᴴ...; alg.kwargs...) end function batched_svd_full!(A::AbstractArray{T, 3}, USVᴴ, alg::$Alg) where {T} @@ -216,7 +216,7 @@ for (f, f_lapack!, Alg) in ( check_input(batched_svd_vals!, A, S, alg) driver = get(alg.kwargs, :driver, default_driver(alg, eltype(A))) supports_pointer_batch(alg, driver, eltype(A)) || - throw(ArgumentError(LazyString("driver ", driver, " does not suppport ragged (non-uniform) batches"))) + throw(ArgumentError(LazyString("driver ", driver, " does not support ragged (non-uniform) batches"))) return $svd_vals_f!(A, S; alg.kwargs...) end function batched_svd_vals!(A::AbstractArray{T, 3}, S, alg::$Alg) where {T} diff --git a/src/interface/decompositions.jl b/src/interface/decompositions.jl index 1d423564a..e98e2cb14 100644 --- a/src/interface/decompositions.jl +++ b/src/interface/decompositions.jl @@ -32,7 +32,7 @@ by construction. Algorithm type to denote the standard LAPACK algorithm for computing the QR decomposition of a matrix using Householder reflectors. The specific LAPACK function can be controlled using -the keyword arugments, i.e. `?geqrt` will be chosen if `blocksize > 1`. With +the keyword arguments, i.e. `?geqrt` will be chosen if `blocksize > 1`. With `blocksize == 1`, `?geqrf` will be chosen if `pivoted == false` and `?geqp3` will be chosen if `pivoted == true`. The keyword `positive = true` is used to ensure that the diagonal elements of `R` are non-negative. @@ -44,7 +44,7 @@ elements of `R` are non-negative. Algorithm type to denote the standard LAPACK algorithm for computing the LQ decomposition of a matrix using Householder reflectors. The specific LAPACK function can be controlled using -the keyword arugments, i.e. `?gelqt` will be chosen if `blocksize > 1` or `?gelqf` will be +the keyword arguments, i.e. `?gelqt` will be chosen if `blocksize > 1` or `?gelqf` will be chosen if `blocksize == 1`. The keyword `positive = true` is used to ensure that the diagonal elements of `L` are non-negative. """ @@ -382,7 +382,7 @@ $_fixgauge_docs CUSOLVER_SVDPolar(; fixgauge = default_fixgauge()) Algorithm type to denote the CUSOLVER driver for computing the singular value decomposition of -a general matrix by using Halley's iterative algorithm to compute the polar decompositon, +a general matrix by using Halley's iterative algorithm to compute the polar decomposition, followed by the hermitian eigenvalue decomposition of the positive definite factor. $_fixgauge_docs """ diff --git a/src/interface/orthnull.jl b/src/interface/orthnull.jl index be8c461dc..51541dcc4 100644 --- a/src/interface/orthnull.jl +++ b/src/interface/orthnull.jl @@ -115,7 +115,7 @@ application purposes. ### `alg::Nothing` This default mode uses the presence of a truncation strategy `trunc` to determine an optimal -decomposition type, which will typicall be LQ-based for no truncation, or SVD-based for +decomposition type, which will typically be LQ-based for no truncation, or SVD-based for truncation. The remaining keyword arguments are passed on directly to the algorithm selection procedure of the chosen decomposition type. diff --git a/src/pullbacks/eig.jl b/src/pullbacks/eig.jl index c865d88c0..11fbc02c9 100755 --- a/src/pullbacks/eig.jl +++ b/src/pullbacks/eig.jl @@ -214,7 +214,7 @@ end remove_eig_gauge_dependence!(ΔV, D, V; degeneracy_atol = ...) Remove the gauge-dependent part from the cotangent `ΔV` of the eigenvector matrix `V`. The -eigenvectors are only determined up to a scalar factor (or an abitrary linear transformation +eigenvectors are only determined up to a scalar factor (or an arbitrary linear transformation across eigenvectors associated with degenerate eigenvalues), so the corresponding components of `ΔV` are projected out. """