Skip to content

Commit 73d37f4

Browse files
committed
rename is_left_isometric and is_right_isometric
1 parent c079d0c commit 73d37f4

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

src/common/matrixproperties.jl

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ Test whether a linear map is an isometry, where the type of isometry is controll
88
99
The `isapprox_kwargs` are passed on to `isapprox` to control the tolerances.
1010
11-
New specializations should overload [`isleftisometric`](@ref) and [`isrightisometric`](@ref).
11+
New specializations should overload [`MatrixAlgebraKit.is_left_isometric`](@ref) and
12+
[`MatrixAlgebraKit.s_right_isometric`](@ref).
1213
1314
See also [`isunitary`](@ref).
1415
"""
1516
function isisometric(A; side::Symbol = :left, isapprox_kwargs...)
16-
side === :left && return isleftisometric(A; isapprox_kwargs...)
17-
side === :right && return isrightisometric(A; isapprox_kwargs...)
17+
side === :left && return is_left_isometric(A; isapprox_kwargs...)
18+
side === :right && return is_right_isometric(A; isapprox_kwargs...)
1819

1920
throw(ArgumentError(lazy"Invalid isometry side: $side"))
2021
end
@@ -28,40 +29,40 @@ The `isapprox_kwargs` are passed on to `isapprox` to control the tolerances.
2829
See also [`isisometric`](@ref).
2930
"""
3031
function isunitary(A; isapprox_kwargs...)
31-
return isleftisometric(A; isapprox_kwargs...) &&
32-
isrightisometric(A; isapprox_kwargs...)
32+
return is_left_isometric(A; isapprox_kwargs...) &&
33+
is_right_isometric(A; isapprox_kwargs...)
3334
end
3435
function isunitary(A::AbstractMatrix; isapprox_kwargs...)
3536
size(A, 1) == size(A, 2) || return false
36-
return isleftisometric(A; isapprox_kwargs...)
37+
return is_left_isometric(A; isapprox_kwargs...)
3738
end
3839

3940
@doc """
40-
isleftisometric(A; isapprox_kwargs...) -> Bool
41+
is_left_isometric(A; isapprox_kwargs...) -> Bool
4142
42-
Test whether a linear map is a left isometry, i.e. `A' * A ≈ I`.
43+
Test whether a linear map is a (left) isometry, i.e. `A' * A ≈ I`.
4344
The `isapprox_kwargs` can be used to control the tolerances of the equality.
4445
45-
See also [`isisometric`](@ref) and [`isrightisometric`](@ref).
46-
""" isleftisometric
46+
See also [`isisometric`](@ref) and [`MatrixAlgebraKit.is_right_isometric`](@ref).
47+
""" is_left_isometric
4748

48-
function isleftisometric(A::AbstractMatrix; atol::Real = 0, rtol::Real = defaulttol(A), norm = LinearAlgebra.norm)
49+
function is_left_isometric(A::AbstractMatrix; atol::Real = 0, rtol::Real = defaulttol(A), norm = LinearAlgebra.norm)
4950
P = A' * A
5051
nP = norm(P) # isapprox would use `rtol * max(norm(P), norm(I))`
5152
diagview(P) .-= 1
5253
return norm(P) <= max(atol, rtol * nP) # assume that the norm of I is `sqrt(n)`
5354
end
5455

5556
@doc """
56-
isrightisometric(A; isapprox_kwargs...) -> Bool
57+
is_right_isometric(A; isapprox_kwargs...) -> Bool
5758
58-
Test whether a linear map is a right isometry, i.e. `A * A' ≈ I`.
59+
Test whether a linear map is a (right) isometry, i.e. `A * A' ≈ I`.
5960
The `isapprox_kwargs` can be used to control the tolerances of the equality.
6061
61-
See also [`isisometric`](@ref) and [`isleftisometric`](@ref).
62-
""" isrightisometric
62+
See also [`isisometric`](@ref) and [`MatrixAlgebraKit.is_left_isometric`](@ref).
63+
""" is_right_isometric
6364

64-
function isrightisometric(A::AbstractMatrix; atol::Real = 0, rtol::Real = defaulttol(A), norm = LinearAlgebra.norm)
65+
function is_right_isometric(A::AbstractMatrix; atol::Real = 0, rtol::Real = defaulttol(A), norm = LinearAlgebra.norm)
6566
P = A * A'
6667
nP = norm(P) # isapprox would use `rtol * max(norm(P), norm(I))`
6768
diagview(P) .-= 1

0 commit comments

Comments
 (0)