Skip to content

Commit fc83d58

Browse files
committed
Comments
1 parent 07ecc15 commit fc83d58

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

ext/TensorKitCUDAExt/cutensormap.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,13 @@ function LinearAlgebra.isposdef(t::CuTensorMap)
119119
InnerProductStyle(spacetype(t)) === EuclideanInnerProduct() || return false
120120
for (c, b) in blocks(t)
121121
# do our own hermitian check
122-
isherm = MatrixAlgebraKit.ishermitian(b; atol = eps(real(eltype(b))), rtol = eps(real(eltype(b))))
122+
isherm = MatrixAlgebraKit.ishermitian(b)
123123
isherm || return false
124-
isposdef(project_hermitian!(b)) || return false
124+
isposdef(Hermitian(b)) || return false
125125
end
126126
return true
127127
end
128128

129-
function LinearAlgebra.isposdef(t::TensorKit.AdjointTensorMap{T, S, N₁, N₂, <:CuTensorMap}) where {T, S, N₁, N₂}
130-
return isposdef(adjoint(t))
131-
end
132-
133129
function Base.promote_rule(
134130
::Type{<:TT₁},
135131
::Type{<:TT₂}

src/factorizations/adjoint.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,7 @@ function MAK.svd_compact!(t::AdjointTensorMap, F, alg::DiagonalAlgorithm)
111111
F′ = svd_compact!(adjoint(t), reverse(adjoint.(F)), _adjoint(alg))
112112
return reverse(adjoint.(F′))
113113
end
114+
115+
function LinearAlgebra.isposdef(t::AdjointTensorMap)
116+
return isposdef(adjoint(t))
117+
end

src/tensors/linalg.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ LinearAlgebra.isdiag(t::AbstractTensorMap) = all(LinearAlgebra.isdiag ∘ last,
196196

197197
# In-place methods
198198
#------------------
199-
# Wrapping the blocks in a StridedView enables multithreading if JULIA_NUM_THREADS > 1
200-
# but can cause problems with underlying array types (like CuArray) that don't yet play
201-
# nicely with StridedViews
202-
# TODO: reconsider this strategy, consider spawning different threads for different blocks
203199

204200
# Copy, adjoint and fill:
205201
function Base.copy!(tdst::AbstractTensorMap, tsrc::AbstractTensorMap)

0 commit comments

Comments
 (0)