Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/src/user_interface/decompositions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -430,4 +430,3 @@ Additionally, the default value can also be controlled with a global toggle usin
MatrixAlgebraKit.gaugefix!
MatrixAlgebraKit.default_fixgauge
```

4 changes: 2 additions & 2 deletions src/common/regularinv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/implementations/batched_svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions src/interface/decompositions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
"""
Expand Down Expand Up @@ -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
"""
Expand Down
2 changes: 1 addition & 1 deletion src/interface/orthnull.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/pullbacks/eig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
Loading