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
2 changes: 1 addition & 1 deletion ext/TensorKitCUDAExt/cutensormap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function LinearAlgebra.isposdef(t::CuTensorMap)
InnerProductStyle(spacetype(t)) === EuclideanInnerProduct() || return false
for (c, b) in blocks(t)
# do our own hermitian check
isherm = MatrixAlgebraKit.ishermitian(b; atol = eps(real(eltype(b))), rtol = eps(real(eltype(b))))
isherm = MatrixAlgebraKit.ishermitian(b)
isherm || return false
isposdef(Hermitian(b)) || return false
end
Expand Down
7 changes: 7 additions & 0 deletions src/factorizations/adjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ _adjoint(alg::MAK.LAPACK_HouseholderRQ) = MAK.LAPACK_HouseholderQL(; alg.kwargs.
_adjoint(alg::MAK.PolarViaSVD) = MAK.PolarViaSVD(_adjoint(alg.svd_alg))
_adjoint(alg::AbstractAlgorithm) = alg

_adjoint(alg::MAK.CUSOLVER_HouseholderQR) = MAK.LQViaTransposedQR(alg)
_adjoint(alg::MAK.LQViaTransposedQR) = alg.qr_alg

for f in
[
:svd_compact, :svd_full, :svd_vals,
Expand Down Expand Up @@ -108,3 +111,7 @@ function MAK.svd_compact!(t::AdjointTensorMap, F, alg::DiagonalAlgorithm)
F′ = svd_compact!(adjoint(t), reverse(adjoint.(F)), _adjoint(alg))
return reverse(adjoint.(F′))
end

function LinearAlgebra.isposdef(t::AdjointTensorMap)
return isposdef(adjoint(t))
end
4 changes: 1 addition & 3 deletions src/tensors/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,12 @@ LinearAlgebra.isdiag(t::AbstractTensorMap) = all(LinearAlgebra.isdiag ∘ last,

# In-place methods
#------------------
# Wrapping the blocks in a StridedView enables multithreading if JULIA_NUM_THREADS > 1
# TODO: reconsider this strategy, consider spawning different threads for different blocks

# Copy, adjoint and fill:
function Base.copy!(tdst::AbstractTensorMap, tsrc::AbstractTensorMap)
space(tdst) == space(tsrc) || throw(SpaceMismatch("$(space(tdst)) ≠ $(space(tsrc))"))
for ((c, bdst), (_, bsrc)) in zip(blocks(tdst), blocks(tsrc))
copy!(StridedView(bdst), StridedView(bsrc))
copy!(bdst, bsrc)
end
return tdst
end
Expand Down
Loading